Submission #781547

# Submission time Handle Problem Language Result Execution time Memory
781547 2023-07-13T07:48:45 Z andecaandeci Strange Device (APIO19_strange_device) C++17
10 / 100
5000 ms 524288 KB
#include <bits/stdc++.h>
#define int long long
#define pb push_back
#define pii pair<int,int>
#define fr first
#define sc second
using namespace std;

vector<pii> intervals;
set<pii> uniqe;

signed main() {
    int n, a, b; cin >> n >> a >> b;
    for (int i = 0; i < n; i++) {
        int x, y; cin >> x >> y;
        intervals.pb({x, y});
    }
    for (int i = 0; i < n; i++) {
        auto cur = intervals[i];
        for (int j = cur.fr; j <= cur.sc; j++) {
            int x = (j + j/b) % a;
            int y = j % b;
            uniqe.insert({x, y});
        }
    }
    cout << uniqe.size() << endl;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 54 ms 12832 KB Output is correct
3 Correct 71 ms 18460 KB Output is correct
4 Correct 2 ms 852 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 468 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 7 ms 1108 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 304 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 300 KB Output is correct
15 Correct 35 ms 7000 KB Output is correct
16 Correct 29 ms 7220 KB Output is correct
17 Correct 121 ms 8892 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Runtime error 1898 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 104 ms 32296 KB Output is correct
3 Correct 128 ms 32068 KB Output is correct
4 Correct 120 ms 30508 KB Output is correct
5 Execution timed out 5073 ms 78796 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1153 ms 78772 KB Output is correct
3 Runtime error 2240 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1153 ms 78772 KB Output is correct
3 Runtime error 2240 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1153 ms 78772 KB Output is correct
3 Runtime error 2240 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Runtime error 1372 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 54 ms 12832 KB Output is correct
3 Correct 71 ms 18460 KB Output is correct
4 Correct 2 ms 852 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 468 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 7 ms 1108 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 304 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 300 KB Output is correct
15 Correct 35 ms 7000 KB Output is correct
16 Correct 29 ms 7220 KB Output is correct
17 Correct 121 ms 8892 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Runtime error 1898 ms 524288 KB Execution killed with signal 9
21 Halted 0 ms 0 KB -