标签:__int64 queue def script esc ret 博弈 ted memory
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 8159 Accepted Submission(s): 4950
C/C++:
1 #include <map> 2 #include <queue> 3 #include <cmath> 4 #include <vector> 5 #include <string> 6 #include <cstdio> 7 #include <cstring> 8 #include <climits> 9 #include <iostream> 10 #include <algorithm> 11 #define INF 0x3f3f3f3f 12 #define LL long long 13 #define wzf ((1 + sqrt(5.0)) / 2.0) 14 using namespace std; 15 16 __int64 n, fib[45] = {1, 1}; 17 18 void calc() 19 { 20 for (__int64 i = 2; i <= 46; ++ i) 21 fib[i] = fib[i - 1] + fib[i - 2]; 22 } 23 24 bool is_fib() 25 { 26 for (__int64 i = 2; i <= 45; ++ i) 27 { 28 if (fib[i] > n) return false; 29 if (n == fib[i]) 30 return true; 31 } 32 return false; 33 } 34 35 int main() 36 { 37 calc(); 38 while (scanf("%I64d", &n), n) 39 { 40 if (is_fib()) 41 printf("Second win\n"); 42 else 43 printf("First win\n"); 44 } 45 return 0; 46 }
标签:__int64 queue def script esc ret 博弈 ted memory
原文地址:https://www.cnblogs.com/GetcharZp/p/9557816.html