上一页 1 ··· 40 41 42 43 44 45 46 47 48 ··· 56 下一页
摘要: 如果x>1&&y>1,可以简化到其中一个为1的情况,这是等价的,当其中一个为1(假设为x),另一个一定能执行y-1次, 这是一个贪心问题,把所有的执行次数加起来比较就能得到结论 #include<map> #include<set> #include<cmath> #include<queue> # 阅读全文
posted @ 2017-06-23 11:50 walfy 阅读(270) 评论(0) 推荐(0) 编辑
摘要: 阶梯博弈原理参考:http://www.cnblogs.com/jiangjing/p/3849284.html 这题计算每两个之间的间隔就行了,如果是奇数个就把第一个前面的看作一个,偶数个就是两个点之间的间隔 m==1的时候特判,因为能一步就胜,m==2的情况第一个间隔要加1,因为当第一个间隔为0 阅读全文
posted @ 2017-06-23 10:21 walfy 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 先画一下N=2的情况,先手胜,再画一下N=3的情况,先手胜,所以大胆的猜测,无论N=多少,先手胜!! 这也能A真是个奇迹 #include<map> #include<set> #include<cmath> #include<queue> #include<stack> #include<vect 阅读全文
posted @ 2017-06-22 19:01 walfy 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 参考博客:http://blog.csdn.net/sun897949163/article/details/50609070 特判一下m=1的情况,然后m!=1时,无论对手取多少,我只要取的让这条链分成两个相同个数的子链就行了(之后按巴什博弈来处理),当然,如果先手能一次取完,那就后手必输 #in 阅读全文
posted @ 2017-06-22 18:24 walfy 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 和之前一道题是类似的,输出第一步走的方法,遍历数组找到a[i]^s<a[i]的那个数a[i]-a[i]^s就是要取的数 #include<map> #include<set> #include<cmath> #include<queue> #include<stack> #include<vecto 阅读全文
posted @ 2017-06-22 16:11 walfy 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 一眼就能看出来的巴什博弈,只是要输出第一步取的值,如果m>n+1,输出m%(n+1),否则输出m到n,因为这是第一步 #include<map> #include<set> #include<cmath> #include<queue> #include<stack> #include<vector 阅读全文
posted @ 2017-06-22 15:56 walfy 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 裸题,直接套公式 巴什游戏只是换了一个说法而已 #include<map> #include<set> #include<cmath> #include<queue> #include<stack> #include<vector> #include<cstdio> #include<cassert 阅读全文
posted @ 2017-06-22 15:32 walfy 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 挺像巴什博弈的,直接递推就能找到规律了,从2开始到9,s win,10到18,o win,18到162,s win,一直向下推进 #include<map> #include<set> #include<cmath> #include<queue> #include<stack> #include< 阅读全文
posted @ 2017-06-22 13:24 walfy 阅读(382) 评论(0) 推荐(0) 编辑
摘要: 超级坑的水题!!!想了两天没一点思路,看了题解第一段话就做出来了 刚开始一直在想找到通项就是例如an*10^n+...+a0*10^0-an-...-a0>=s,然后从这个里面找到规律,结果走进死胡同了 Let's prove that if x is really big, then x + 1  阅读全文
posted @ 2017-06-21 21:49 walfy 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 输的话输出0,赢就输出1并且输出第一步走后的数目 威佐夫博弈判断胜负 原理及常见题型求法: http://blog.csdn.net/y990041769/article/details/21694007 #include<map> #include<set> #include<cmath> #in 阅读全文
posted @ 2017-06-20 21:37 walfy 阅读(196) 评论(0) 推荐(0) 编辑
上一页 1 ··· 40 41 42 43 44 45 46 47 48 ··· 56 下一页