题解列表

筛选

不好意思,直接输出了

摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){    cout<<"95959"<<endl;    return 0……

抢夺资源 经典巴什博弈

典型巴什博弈问题**如果n=m+1,不管先手取多少,都是后手赢**由此可以得到启发,**只要给对手留下(m+1)的倍数,就能赢**```cpp#includeusingnamespacestd;intn,m;intmain(){while(cin>>n>>m){if(n%(m+1))cout

记忆化搜索-取球博弈

dfs搜索每种可能走法,vis数组存出现过的场面防止重复递归存在对手输则自己赢,不存在则查看是否可能出现平局,若两者情况都没有就必败注意每次递归交换操作对象```cpp#includeusingnamespacestd;typedeflonglongll;constintN=1e5+5;intn[5]

C++代码简便

摘要:解题思路:注意事项:参考代码:#include <iostream>using namespace std;int main() { int H = 0, M = 0, S = 0; int t; c……