1116 - Ekka Dokka PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB Ekka and his friend Dokka decided to buy a cake. They both love cakes and that's why they want to share the cake after buying it. As the name suggested tha…
lightoj 1020 A Childhood Game 链接:http://lightoj.com/volume_showproblem.php?problem=1020 题意:一堆石子有 m 个,Alice和Bob可以从中取1个或者2个,如果Alice先取,最后取的人败:如果Bob先取,最后取的人胜.问胜利者. 思路:枚举前几个石子的情况,很容易找出每种情况的必败点,找规律.如果Alice先取,Alice的必败点为mod 3 == 1,如果Bob先取,Bob必败点在 mod 3 == 0处…
#include <iostream> #include <cstdio> #include <cmath> using namespace std; const int maxN = 100005; int a[maxN]; int t, tt; int n, q, x, y; int Bsearch_lower_bound(int x) { int l = 0, r = n - 1, mid = 0; while (l <= r) { mid = (l + r…