链接: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 long
using 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;
}

  

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-04
  • 2021-08-28
  • 2021-04-07
  • 2021-10-18
  • 2022-12-23
猜你喜欢
  • 2021-10-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-30
相关资源
相似解决方案