HDU.2149 Public Sale (博弈论 巴什博弈) 题意分析 巴什博奕裸题 博弈论快速入门 代码总览 #include <bits/stdc++.h> using namespace std; int main() { int n,m,s,r; while(scanf("%d %d",&m,&n) != EOF){ s = m%(n+1); if(s == 0) printf("none\n"); else{ r = (m -…
题目链接:acm.hdu.edu.cn/showproblem.php?pid=2149 Problem Description 虽然不想,但是现实总归是现实,Lele始终没有逃过退学的命运,因为他没有拿到奖学金.现在等待他的,就是像FarmJohn一样的农田生涯.要种田得有田才行,Lele听说街上正在举行一场别开生面的拍卖会,拍卖的物品正好就是一块20亩的田地.于是,Lele带上他的全部积蓄,冲往拍卖会.后来发现,整个拍卖会只有Lele和他的死对头Yueyue.通过打听,Lele知道这场拍卖的…
Public Sale Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7944    Accepted Submission(s): 4738 Problem Description 虽然不想,但是现实总归是现实,Lele始终没有逃过退学的命运,因为他没有拿到奖学金.现在等待他的,就是像FarmJohn一样的农田生涯. 要种田得有田才行…
思路:只要能给对方留下n+1,我就能胜,否则败. #include <iostream> #include <cstdio> using namespace std; int main() { //freopen("input.txt", "r", stdin); int n, m; while(cin>>m>>n) { if(m<=n) { for(int i=m; i<=n; i++) { cout&l…
#include<stdio.h> int main() { int n,m; while(scanf("%d %d",&m,&n)!=EOF) { )==) printf("none\n"); else if(m>n) printf()); else if(m<=n) { for(int i=m;i<n;i++) printf("%d ",i); printf("%d\n",n)…
Problem Description 虽然不想,但是现实总归是现实,Lele始终没有逃过退学的命运,因为他没有拿到奖学金.现在等待他的,就是像FarmJohn一样的农田生涯.要种田得有田才行,Lele听说街上正在举行一场别开生面的拍卖会,拍卖的物品正好就是一块20亩的田地.于是,Lele带上他的全部积蓄,冲往拍卖会.后来发现,整个拍卖会只有Lele和他的死对头Yueyue.通过打听,Lele知道这场拍卖的规则是这样的:刚开始底价为0,两个人轮流开始加价,不过每次加价的幅度要在1-N之间,当价格…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4764 Problem Description Tang and Jiang are good friends. To decide whose treat it is for dinner, they are playing a game. Specifically, Tang and Jiang will alternatively write numbers (integers) on a wh…
Public Sale Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 11215    Accepted Submission(s): 6631 Problem Description 虽然不想,但是现实总归是现实,Lele始终没有逃过退学的命运,因为他没有拿到奖学金.现在等待他的,就是像FarmJohn一样的农田生涯. 要种田得有田才…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4764 题意:Tang 和 Jiang 玩一个游戏,轮流写下一个数,Tang先手,第一次Tang只能写[1,k]之间的数,X表示上一个人写的数,Y表示下一个人写的数,每次必须满足 1<=Y-X<=k,直到有一个人写下的数不小于n,写下那个数的人失败,游戏结束,输出胜利的人. 分析:可以看做是取石子游戏,有一堆n-1个的石子,两个人轮流去石子,每次最多能去k个,如果没有石子可取则输,这就将问题转化为巴…
先在每堆中进行巴什博弈,然后尼姆 #include<stdio.h> int main() { int T; int i,n; int ans,m,l; scanf("%d",&T); while(T--) { scanf("%d",&n); ans=; ;i<=n;i++) { scanf("%d%d",&m,&l); ans=ans^(m%(l+)); } ) printf("Yes…