Submission #9168

#TimeUsernameProblemLanguageResultExecution timeMemory
9168myungwooN-orthotope (kriii2_N)C++98
4 / 4
0 ms1088 KiB
#include<stdio.h> #define max2(a,b) ((a)<(b)?(b):(a)) #define min2(a,b) ((a)>(b)?(b):(a)) int s1[12], e1[12], s2[12], e2[12], fl, cnt; int main(){ int i, n; scanf("%d", &n); for(i=0; i<n; i++)scanf("%d%d", &s1[i], &e1[i]); for(i=0; i<n; i++)scanf("%d%d", &s2[i], &e2[i]); for(i=0; i<n; i++){ if(max2(s1[i],s2[i]) > min2(e1[i],e2[i]))fl=1; if(max2(s1[i],s2[i]) < min2(e1[i],e2[i]))cnt++; } if(fl)puts("-1"); else printf("%d", cnt); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...