Submission #124391

# Submission time Handle Problem Language Result Execution time Memory
124391 2019-07-03T09:12:52 Z Mtaylor Strange Device (APIO19_strange_device) C++17
0 / 100
5000 ms 524292 KB
#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;
            cin >> 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;
    }
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Execution timed out 5058 ms 355776 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Runtime error 4527 ms 524292 KB Execution killed with signal 9 (could be triggered by violating memory limits)
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Execution timed out 5015 ms 36468 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 252 KB Output is correct
2 Execution timed out 5018 ms 77656 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 252 KB Output is correct
2 Execution timed out 5018 ms 77656 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 252 KB Output is correct
2 Execution timed out 5018 ms 77656 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Runtime error 2008 ms 524288 KB Execution killed with signal 9 (could be triggered by violating memory limits)
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Execution timed out 5058 ms 355776 KB Time limit exceeded
3 Halted 0 ms 0 KB -