本文共 842 字,大约阅读时间需要 2 分钟。
因为题中是个环,
所以我们可以首先拿出一组m
如果n<m 先手必输
否则的话跑sg函数 n = n-m
#include #include #include #include #include #include #include #include #include #include #include #define MOD 2018#define LL long long#define ULL unsigned long long#define Pair pair #define mem(a, b) memset(a, b, sizeof(a))#define _ ios_base::sync_with_stdio(0),cin.tie(0)//freopen("1.txt", "r", stdin);using namespace std;const int maxn = 10010, INF = 0x7fffffff;int sg[maxn], vis[maxn];int a[maxn];void init(int n, int m){ mem(sg, 0); sg[m] = 1; for(int i=m; i<=n; i++) { mem(vis, 0); vis[sg[i-m]] = 1; int tot = i-m; for(int j=1; j > T; while(T--) { int n, m; cin>> n >> m; printf("Case #%d: ",++kase); if(n < m) { cout<< "abcdxyzk" <
转载于:https://www.cnblogs.com/WTSRUVF/p/9336977.html