Submission #654679

# Submission time Handle Problem Language Result Execution time Memory
654679 2022-11-01T08:37:18 Z horiseun Strange Device (APIO19_strange_device) C++11
0 / 100
5000 ms 524288 KB
#include <iostream>
#include <vector>
#include <set>
#include <tuple>
#include <algorithm>
using namespace std;

#define ll long long

ll a, b, n, l, r;
set<pair<ll, ll>> s;

ll calcX(ll t) {
    return (t + t / b) % a;
}

ll calcY(ll t) {
    return t % b;
}

int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(0);

    cin >> n >> a >> b;
    for (int i = 0; i < n; i++) {
        cin >> l >> r;
        for (int j = l; j <= r; j++) {
            s.insert({calcX(j), calcY(j)});

        }
    }

    cout << s.size() << "\n";


}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Execution timed out 5100 ms 405184 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Runtime error 2246 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Execution timed out 5057 ms 60624 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Execution timed out 5048 ms 77560 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Execution timed out 5048 ms 77560 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Execution timed out 5048 ms 77560 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Runtime error 1181 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 Execution timed out 5100 ms 405184 KB Time limit exceeded
3 Halted 0 ms 0 KB -