首页 > 代码库 > 2016 ACM/ICPC Asia Regional Qingdao Online HDU5882

2016 ACM/ICPC Asia Regional Qingdao Online HDU5882

链接:http://acm.hdu.edu.cn/showproblem.php?pid=5882

解法:一个点必须出度和入度相同就满足题意,所以加上本身就是判断奇偶性

#include<stdio.h>#include<math.h>#include<string.h>#include<stack>#include<set>#include<queue>#include<vector>#include<map>#include<iostream>#include<algorithm>#define LL long longusing namespace std;int main(){    int n;    while(~scanf("%d",&n))    {        while(n--)        {            int m;            scanf("%d",&m);            if(m&1)            {                cout<<"Balanced"<<endl;            }            else            {                cout<<"Bad"<<endl;            }        }    }    return 0;}

  

2016 ACM/ICPC Asia Regional Qingdao Online HDU5882