제출 #252393

#제출 시각아이디문제언어결과실행 시간메모리
252393orgiooo이상한 기계 (APIO19_strange_device)C++14
10 / 100
5066 ms524292 KiB
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define ret return 0
#define con continue
#define db double
#define gcd __gcd
#define freopen freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
using namespace std;
ll n,m,z,u,r,l,ans,h,k,y,x,t,a[10011001],b[1234567],c[1234][567];
ll i,j;
ll e[865776],g[477575];ll d[986667];
ll lcm(ll x,ll y){
    ll z=gcd(x,y);
    return x*y/z;
}
ll gcdgur(ll x ,ll y,ll z){
    return gcd(x,gcd(y,z));
}
map <string ,ll>  f;
queue <ll> que;
//multiset<int> s;
vector <ll> vec, vec1,ansvec;
set <pair<ll,ll>> s;
set<int>::iterator it;
string p,q,w;
int main(){
    ll A,B;
    cin>>n>>A>>B;
    while (n--){
        cin>>l>>r;
        
        for(i=l;i<=r;i++){
            s.insert({(i+(i/B))%A,i%B});
        }
        
    }
    cout<<s.size();
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...