传送门
思想有点像蚯蚓那个题
#include <cstdio> #define N 0001 #define LL long long #define min(x, y) ((x) < (y) ? (x) : (y)) #define max(x, y) ((x) > (y) ? (x) : (y)) LL q1[N], q2[N]; LL a1, b1, d1, a2, b2, d2; int n, h1 = 1, t1 = 1, h2 = 1, t2; int main() printf("%lld\n", x); return 0; }
来自洛谷的更简便的题解
#include <cstdio> #include <iostream> typedef unsigned long long ull; //注意本题要用unsigned long long。 const int N = 0000; ull a[N+5]; //这里我们将a数组看成一个队列 inline ull mn(ull x, ull y) int main() //重点理解while循环的内容。因为算出的F1()或F2()的数据单调递增,所以可以用这样的方式生成整个数列 std::cout << a[n]; //最后输出即可。 return 0; } //祝各位早日AC此题!
上一篇:[BZOJ1604] [Usaco2008 Open]Cow Neighborhoods 奶牛的邻居(好题)
下一篇:[TyvjP1519] 博彩游戏(AC自动机 + DP)
队列 模拟









