Submission #781755

# Submission time Handle Problem Language Result Execution time Memory
781755 2023-07-13T10:36:32 Z kebine Strange Device (APIO19_strange_device) C++17
0 / 100
532 ms 524288 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define fi first
#define se second
#define pb push_back
#define TC int t; cin>>t; while(t--)
#define all(x) (x).begin(),(x).end()
//*AC BERSAMA ALLAH  FORTIS FORTUNA ADIUVAT
//# nyampah

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    ll n,a,b; 
    cin>>n>>a>>b;

    vector<pair<ll,ll> > vec;
    set<pair<ll,ll> > sp, lr;
    for(int i=0;i<n;i++){
        ll l,r; cin>>l>>r;
        for(int j=l;j<=r;j++){
            vec.push_back(make_pair(((j+j/b)%a),(j%b)));
        }
    }
    sort(all(vec));
    int sz=vec.size();
    ll cnt=0;
    for(int i=0;i<sz;i++){
        if(i>0 && vec[i]==vec[i-1]) continue;
        cnt++;
    }

    cout<<cnt;

    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Runtime error 530 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 Runtime error 475 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 Runtime error 532 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 Runtime error 527 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 Runtime error 527 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 Runtime error 527 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 Runtime error 488 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 Runtime error 530 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -