# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
295728 | 2020-09-09T20:45:30 Z | CaroLinda | Strange Device (APIO19_strange_device) | C++14 | 5000 ms | 524292 KB |
#include <bits/stdc++.h> #pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") #pragma GCC optimization ("unroll-loops") #pragma GCC optimization ("O2") #define lp(i,a,b) for(int i = a; i < b; i++) #define pb push_back #define sz(x) (int)(x.size()) #define all(x) x.begin(),x.end() #define debug printf #define tiii tuple<int,int,int> #define mkt make_tuple #define pii pair<int,int> #define mk make_pair #define ll long long #define ff first #define ss second using namespace std ; int N ; set< pair<ll,ll> > s ; ll A , B ; int main() { scanf("%d%lld%lld", &N , &A, &B ) ; for(int i = 1 ; i <= N ; i++ ) { ll L , R ; scanf("%lld %lld", &L, &R ) ; for(ll j = L ; j <= R ; j++ ) { ll x = (j + j/B)%A ; ll y = j%B ; s.insert(mk(x,y)) ; } } printf("%d\n" , sz(s)) ; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 256 KB | Output is correct |
2 | Correct | 50 ms | 12664 KB | Output is correct |
3 | Correct | 79 ms | 18552 KB | Output is correct |
4 | Correct | 2 ms | 896 KB | Output is correct |
5 | Correct | 1 ms | 384 KB | Output is correct |
6 | Correct | 1 ms | 384 KB | Output is correct |
7 | Correct | 1 ms | 512 KB | Output is correct |
8 | Correct | 1 ms | 384 KB | Output is correct |
9 | Correct | 8 ms | 1152 KB | Output is correct |
10 | Correct | 0 ms | 256 KB | Output is correct |
11 | Correct | 0 ms | 256 KB | Output is correct |
12 | Correct | 0 ms | 256 KB | Output is correct |
13 | Correct | 1 ms | 384 KB | Output is correct |
14 | Correct | 1 ms | 384 KB | Output is correct |
15 | Correct | 42 ms | 7032 KB | Output is correct |
16 | Correct | 32 ms | 7288 KB | Output is correct |
17 | Correct | 72 ms | 10360 KB | Output is correct |
18 | Correct | 0 ms | 256 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Runtime error | 2692 ms | 524288 KB | Execution killed with signal 9 |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Correct | 139 ms | 32376 KB | Output is correct |
3 | Correct | 176 ms | 32244 KB | Output is correct |
4 | Correct | 136 ms | 30712 KB | Output is correct |
5 | Execution timed out | 5027 ms | 62656 KB | Time limit exceeded |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Correct | 721 ms | 67420 KB | Output is correct |
3 | Runtime error | 2232 ms | 524292 KB | Execution killed with signal 9 |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Correct | 721 ms | 67420 KB | Output is correct |
3 | Runtime error | 2232 ms | 524292 KB | Execution killed with signal 9 |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Correct | 721 ms | 67420 KB | Output is correct |
3 | Runtime error | 2232 ms | 524292 KB | Execution killed with signal 9 |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Runtime error | 1720 ms | 524292 KB | Execution killed with signal 9 |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 256 KB | Output is correct |
2 | Correct | 50 ms | 12664 KB | Output is correct |
3 | Correct | 79 ms | 18552 KB | Output is correct |
4 | Correct | 2 ms | 896 KB | Output is correct |
5 | Correct | 1 ms | 384 KB | Output is correct |
6 | Correct | 1 ms | 384 KB | Output is correct |
7 | Correct | 1 ms | 512 KB | Output is correct |
8 | Correct | 1 ms | 384 KB | Output is correct |
9 | Correct | 8 ms | 1152 KB | Output is correct |
10 | Correct | 0 ms | 256 KB | Output is correct |
11 | Correct | 0 ms | 256 KB | Output is correct |
12 | Correct | 0 ms | 256 KB | Output is correct |
13 | Correct | 1 ms | 384 KB | Output is correct |
14 | Correct | 1 ms | 384 KB | Output is correct |
15 | Correct | 42 ms | 7032 KB | Output is correct |
16 | Correct | 32 ms | 7288 KB | Output is correct |
17 | Correct | 72 ms | 10360 KB | Output is correct |
18 | Correct | 0 ms | 256 KB | Output is correct |
19 | Correct | 0 ms | 256 KB | Output is correct |
20 | Runtime error | 2692 ms | 524288 KB | Execution killed with signal 9 |
21 | Halted | 0 ms | 0 KB | - |