#include <bits/stdc++.h>
using namespace std;
#define int long long
int32_t main() {
ios::sync_with_stdio(0); cin.tie(0);
int n, A, B, ans = 0;
cin >> n >> A >> B;
vector<bool> seen(A * B, 0);
for (int i = 0; i < n; i++) {
int l, r;
cin >> l >> r;
for (int j = l; j <= r; j++) seen[j % (A * B)] = 1;
}
for (bool x : seen) ans += x;
cout << ans << '\n';
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
12 ms |
1364 KB |
Output is correct |
3 |
Correct |
12 ms |
1236 KB |
Output is correct |
4 |
Incorrect |
1 ms |
320 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Execution timed out |
5035 ms |
15316 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
9 ms |
432 KB |
Output is correct |
3 |
Correct |
9 ms |
468 KB |
Output is correct |
4 |
Correct |
8 ms |
460 KB |
Output is correct |
5 |
Execution timed out |
5041 ms |
468 KB |
Time limit exceeded |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
304 ms |
596 KB |
Output is correct |
3 |
Runtime error |
183 ms |
524288 KB |
Execution killed with signal 9 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
304 ms |
596 KB |
Output is correct |
3 |
Runtime error |
183 ms |
524288 KB |
Execution killed with signal 9 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
304 ms |
596 KB |
Output is correct |
3 |
Runtime error |
183 ms |
524288 KB |
Execution killed with signal 9 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1196 ms |
122628 KB |
Output is correct |
3 |
Runtime error |
2 ms |
596 KB |
Execution killed with signal 6 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
12 ms |
1364 KB |
Output is correct |
3 |
Correct |
12 ms |
1236 KB |
Output is correct |
4 |
Incorrect |
1 ms |
320 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |