#include<bits/stdc++.h>
using namespace std;
#define ioss ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define int long long
#define pii pair<int, int>
#define fi first
#define se second
#define pb push_back
int n, a, b;
signed main() {
ioss;
cin >> n >> a >> b;
int tmp = a*b;
set<int> s;
for(int i = 0; i < n; i++) {
int l, r; cin >> l >> r;
for(int j = l; j <= r; j++) {
if(!s.count(j%tmp)) s.insert(j%tmp);
}
}
cout << s.size() << endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
37 ms |
9576 KB |
Output is correct |
3 |
Correct |
64 ms |
13708 KB |
Output is correct |
4 |
Incorrect |
2 ms |
832 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
320 KB |
Output is correct |
2 |
Runtime error |
3821 ms |
524288 KB |
Execution killed with signal 9 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
97 ms |
24268 KB |
Output is correct |
3 |
Correct |
94 ms |
24028 KB |
Output is correct |
4 |
Correct |
110 ms |
22984 KB |
Output is correct |
5 |
Execution timed out |
5037 ms |
46904 KB |
Time limit exceeded |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
482 ms |
47392 KB |
Output is correct |
3 |
Runtime error |
2631 ms |
524288 KB |
Execution killed with signal 9 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
482 ms |
47392 KB |
Output is correct |
3 |
Runtime error |
2631 ms |
524288 KB |
Execution killed with signal 9 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
482 ms |
47392 KB |
Output is correct |
3 |
Runtime error |
2631 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 |
Runtime error |
2513 ms |
524288 KB |
Execution killed with signal 9 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
37 ms |
9576 KB |
Output is correct |
3 |
Correct |
64 ms |
13708 KB |
Output is correct |
4 |
Incorrect |
2 ms |
832 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |