# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
267731 | 2020-08-16T05:50:43 Z | kkm0476 | Strange Device (APIO19_strange_device) | C++ | 883 ms | 524292 KB |
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> using namespace std; typedef long long lint; lint n, A, B; vector<pair<lint, lint> > v; int main() { scanf("%lld %lld %lld", &n, &A, &B); for(lint i = 0; i < n; i++) { lint l, r; scanf("%lld %lld", &l, &r); for(lint t = l; t <= r; t++) { lint x = (t + (t / B)) % A; lint y = t % B; v.push_back({x, y}); } } lint ret = 0; sort(v.begin(), v.end()); for(lint i = 0; i < v.size(); i++) { if(i == 0) ret++; else if(v[i].first != v[i - 1].first || v[i].second != v[i - 1].second) ret++; } printf("%lld", ret); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Correct | 30 ms | 4624 KB | Output is correct |
3 | Correct | 47 ms | 9068 KB | Output is correct |
4 | Correct | 2 ms | 768 KB | Output is correct |
5 | Correct | 1 ms | 384 KB | Output is correct |
6 | Correct | 1 ms | 384 KB | Output is correct |
7 | Correct | 2 ms | 512 KB | Output is correct |
8 | Correct | 1 ms | 384 KB | Output is correct |
9 | Correct | 9 ms | 1528 KB | Output is correct |
10 | Correct | 1 ms | 256 KB | Output is correct |
11 | Correct | 1 ms | 256 KB | Output is correct |
12 | Correct | 0 ms | 256 KB | Output is correct |
13 | Correct | 1 ms | 256 KB | Output is correct |
14 | Correct | 1 ms | 384 KB | Output is correct |
15 | Correct | 46 ms | 8684 KB | Output is correct |
16 | Correct | 22 ms | 2932 KB | Output is correct |
17 | Correct | 55 ms | 3308 KB | Output is correct |
18 | Correct | 1 ms | 256 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 256 KB | Output is correct |
2 | Runtime error | 669 ms | 524292 KB | Execution killed with signal 9 |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Correct | 90 ms | 16864 KB | Output is correct |
3 | Correct | 104 ms | 16828 KB | Output is correct |
4 | Correct | 97 ms | 16872 KB | Output is correct |
5 | Runtime error | 669 ms | 524292 KB | Execution killed with signal 9 |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 384 KB | Output is correct |
2 | Correct | 539 ms | 16848 KB | Output is correct |
3 | Runtime error | 841 ms | 524292 KB | Execution killed with signal 9 |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 384 KB | Output is correct |
2 | Correct | 539 ms | 16848 KB | Output is correct |
3 | Runtime error | 841 ms | 524292 KB | Execution killed with signal 9 |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 384 KB | Output is correct |
2 | Correct | 539 ms | 16848 KB | Output is correct |
3 | Runtime error | 841 ms | 524292 KB | Execution killed with signal 9 |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 256 KB | Output is correct |
2 | Runtime error | 883 ms | 524292 KB | Execution killed with signal 9 |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Correct | 30 ms | 4624 KB | Output is correct |
3 | Correct | 47 ms | 9068 KB | Output is correct |
4 | Correct | 2 ms | 768 KB | Output is correct |
5 | Correct | 1 ms | 384 KB | Output is correct |
6 | Correct | 1 ms | 384 KB | Output is correct |
7 | Correct | 2 ms | 512 KB | Output is correct |
8 | Correct | 1 ms | 384 KB | Output is correct |
9 | Correct | 9 ms | 1528 KB | Output is correct |
10 | Correct | 1 ms | 256 KB | Output is correct |
11 | Correct | 1 ms | 256 KB | Output is correct |
12 | Correct | 0 ms | 256 KB | Output is correct |
13 | Correct | 1 ms | 256 KB | Output is correct |
14 | Correct | 1 ms | 384 KB | Output is correct |
15 | Correct | 46 ms | 8684 KB | Output is correct |
16 | Correct | 22 ms | 2932 KB | Output is correct |
17 | Correct | 55 ms | 3308 KB | Output is correct |
18 | Correct | 1 ms | 256 KB | Output is correct |
19 | Correct | 1 ms | 256 KB | Output is correct |
20 | Runtime error | 669 ms | 524292 KB | Execution killed with signal 9 |
21 | Halted | 0 ms | 0 KB | - |