Submission #976763

# Submission time Handle Problem Language Result Execution time Memory
976763 2024-05-07T05:32:21 Z AIF_is_carving Strange Device (APIO19_strange_device) C++14
0 / 100
5000 ms 524288 KB
#include <bits/stdc++.h>
 
typedef long long ll;
using namespace std;

const int N=1e6+5;
int loss[N];

void solve(){

    set<pair<ll, ll>> s;
    ll n, A, B; cin>>n>>A>>B;
    for(int i=0; i<n; i++){
        ll x, y; cin>>x>>y;
        for(int t = x; t<=y; t++){
            ll p = (t+(t/B))%A;
            ll q = t%B;

            s.insert({p, q});
        }
    }

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

    return;

}

int main(){   
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int t=1; //cin>>t;

    while(t--){
        solve();
    }

    return 0;

}
 
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Execution timed out 5036 ms 405208 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Runtime error 2154 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Execution timed out 5071 ms 60628 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Execution timed out 5062 ms 77764 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Execution timed out 5062 ms 77764 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Execution timed out 5062 ms 77764 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Runtime error 1180 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Execution timed out 5036 ms 405208 KB Time limit exceeded
3 Halted 0 ms 0 KB -