Bash游戏
来源:互联网 发布:疯狂java讲义代码 编辑:程序博客网 时间:2024/06/03 14:52
题目传送门
有一堆石子一共N个,两人轮流拿,最少拿1个,最多拿K个,最后拿完石子的获胜
如果N % (k+1) == 0,B必胜,
否则A必胜
代码如下:
#include <iostream>#include <algorithm>#include <cstring>#include <stdio.h>#include <string>#include <cmath>#define ll long long#define mem(name,value) memset(name,value,sizeof(name))using namespace std;const int maxn = 105;int dp[maxn][maxn];int main(){ int t; cin >> t; while(t--){ int n,k; cin >> n >> k; if(n % (k+1) == 0) cout << "B" <<endl; else cout << "A" <<endl; } return 0;}
0 0
- Bash游戏
- Bash游戏
- Bash游戏 V2
- Bash游戏 V3
- Bash游戏 V4
- 1066 Bash游戏
- Bash游戏(博弈)
- 1124: Bash 游戏
- 1067 Bash游戏 V2
- 51 nod bash游戏
- Bash游戏(巴什博奕)
- 51nod_1066 Bash游戏
- 1066 Bash游戏
- 1068 Bash游戏 V3
- Bash游戏 V2
- 51nod Bash游戏V1 Bash游戏V2
- 51nod 1066 Bash游戏
- 51nod 1066 Bash游戏
- Odd Even Linked List
- 第四周《C语言及程序设计》实践项目20 经典:查找的艺术
- 【搭建开发环境】android Studio-[Could not find com.android.support:multidex:1.0.1]
- myFirstBlog
- jquery 中的回调函数
- Bash游戏
- 第二周 项目2 程序的多文件组成 (c++)
- Java SE面试题(二)
- 【华为OJ】简单错误记录【未完成】
- datatables表格2
- xml的解析二
- JSX语法及特点
- Java基本数据类型
- demo