Submission #926311

# Submission time Handle Problem Language Result Execution time Memory
926311 2024-02-12T19:06:50 Z TAhmed33 Strange Device (APIO19_strange_device) C++
10 / 100
5000 ms 524288 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main () {
    ll n, a, b; cin >> n >> a >> b;
    vector <pair <ll, ll>> arr(n); for (auto &[x, y] : arr) cin >> x >> y;
    set <pair <ll, ll>> xx;
    for (auto [x, y] : arr) {
        for (ll i = x; i <= y; i++) {
            ll g = (i + (i / b)) % a, h = i % b;
            xx.insert({g, h});
        }
    }
    cout << (int)xx.size() << '\n';
}

Compilation message

strange_device.cpp: In function 'int main()':
strange_device.cpp:6:47: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
    6 |     vector <pair <ll, ll>> arr(n); for (auto &[x, y] : arr) cin >> x >> y;
      |                                               ^
strange_device.cpp:8:15: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
    8 |     for (auto [x, y] : arr) {
      |               ^
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 43 ms 12892 KB Output is correct
3 Correct 61 ms 18476 KB Output is correct
4 Correct 2 ms 860 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 604 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 6 ms 1116 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 31 ms 6996 KB Output is correct
16 Correct 28 ms 7256 KB Output is correct
17 Correct 117 ms 11860 KB Output is correct
18 Correct 0 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Runtime error 1752 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 110 ms 32340 KB Output is correct
3 Correct 152 ms 32084 KB Output is correct
4 Correct 96 ms 30548 KB Output is correct
5 Execution timed out 5032 ms 103356 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1088 ms 115640 KB Output is correct
3 Runtime error 2156 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1088 ms 115640 KB Output is correct
3 Runtime error 2156 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1088 ms 115640 KB Output is correct
3 Runtime error 2156 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 544 KB Output is correct
2 Runtime error 1381 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 43 ms 12892 KB Output is correct
3 Correct 61 ms 18476 KB Output is correct
4 Correct 2 ms 860 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 604 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 6 ms 1116 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 31 ms 6996 KB Output is correct
16 Correct 28 ms 7256 KB Output is correct
17 Correct 117 ms 11860 KB Output is correct
18 Correct 0 ms 344 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Runtime error 1752 ms 524288 KB Execution killed with signal 9
21 Halted 0 ms 0 KB -