Submission #9474

#TimeUsernameProblemLanguageResultExecution timeMemory
9474kkjjkkN-orthotope (kriii2_N)C++98
4 / 4
0 ms1088 KiB
#include <cstdio> int h[15][2], hh[15][2]; int main() { int n; scanf("%d", &n); for(int i = 0; i < n; i++) { scanf("%d %d", &h[i][0], &h[i][1]); }//printf("%d %d\n", h[i][0], h[i][1]); } for(int i = 0; i < n; i++) { scanf("%d %d", &hh[i][0], &hh[i][1]); }//printf("%d %d\n", hh[i][0], hh[i][1]); } int s = 0; for(int i = 0; i < n; i++) { if(hh[i][1] > h[i][1]) { if(hh[i][0] > h[i][1]) { s = -1; break; } if(hh[i][0] == h[i][1]) { } if(hh[i][0] < h[i][1]) { s++; } } else if(hh[i][1] == h[i][1]) { if(hh[i][0] != hh[i][1]) s++; } else if(hh[i][1] > h[i][0] && hh[i][1] < h[i][1]) { s++; } else if(hh[i][1] == h[i][0]) { } else if(hh[i][1] < h[i][0]) { s = -1; break; } } printf("%d", s); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...