Submission #216986

# Submission time Handle Problem Language Result Execution time Memory
216986 2020-03-28T16:18:13 Z sevlll Strange Device (APIO19_strange_device) C++14
0 / 100
5000 ms 524292 KB
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>

#define pb push_back
#define int long long
#define str string
using namespace std;
const int M = 1e9 + 7;

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int n, a, b;
    cin >> n >> a >> b;
    vector<pair<int, int>> pr(n);
    for (int i = 0; i < n; i++) cin >> pr[i].first >> pr[i].second;
    set<int> ses;
    for (auto p : pr) {
        int l = p.first, r = p.second;
        for (int x = l; x <= r; x++) {
            ses.insert(x % (a*b));
        }
    }
    cout << ses.size();
}
# Verdict Execution time Memory Grader output
1 Correct 4 ms 384 KB Output is correct
2 Correct 42 ms 9848 KB Output is correct
3 Correct 63 ms 14072 KB Output is correct
4 Incorrect 6 ms 896 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Runtime error 2992 ms 524292 KB Execution killed with signal 9 (could be triggered by violating memory limits)
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 96 ms 24416 KB Output is correct
3 Correct 92 ms 24168 KB Output is correct
4 Correct 96 ms 23288 KB Output is correct
5 Execution timed out 5079 ms 63480 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Correct 4 ms 384 KB Output is correct
2 Correct 615 ms 64340 KB Output is correct
3 Runtime error 2542 ms 524288 KB Execution killed with signal 9 (could be triggered by violating memory limits)
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 384 KB Output is correct
2 Correct 615 ms 64340 KB Output is correct
3 Runtime error 2542 ms 524288 KB Execution killed with signal 9 (could be triggered by violating memory limits)
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 384 KB Output is correct
2 Correct 615 ms 64340 KB Output is correct
3 Runtime error 2542 ms 524288 KB Execution killed with signal 9 (could be triggered by violating memory limits)
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Runtime error 2205 ms 524288 KB Execution killed with signal 9 (could be triggered by violating memory limits)
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 384 KB Output is correct
2 Correct 42 ms 9848 KB Output is correct
3 Correct 63 ms 14072 KB Output is correct
4 Incorrect 6 ms 896 KB Output isn't correct
5 Halted 0 ms 0 KB -