Submission #9202

#TimeUsernameProblemLanguageResultExecution timeMemory
9202veckalN-orthotope (kriii2_N)C++14
4 / 4
0 ms1088 KiB
#include<stdio.h> int n, s1[12], e1[12], s2[12], e2[12]; int main() { scanf("%d", &n); for (int i=0; i<n; ++i) scanf("%d%d", s1+i, e1+i); for (int i=0; i<n; ++i) scanf("%d%d", s2+i, e2+i); int ans = n; for (int i=0; i<n; ++i) { if (s1[i] > e2[i] || s2[i] > e1[i]) { ans = -1; break; } if (s1[i] == e2[i] || s2[i] == e1[i]) --ans; } printf("%d\n", ans); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...