| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 124392 | Mtaylor | Strange Device (APIO19_strange_device) | C++17 | 0 ms | 0 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
 
    using namespace std;
    typedef long long ll;
    typedef vector<ll> vl ;
 
    #define mp make_pair
    #define pb push_back
    #define f first
    #define s second
    #define all(v) (v).begin(),(v).end()
 
 
    const int MOD = 1000000007;
    const int N = 1000005;
    const double PI =4*atan(1);
    const double eps = 1e-7;
    
    ll n,a,b;
    set<pair<ll,ll> > ss;
    
 
    int main(){
        //ios::sync_with_stdio(0);
        //freopen("easy.txt","r",stdin);
        cin >> n >> a >> b;
        for(int i=0;i<n;i++){
            ll x,y;
            swanf("%lld %lld",&x,&y);
            for(int t=x;t<=y;t++){
                ll xx=(t+(t/a)) %a;
                ll yy=(t%b);
                ss.insert(mp(xx,yy));
            }
        }
        cout  << ss.size() << endl;
        
        return 0;
    }
