This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
int n;
cin >> n;
vector<int> l(n), r(n), d(n), u(n);
for (int &i : l) cin >> i;
for (int &i : r) cin >> i;
for (int &i : u) cin >> i;
for (int &i : d) cin >> i;
bool ok = true;
for (int i = 0; i < n; ++i)
if ((l[i] == -1 && r[i] != -1) || (l[i] != -1 && r[i] == -1) || (u[i] == -1 && d[i] != -1) || (u[i] != -1 && d[i] == -1))
ok = false;
cout << (ok ? "DA" : "NE");
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |