uva 12293 Box Game
2014-03-25 00:47
393 查看
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3714
博弈我不大懂但是看出规律了
#include<iostream>
#include<cstring>
#include<string>
#include<math.h>
using namespace std;
string str;
int a[32];
int main()
{
for(int i=1;i<32;i++)
{
a[i]=pow(2,i)-1;
}
int n;
while(cin>>n&&n)
{
int f=0;
for(int i=1;i<32;i++)
{
if(a[i]==n)
{
f=1;
break;
}
}
if(f)
cout<<"Bob"<<endl;
else
cout<<"Alice"<<endl;
}
return 0;
}
博弈我不大懂但是看出规律了
#include<iostream>
#include<cstring>
#include<string>
#include<math.h>
using namespace std;
string str;
int a[32];
int main()
{
for(int i=1;i<32;i++)
{
a[i]=pow(2,i)-1;
}
int n;
while(cin>>n&&n)
{
int f=0;
for(int i=1;i<32;i++)
{
if(a[i]==n)
{
f=1;
break;
}
}
if(f)
cout<<"Bob"<<endl;
else
cout<<"Alice"<<endl;
}
return 0;
}
相关文章推荐
- UVA 12293 - Box Game(博弈)
- uva 12293 - Box Game(组合游戏)
- UVA - 12293 Box Game (规律)
- UVA 12293 - Box Game
- UVA 12293 Box Game
- UVA 12293 Box Game(博弈入门)
- UVA 12293 Box Game 组合游戏/SG定理+找规律
- UVA 12293 Box Game
- UVa 12293 Box Game(博弈,SG函数)
- UVA 12293 - Box Game(博弈)
- uva 12293 uva 11892 (简单博弈)
- uva 12293 博弈
- UVA-12293(组合游戏)
- 数学专项game_theory:UVa 12293
- UVa11892 Box Game
- Uva 10271 Chopsticks
- Uva - 11039 - Building designing
- uva 11401 - Triangle Counting
- Immediate Decodability - UVa 644 字符串处理
- uva1399 - Puzzle AC自动机+记忆化搜索