n,a,b = map(int, input().split())
ranges = []
for i in range(n):
ranges.append(list(map(int, input().split())))
sus = [0 for i in range(a*b)]
for i in ranges:
for j in range(i[0],i[1]+1):
sus[j%(a*b)] = 1
ans = 0
for i in range(len(sus)):
ans += sus[i]
print(ans)
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
34 ms |
18220 KB |
Output is correct |
2 |
Correct |
191 ms |
74780 KB |
Output is correct |
3 |
Correct |
177 ms |
63436 KB |
Output is correct |
4 |
Incorrect |
55 ms |
22956 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
36 ms |
18240 KB |
Output is correct |
2 |
Runtime error |
367 ms |
524288 KB |
Execution killed with signal 9 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
38 ms |
18172 KB |
Output is correct |
2 |
Correct |
89 ms |
27328 KB |
Output is correct |
3 |
Correct |
93 ms |
27552 KB |
Output is correct |
4 |
Correct |
88 ms |
26216 KB |
Output is correct |
5 |
Execution timed out |
5088 ms |
162688 KB |
Time limit exceeded |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
33 ms |
18228 KB |
Output is correct |
2 |
Correct |
2122 ms |
160768 KB |
Output is correct |
3 |
Runtime error |
2206 ms |
151024 KB |
Execution failed because the return code was nonzero |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
33 ms |
18228 KB |
Output is correct |
2 |
Correct |
2122 ms |
160768 KB |
Output is correct |
3 |
Runtime error |
2206 ms |
151024 KB |
Execution failed because the return code was nonzero |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
33 ms |
18228 KB |
Output is correct |
2 |
Correct |
2122 ms |
160768 KB |
Output is correct |
3 |
Runtime error |
2206 ms |
151024 KB |
Execution failed because the return code was nonzero |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
35 ms |
18148 KB |
Output is correct |
2 |
Runtime error |
602 ms |
524288 KB |
Execution killed with signal 9 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
34 ms |
18220 KB |
Output is correct |
2 |
Correct |
191 ms |
74780 KB |
Output is correct |
3 |
Correct |
177 ms |
63436 KB |
Output is correct |
4 |
Incorrect |
55 ms |
22956 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |