Submission #972895

# Submission time Handle Problem Language Result Execution time Memory
972895 2024-05-01T09:52:27 Z Unforgettablepl Strange Device (APIO19_strange_device) C++17
0 / 100
0 ms 600 KB
#include <bits/stdc++.h>
using namespace std;

#define int long long

int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n,A,B;
    cin >> n >> A >> B;
    __int128 modulus;
    if((B+1)%A==0){
        modulus = B;
        return 1;
    } else {
        modulus = A*B;
    }
    set<__int128> answers;
    for(int i=1;i<=n;i++){
        int l,r;cin>>l>>r;
        for(int x=l;x<=r;x++){
            answers.insert(__int128(x)%modulus);
        }
    }
    cout << answers.size() << '\n';
}
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 600 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 348 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 344 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 348 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 348 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 348 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 348 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 600 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -