Submission #1019389

#TimeUsernameProblemLanguageResultExecution timeMemory
1019389rockstarKocka (COCI18_kocka)C++17
0 / 70
22 ms3932 KiB
#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) || (l[i] + r[i] >= n) || (u[i] + d[i] >= n) || u[l[i]] > i || d[l[i]] > (n - 1 - i) || u[r[i]] > i || u[r[i]] > n - 1 - i || u[l[i]] == -1 || d[l[i]] == -1 || u[r[i]] == -1 || d[r[i]] == -1 || l[u[i]] > i || l[d[i]] > (n - 1 - i) || r[u[i]] > i || r[u[i]] > n - 1 - i || l[u[i]] == -1 || l[d[i]] == -1 || r[u[i]] == -1 || r[d[i]] == -1) ok = false; cout << (ok ? "DA" : "NE"); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...