Skip to content

Instantly share code, notes, and snippets.

@yooniversal
Created August 14, 2020 11:54
Show Gist options
  • Save yooniversal/6c20ee7c173e24d4dd7d3f5513e2bb8b to your computer and use it in GitHub Desktop.
Save yooniversal/6c20ee7c173e24d4dd7d3f5513e2bb8b to your computer and use it in GitHub Desktop.
[Codeforces #664 Div.2] A. Boboniu Likes to Color Balls
#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <vector>
using namespace std;
typedef long long ll;
int main() {
cin.tie(nullptr);
cout.tie(NULL);
ios_base::sync_with_stdio(false);
int t; cin >> t;
while (t--) {
ll r, g, b, w; cin >> r >> g >> b >> w;
ll cnt = 0;
if (r % 2) cnt++;
if (g % 2) cnt++;
if (b % 2) cnt++;
if (w % 2) cnt++;
if (cnt <= 1) {
cout << "Yes" << '\n';
continue;
}
if (r > 0 && g > 0 && b > 0) {
r--; g--; b--; w+=3;
}
cnt = 0;
if (r % 2) cnt++;
if (g % 2) cnt++;
if (b % 2) cnt++;
if (w % 2) cnt++;
if (cnt <= 1) {
cout << "Yes" << '\n';
continue;
}
cout << "No" << '\n';
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment