parent
3b645965d7
commit
fb01e15e33
@ -1,45 +0,0 @@
|
||||
#include <bits/stdc++.h>
|
||||
using namespace std;
|
||||
|
||||
int nums[60];
|
||||
|
||||
void process(int n) {
|
||||
int a = 0, b = -1;
|
||||
for (int i = 0; i < n; i++) {
|
||||
if (nums[i] == 1)
|
||||
a++;
|
||||
else
|
||||
b += nums[i] + 1;
|
||||
}
|
||||
if (a == 0 && b > 0) {
|
||||
if (b % 2)
|
||||
puts("YES");
|
||||
else
|
||||
puts("NO");
|
||||
}
|
||||
if (a > 0 && b > 2) {
|
||||
if (a % 2 || b % 2)
|
||||
puts("YES");
|
||||
else
|
||||
puts("NO");
|
||||
}
|
||||
if (a > 0 && b <= 2) {
|
||||
if (a % 3)
|
||||
puts("YES");
|
||||
else
|
||||
puts("NO");
|
||||
}
|
||||
}
|
||||
|
||||
int main() {
|
||||
int t, n;
|
||||
cin >> t;
|
||||
while (t--) {
|
||||
memset(nums, 0, sizeof(nums));
|
||||
cin >> n;
|
||||
for (int i = 0; i < n; i++)
|
||||
cin >> nums[i];
|
||||
process(n);
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
Reference in new issue