Submission #170329

#TimeUsernameProblemLanguageResultExecution timeMemory
170329ngmhKocka (COCI18_kocka)C++11
70 / 70
211 ms5880 KiB
#include <bits/stdc++.h> using namespace std; long long s, a[5][100000]; void fail(){ cout << "NE"; exit(0); } int main(){ cin >> s; if(s == 3) fail(); for(int i = 0; i < 4; i++){ for(int j = 0; j < s; j++) cin >> a[i][j]; } for(int i = 0; i < s; i++){ if(a[0][i] == -1 && a[1][i] != -1) fail(); if(a[1][i] == -1 && a[0][i] != -1) fail(); if(a[0][i] == 0 && a[1][i] == 0) continue; if(a[0][i] == s-1 && a[1][i] != 0) fail(); if(a[1][i] == s-1 && a[0][i] != 0) fail(); } for(int i = 0; i < s; i++){ if(a[2][i] == -1 && a[3][i] != -1) fail(); if(a[3][i] == -1 && a[3][i] != -1) fail(); if(a[2][i] == -1 && a[3][i] == 0) continue; if(a[2][i] == s-1 && a[3][i] != 0) fail(); if(a[3][i] == s-1 && a[2][i] != 0) fail(); } cout << "DA"; }
#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...