#include <bits/stdc++.h>
using namespace std;
pair<int, int> ar[100001];
int main()
{
cin.tie(0); cout.tie(0);
ios_base::sync_with_stdio(false);
int n; cin >> n;
for(int i = 0; i < n; i++)
{
int a, b, c, d; cin >> a >> b >> c >> d;
ar[i] = {100 * a + b, 100*c + d};
}
int ans = 0;
int now = 301;
while(1)
{
if(now > 1130)
break;
int k = 0;
for(int i = 0; i < n; i++)
{
if(ar[i].first <= now && now < ar[i].second)
k = max(k, ar[i].second);
}
if(now >= k)
{
cout << 0;
return 0;
}
now = k;
ans++;
}
cout << ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
2 ms |
340 KB |
Output is correct |
6 |
Correct |
5 ms |
468 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
596 KB |
Output is correct |
2 |
Correct |
5 ms |
596 KB |
Output is correct |
3 |
Correct |
8 ms |
840 KB |
Output is correct |
4 |
Correct |
12 ms |
980 KB |
Output is correct |
5 |
Correct |
11 ms |
1112 KB |
Output is correct |
6 |
Correct |
14 ms |
1364 KB |
Output is correct |
7 |
Correct |
16 ms |
1524 KB |
Output is correct |
8 |
Correct |
22 ms |
2048 KB |
Output is correct |
9 |
Correct |
44 ms |
2040 KB |
Output is correct |
10 |
Correct |
26 ms |
1968 KB |
Output is correct |