Submission #8419

#TimeUsernameProblemLanguageResultExecution timeMemory
8419tncks0121N-orthotope (kriii2_N)C++98
4 / 4
0 ms1088 KiB
#include <cstdio> using namespace std; int n, s[100], e[100]; int main() { scanf("%d", &n); for(int i = 0; i < n; i++) scanf("%d%d", s+i, e+i); int res = 0; for(int i = 0; i < n; i++) { int x, y; scanf("%d%d", &x, &y); if(s[i] < y && x < e[i]) ++res; else if(s[i] != y && x != e[i]) return 0 & puts("-1"); } printf("%d\n", res); // your code goes here return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...