Submission #9154

#TimeUsernameProblemLanguageResultExecution timeMemory
9154hodducN-orthotope (kriii2_N)C++98
4 / 4
0 ms1088 KiB
#include<stdio.h> int s[15][2], e[15][2]; int over[15]; int main() { int N; int M; scanf("%d", &N); M = N; for(int i = 1; i <= N; i++) scanf("%d %d", &s[i][0],&s[i][1]); for(int i = 1; i <= N; i++) scanf("%d %d", &e[i][0],&e[i][1]); for(int i = 1; i <= N; i++) { if(e[i][1] < s[i][0] || s[i][1] < e[i][0]) { printf("-1"); return 0; } else if(e[i][1] <= s[i][0] || s[i][1] <= e[i][0]) { M--; } } printf("%d", M); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...