码迷,mamicode.com
首页 > 其他好文 > 详细

[2020.12.4周五] 圆上对称博弈

时间:2020-12-09 12:15:50      阅读:5      评论:0      收藏:0      [点我收藏+]

标签:--   names   ace   game   ++   end   space   tps   pac   

[2020.12.4周五] 圆上对称博弈

1451D - Circle Game

题解:注意到后手总可以使点走在(k,k)上,所以如果(k,k)是必胜态,则后手胜;否则先手总可以使(n*k+k,k)上,如果这是必胜态则先手赢

tag:对称博弈

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=5e5+100; 
int main()
{
    int T;cin>>T;
    while(T--)
    {
         ll r,k;ll sum=0;
        cin>>r>>k;
        while((sum+k)*(sum+k)*2<=r*r)
        {
            sum+=k;
        }
        if((sum+k)*(sum+k)+sum*sum<=r*r) cout<<"Ashish"<<endl;
        else cout<<"Utkarsh"<<endl;
        
    }
}

[2020.12.4周五] 圆上对称博弈

标签:--   names   ace   game   ++   end   space   tps   pac   

原文地址:https://www.cnblogs.com/zx0710/p/14088350.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!