先来看看比较显然的几个局面
(a,0) 先手必败
(a,a) 先手必胜
(a,ak) 先手必胜
(a,ak+r),k>1 先手必胜,因为先手有主动权把(a,r)让给后手或留给自己
对于开局(a,r),r<a&&a/r<2,比较难分析,我们用暴力直接跑出结果
挑战程序设计竞赛把这种主动权成为自由度,名字真高端
这次的代码写的不怎么简练,不过能AC
#include #include #include #include #include #include #include #include #include #include #include #include