zoukankan      html  css  js  c++  java
  • Codeforces Round #646 (Div. 2) C——Game On Leaves 思维

    #include<map>
    #include<queue>
    #include<time.h>
    #include<limits.h>
    #include<cmath>
    #include<ostream>
    #include<iterator>
    #include<set>
    #include<stack>
    #include<cstdio>
    #include<cstring>
    #include<iostream>
    #include<algorithm>
    using namespace std;
    #define rep_1(i,m,n) for(int i=m;i<=n;i++)
    #define mem(st) memset(st,0,sizeof st)
    int read()
    {
        int res=0,ch,flag=0;
        if((ch=getchar())=='-')             //判断正负
            flag=1;
        else if(ch>='0'&&ch<='9')           //得到完整的数
            res=ch-'0';
        while((ch=getchar())>='0'&&ch<='9')
            res=res*10+ch-'0';
        return flag?-res:res;
    }
    typedef long long ll;
    typedef pair<int,int> pii;
    typedef unsigned long long ull;
    typedef pair<double,double> pdd;
    const int inf = 0x3f3f3f3f;
    const int N=1010;
    int in[N];
    void solve()
    {
        int n,x;
        cin>>n>>x;
        memset(in,0,sizeof in);
        for(int  i=1;i<n;i++)
        {
            int a,b;
            cin>>a>>b;
            in[a]++;
            in[b]++;
        }
        if(in[x]<=1)
            cout<<"Ayush"<<endl;
        else
        {
            if((n-1)%2)
                cout<<"Ayush"<<endl;
            else
                cout<<"Ashish"<<endl;
        }
    }
    int main()
    {
        int t;
        cin>>t;
        while(t--)
            solve(); 
        return 0;
    }
  • 相关阅读:
    eclipsesvn
    js邮箱和正则表达式
    jsreplace
    JQuery与Json转换
    thinkPHP时间戳格式化
    JS绝对定位到右下角
    chrome快捷键
    js配置示例
    JQuery class选择器
    JS调试技巧
  • 原文地址:https://www.cnblogs.com/QingyuYYYYY/p/13026970.html
Copyright © 2011-2022 走看看