Submission #8918

#TimeUsernameProblemLanguageResultExecution timeMemory
8918xhaeN-orthotope (kriii2_N)C++14
4 / 4
0 ms1088 KiB
#include <cstdio> int data[2][100][2]; int n; int main(void) { scanf("%d", &n); for(int i = 0; i < n; i++) scanf("%d %d", data[0][i], data[0][i] + 1); for(int i = 0; i < n; i++) scanf("%d %d", data[1][i], data[1][i] + 1); int ans = n; for(int i = 0; i < n; i++) { int left = 0; if(data[0][i][0] > data[1][i][0]) left = 1; if(data[left][i][1] == data[!left][i][0]) ans--; else if(data[left][i][1] < data[!left][i][0]) { ans = -1; break; } } printf("%d\n", ans); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...