# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
267717 | 2020-08-16T05:43:55 Z | kkm0476 | Strange Device (APIO19_strange_device) | C++ | 3453 ms | 263916 KB |
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> using namespace std; int n, A, B; vector<pair<int, int> > v; int main() { scanf("%d %d %d", &n, &A, &B); for(int i = 0; i < n; i++) { int l, r; scanf("%d %d", &l, &r); for(int t = l; t <= r; t++) { int x = (t + (int)((double)t / B)) % A; int y = t % B; v.push_back({x, y}); } } int ret = 0; sort(v.begin(), v.end()); for(int 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("%d", ret); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Incorrect | 27 ms | 2932 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 256 KB | Output is correct |
2 | Incorrect | 1 ms | 256 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 256 KB | Output is correct |
2 | Incorrect | 71 ms | 8684 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 384 KB | Output is correct |
2 | Incorrect | 552 ms | 8656 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 384 KB | Output is correct |
2 | Incorrect | 552 ms | 8656 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 384 KB | Output is correct |
2 | Incorrect | 552 ms | 8656 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 256 KB | Output is correct |
2 | Incorrect | 3453 ms | 263916 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Incorrect | 27 ms | 2932 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |