0
点赞
收藏
分享

微信扫一扫

1.博弈大师(博弈论)

芷兮离离 2022-04-23 阅读 145
c++

#include <iostream>6
#include <cmath>
using namespace std;
typedef long long LL;
int main()
{
int t;
cin>>t;
while(t--)
{
LL n,a,b;
cin>>n>>a>>b;
if(a>b)// 如果有技能卡 他们会利于自己
{
cout<<"niuniu"<<endl;
}
else if(b>a)
{
cout<<"niumei"<<endl;
}
else// 卡相同的时候 判断 n个石子 在第几轮 拿完
{ // n*(n+1)/2 = x
double ans=sqrt(1+8*n)/2-1.0/2;// 向下取整
if((LL) ans&1) cout<<"niumei"<<endl;
else cout<<"niuniu"<<endl;
}

}
return 0;
}

 

举报

相关推荐

0 条评论