博弈论 取石子(一)

</pre>取石子(一)</h2><div class="problem-ins" style="text-align:center">时间限制:<span class="editable highlight" id="problem[time_limit]" style="color:rgb(113,32,21)">3000</span> ms  |  内存限制:<span class="editable highlight" id="problem[memory_limit]" style="color:rgb(113,32,21)">65535</span> KB</div><div class="problem-ins" style="text-align:center">难度:<span class="editable highlight" style="color:rgb(113,32,21)">2</span></div></div><div class="clr" style="clear:both; color:rgb(70,70,70); font-family:Tahoma,Arial,sans-serif,simsun; font-size:13.3333px; line-height:21.6667px"></div><dl class="problem-display" style="margin:0px; padding:0px; font-size:14px; color:rgb(70,70,70); font-family:Tahoma,Arial,sans-serif,simsun"><dt style="margin:1em 0px 0.2em; padding:0px; color:rgb(113,32,21); font-size:16px; font-weight:bold">描述</dt><dd style="margin:0px; padding:0px">一天,TT在寝室闲着无聊,和同寝的人玩起了取石子游戏,而由于条件有限,他/她们是用旺仔小馒头当作石子。游戏的规则是这样的。设有一堆石子,数量为N(1<=N<=1000000),两个人轮番取出其中的若干个,每次最多取M个(1<=M<=1000000),最先把石子取完者胜利。我们知道,TT和他/她的室友都十分的聪明,那么如果是TT先取,他/她会取得游戏的胜利么?<div class="clr" style="clear:both"></div><dl class="others" style="margin:0px; padding:0px"><dt style="margin:1em 0px 0.2em; padding:0px; color:rgb(113,32,21); font-size:16px; font-weight:bold">输入</dt><dd style="margin:0px; padding:0px">第一行是一个正整数n表示有n组测试数据输入有不到1000组数据,每组数据一行,有两个数N和M,之间用空格分隔。</dd><dt style="margin:1em 0px 0.2em; padding:0px; color:rgb(113,32,21); font-size:16px; font-weight:bold">输出</dt><dd style="margin:0px; padding:0px">对于每组数据,输出一行。如果先取的TT可以赢得游戏,则输出“Win”,否则输出“Lose”(引号不用输出)</dd><dt style="margin:1em 0px 0.2em; padding:0px; color:rgb(113,32,21); font-size:16px; font-weight:bold">样例输入</dt><dd style="margin:0px; padding:0px"><pre id="sample_input" style="margin-top:0px; margin-bottom:0px; padding:5px 10px; font-family:Consolas,'Courier New','DejaVu Sans Mono','Droid Sans Mono',monospace; border:1px solid rgb(204,204,204); min-height:20px; line-height:1.5em; background:rgb(239,239,239)">2
1000 1
1 100
样例输出
Lose
Win
#include"iostream"
using namespace std;
int main()
{
	int t,n,m;
	cin>>t;
	while(t--)
	{
		cin>>n>>m;
		if(n<=m) cout<<"Win"<<endl;
		else if(n%(m+1)==0) cout<<"Lose"<<endl;
		else cout<<"Win"<<endl;
	}
	return 0;
}


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值