Submission #9268

#TimeUsernameProblemLanguageResultExecution timeMemory
9268jwvg0425N-orthotope (kriii2_N)C++98
4 / 4
0 ms1088 KiB
#include<stdio.h> int min(int a, int b) { return (a < b) ? a : b; } int max(int a, int b) { return (a>b) ? a : b; } int main(void) { int N, s[11], e[11], si, ei, M = 0, mi, ma,value; scanf("%d", &N); for (int i = 0; i < N; i++) { scanf("%d %d", &s[i], &e[i]); } for (int i = 0; i < N; i++) { scanf("%d %d", &si, &ei); mi = min(min(si, ei), min(s[i], e[i])); ma = max(max(si, ei), max(s[i], e[i])); value = ma - mi - (ei - si + e[i] - s[i]); if (value>0) { printf("-1"); return 0; } if (value < 0) { M++; } } printf("%d", M); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...