Submission #781449

# Submission time Handle Problem Language Result Execution time Memory
781449 2023-07-13T06:32:55 Z andecaandeci Strange Device (APIO19_strange_device) C++17
0 / 100
5000 ms 524288 KB
#include<bits/stdc++.h>
using namespace std;
#define ioss ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define int long long
#define pii pair<int, int>
#define fi first
#define se second
#define pb push_back
int n, a, b;
signed main() {
    ioss;
    cin >> n >> a >> b;
    int ans = 0;
    set<int> s;
    for(int i = 0; i < n; i++) {
        int l, r, tmp = a*b;
        cin >> l >> r;
        l %= tmp, r %= tmp;
        if(l <= r) {
            for(int j = l; j <= r; j++) {
                if(!s.count(j)) s.insert(j);
            }
        } else {
            for(int j = l; j < tmp; j++) {
                if(!s.count(j)) s.insert(j);
            }
            for(int j = 0; j <= r; j++) {
                if(!s.count(j)) s.insert(j);
            }
        }
    }
    cout << s.size() << endl;
}

Compilation message

strange_device.cpp: In function 'int main()':
strange_device.cpp:13:9: warning: unused variable 'ans' [-Wunused-variable]
   13 |     int ans = 0;
      |         ^~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 36 ms 9388 KB Output is correct
3 Correct 61 ms 13680 KB Output is correct
4 Incorrect 2 ms 852 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Runtime error 4757 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 Correct 96 ms 24236 KB Output is correct
3 Correct 93 ms 24084 KB Output is correct
4 Correct 97 ms 22996 KB Output is correct
5 Execution timed out 5035 ms 46912 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 447 ms 47232 KB Output is correct
3 Runtime error 2561 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 447 ms 47232 KB Output is correct
3 Runtime error 2561 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 447 ms 47232 KB Output is correct
3 Runtime error 2561 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Runtime error 2523 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 Correct 36 ms 9388 KB Output is correct
3 Correct 61 ms 13680 KB Output is correct
4 Incorrect 2 ms 852 KB Output isn't correct
5 Halted 0 ms 0 KB -