Submission #1119048

# Submission time Handle Problem Language Result Execution time Memory
1119048 2024-11-26T14:10:15 Z vjudge1 Strange Device (APIO19_strange_device) C++17
10 / 100
5000 ms 524288 KB
#include <bits/stdc++.h>
#define llong long long
using namespace std;

const int N = 2e5 + 3;
const int inf = 2e9 + 11;

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    int n;
    llong A, B;
    cin >> n >> A >> B;
    map < pair < llong, llong >, int > mp;
    for(int i = 1; i <= n; i++){
        llong l, r;
        cin >> l >> r;
        for(llong t = l; t <= r; t++){
            mp[{(t + t / B) % A, t % B}]++;
        }
    }
    cout << mp.size();
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 592 KB Output is correct
2 Correct 41 ms 12832 KB Output is correct
3 Correct 66 ms 18412 KB Output is correct
4 Correct 3 ms 1016 KB Output is correct
5 Correct 2 ms 336 KB Output is correct
6 Correct 1 ms 336 KB Output is correct
7 Correct 2 ms 592 KB Output is correct
8 Correct 1 ms 336 KB Output is correct
9 Correct 8 ms 1104 KB Output is correct
10 Correct 1 ms 336 KB Output is correct
11 Correct 2 ms 336 KB Output is correct
12 Correct 1 ms 336 KB Output is correct
13 Correct 1 ms 336 KB Output is correct
14 Correct 1 ms 336 KB Output is correct
15 Correct 33 ms 7036 KB Output is correct
16 Correct 24 ms 7248 KB Output is correct
17 Correct 43 ms 10312 KB Output is correct
18 Correct 1 ms 592 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 460 KB Output is correct
2 Runtime error 2366 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 106 ms 32392 KB Output is correct
3 Correct 140 ms 32072 KB Output is correct
4 Correct 89 ms 30616 KB Output is correct
5 Execution timed out 5067 ms 62684 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 489 ms 100196 KB Output is correct
3 Runtime error 1696 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 489 ms 100196 KB Output is correct
3 Runtime error 1696 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 489 ms 100196 KB Output is correct
3 Runtime error 1696 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Runtime error 1428 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 592 KB Output is correct
2 Correct 41 ms 12832 KB Output is correct
3 Correct 66 ms 18412 KB Output is correct
4 Correct 3 ms 1016 KB Output is correct
5 Correct 2 ms 336 KB Output is correct
6 Correct 1 ms 336 KB Output is correct
7 Correct 2 ms 592 KB Output is correct
8 Correct 1 ms 336 KB Output is correct
9 Correct 8 ms 1104 KB Output is correct
10 Correct 1 ms 336 KB Output is correct
11 Correct 2 ms 336 KB Output is correct
12 Correct 1 ms 336 KB Output is correct
13 Correct 1 ms 336 KB Output is correct
14 Correct 1 ms 336 KB Output is correct
15 Correct 33 ms 7036 KB Output is correct
16 Correct 24 ms 7248 KB Output is correct
17 Correct 43 ms 10312 KB Output is correct
18 Correct 1 ms 592 KB Output is correct
19 Correct 1 ms 460 KB Output is correct
20 Runtime error 2366 ms 524288 KB Execution killed with signal 9
21 Halted 0 ms 0 KB -