#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair < ll ,ll> pll;
ll n,a,b;
map < ll , ll >vis;
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0);
cin >> n >> a >> b;
ll le,ri, ans = 0;
ll pdt = a*b;
for(ll i = 0; i < n; i++){
cin >> le >> ri;
for(ll j = le; j <= ri; j++){
ll cur = j%pdt;
if(!vis[cur]){
ans++;
}
vis[cur]++;
}
}
cout << ans << endl;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
84 ms |
12664 KB |
Output is correct |
3 |
Correct |
148 ms |
18296 KB |
Output is correct |
4 |
Incorrect |
6 ms |
1016 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Execution timed out |
5030 ms |
328808 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
204 ms |
32348 KB |
Output is correct |
3 |
Correct |
192 ms |
32064 KB |
Output is correct |
4 |
Correct |
193 ms |
30800 KB |
Output is correct |
5 |
Execution timed out |
5051 ms |
62576 KB |
Time limit exceeded |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
1073 ms |
100088 KB |
Output is correct |
3 |
Runtime error |
4889 ms |
524292 KB |
Execution killed with signal 9 (could be triggered by violating memory limits) |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
1073 ms |
100088 KB |
Output is correct |
3 |
Runtime error |
4889 ms |
524292 KB |
Execution killed with signal 9 (could be triggered by violating memory limits) |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
1073 ms |
100088 KB |
Output is correct |
3 |
Runtime error |
4889 ms |
524292 KB |
Execution killed with signal 9 (could be triggered by violating memory limits) |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
252 KB |
Output is correct |
2 |
Runtime error |
4953 ms |
524292 KB |
Execution killed with signal 9 (could be triggered by violating memory limits) |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
84 ms |
12664 KB |
Output is correct |
3 |
Correct |
148 ms |
18296 KB |
Output is correct |
4 |
Incorrect |
6 ms |
1016 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |