博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Paint Chain HDU - 3980(sg)
阅读量:4562 次
发布时间:2019-06-08

本文共 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

你可能感兴趣的文章
Eclipse修改已存在的SVN地址
查看>>
(转)使用 python Matplotlib 库绘图
查看>>
进程/线程切换原则
查看>>
正则表达式语法
查看>>
20165301 2017-2018-2 《Java程序设计》第四周学习总结
查看>>
Vue的简单入门
查看>>
urllib 中的异常处理
查看>>
通过SQL Server的扩展事件来跟踪SQL语句在运行时,时间都消耗到哪儿了?
查看>>
gulp
查看>>
pgsql查询优化之模糊查询
查看>>
不变模式
查看>>
20181227 新的目标
查看>>
androidtab
查看>>
php 事件驱动 消息机制 共享内存
查看>>
剑指offer 二叉树的bfs
查看>>
LeetCode Maximum Subarray
查看>>
让我们再聊聊浏览器资源加载优化
查看>>
underscore demo
查看>>
CSS hack
查看>>
每日一小练——数值自乘递归解
查看>>