Submission #9160

#TimeUsernameProblemLanguageResultExecution timeMemory
9160lemonsqueezeN-orthotope (kriii2_N)C++98
4 / 4
0 ms1088 KiB
#define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<algorithm> using namespace std; int D[2][15][2]; int main() { int N; scanf("%d", &N); for(int i=0;i<=1;i++){ for(int j=1;j<=N;j++){ for(int k=0;k<2;k++){ scanf("%d", D[i][j]+k); } } } int ans = 0, ch = 0; for(int i=1;i<=N;i++){ int mx = max( D[0][i][0], D[1][i][0]); int mn = min( D[0][i][1], D[1][i][1]); if( mn > mx ) ans++; else if( mn < mx) ch = -1; } if( ch == -1 ) ans = -1; printf("%d", ans); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...