#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int N;
cin >> N;
int A[24], B[24];
for(int i=0; i<N*2; i++) cin >> A[i];
for(int i=0; i<N*2; i++) cin >> B[i];
int cnt = 0;
for(int i=0; i<N*2; i+=2)
{
int S = max(A[0], B[0]), E = min(A[1], B[1]);
if(S < E) cnt++;
}
if(cnt == 0) cout << "-1";
else cout << cnt;
cout << endl;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1672 KB |
Output is correct |
2 |
Correct |
0 ms |
1672 KB |
Output is correct |
3 |
Correct |
0 ms |
1672 KB |
Output is correct |
4 |
Correct |
0 ms |
1672 KB |
Output is correct |
5 |
Incorrect |
0 ms |
1672 KB |
Output isn't correct |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |