Skip to content

Commit

Permalink
12854 solved
Browse files Browse the repository at this point in the history
  • Loading branch information
ksaveljev committed Feb 27, 2018
1 parent 0546bab commit 643a4bf
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions 12854.cpp
@@ -0,0 +1,25 @@
#include <iostream>
using namespace std;

#define REP(i, b, n) for (int i = b; i < n; i++)
#define rep(i, n) REP(i, 0, n)

int main(void) {
int a[5], b;

while (cin >> a[0]) {
bool ok = true;

rep (i, 4) {
cin >> a[i + 1];
}
rep (i, 5) {
cin >> b;
if (a[i] + b != 1) ok = false;
}

cout << (ok ? "Y" : "N") << endl;
}

return 0;
}

0 comments on commit 643a4bf

Please sign in to comment.