TOJ 3516.Game of Stones
来源:互联网 发布:linux thrift源码安装 编辑:程序博客网 时间:2024/06/06 01:20
题目链接:http://acm.tju.edu.cn/toj/showp3516.html
Time Limit: 1.0 Seconds Memory Limit: 65536K
Total Runs: 772 Accepted Runs: 308
Once a day, two people, A and B, played the game created by themselves again. Though they have played the game for many time, on the day something strange occured that B alway won the game. A was worried about whether he could win the game for at least one time, so A ask you for some help. Here are the rules:
1. This is a game played by two players in turn; one of them plays first.(Actually A was always the first one)
2. The game uses two piles of stones as tools. In one turn, one of the players takes at least one stone away from either of the piles.
3. The game ends with all stones taken away, and the player played last turn win the game.
In order to win the game, A praicticed for so many times that he can count out all the stones of either pile. Now your mission is to tell whether A can win the game even though B is smart enough to take the optional strategy.
Input
There are several cases. Each case has one line containing two numbers: n, m indicating the number of either pile. 0 <= n, m < 10^50.
Output
One line for each case with "Yes"(A could win) or "No"(A can't win).
Sample Input
1 12 1
Sample Output
NoYes
Source: TJU Team Selection Contest 2010 (3)
#include <stdio.h>#include <iostream>#include <string>using namespace std;int main(){ string n,m; while(cin>>n>>m) (n==m) ? printf("No\n") : printf("Yes\n");}
- TOJ 3516.Game of Stones
- Yet Another Game of Stones
- HDOJ 5973 Game of Taking Stones
- Codeforces Round #399:E. Game of Stones
- Codeforces 768E Game of Stones
- codeforces 786E Game of Stones
- Codeforces 768E Game of Stones 博弈
- TOJ--3483: Stones (水题)
- TOJ 3484.Stones
- [hdu 5973 Game of Taking Stones] Wythoff Game+大数运算
- HDU 5973 Game of Taking Stones 博弈+高精度
- HDU 5973 ICPC 大连 Game of Taking Stones
- codeforces 768 E Game of Stones(博弈)
- codeforces 399 E. Game of Stones 博弈 思维题
- 768E Game of Stones[Nim游戏][博弈]
- ZOJ 3964 Yet Another Game of Stones (博弈)
- ZOJ 3964 Yet Another Game of Stones(博弈论)
- Game of Taking Stones (大数 + 威佐夫博弈 java写的)
- 食物链(poj--1182)
- Java中的方法以及方法重载
- 深度学习笔记---梯度消失、梯度激增
- Python勇冠排行榜首,名企大咖教你免费学
- web测试和app测试重点
- TOJ 3516.Game of Stones
- docker入门教程
- js循环
- 菜鸟笔记--软件测试--百盒测试技术
- python3 GUI 开发 (1)环境配置
- POJ 1273 Drainage Ditches(最大流入门)
- HDU-4686 Arc of Dream(推公式+矩阵快速幂)
- 2017/7/30
- 九、Java中变量的使用规则