https://codeforces.com/contest/1542/problem/A
题意:读入2n个数,奇数与偶数个数相同则输出yes,否则输出no
Read in 2n numbers, odd and even numbers are the same, then output yes, otherwise output No
代码
Code:
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int t, n, u, cnt;
int main()
{
cin >> t;
while(t --)
{
cin >> n;
cnt = 0;
for(int i = 1; i <= n << 1; i ++) cin >> u, cnt += (u & 1);
if(n == cnt) cout << "Yes" << endl;
else cout << "No" << endl;
}
}