# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1020266 | 2024-07-11T18:37:27 Z | cpptowin | Intercastellar (JOI22_ho_t1) | C++17 | 48 ms | 7764 KB |
#include<bits/stdc++.h> #define fo(i,l,r) for(int i = l ;i <= r ; i++) #define fod(i,r,l) for(int i = r ; i >= l ; i--) #define int long long #define pb emplace_back #define maxn 1000010 #define fi first #define se second #define N 1010 #define inf (int)1e18 #define en cout << "\n"; #define all(x) x.begin(),x.end() #define ss(x) (int)x.size() #define lb(x) x & -x #define bit(x,i) ((x >> i) & 1) #define onbit(x,i) (x | (1ll << i)) #define offbit(x,i) (x ^ (1ll << i)) #define bitcount(x) __builtint_popcountll(x) #define pii pair<int,int> #define vi vector<int> #define vii vector<pii> using namespace std; int n,a[maxn]; main() { #define name "TASK" if(fopen(name".inp","r")) { freopen(name".inp","r",stdin); freopen(name".out","w",stdout); } ios_base::sync_with_stdio(0); cin.tie(0); cin >> n; fo(i,1,n) cin >> a[i]; int q;cin >> q; int pos = 0,i = 1; while(q--) { int x; cin >> x; while(pos < x) { int cnt = 1; while(a[i] % 2 == 0) { a[i] /= 2; cnt *= 2; } pos += cnt; i++; } cout << a[i - 1] << "\n"; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 12 ms | 2604 KB | Output is correct |
4 | Correct | 16 ms | 2132 KB | Output is correct |
5 | Correct | 28 ms | 3952 KB | Output is correct |
6 | Correct | 19 ms | 2908 KB | Output is correct |
7 | Correct | 29 ms | 3924 KB | Output is correct |
8 | Correct | 27 ms | 4188 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 1 ms | 344 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Correct | 0 ms | 460 KB | Output is correct |
7 | Correct | 0 ms | 348 KB | Output is correct |
8 | Correct | 0 ms | 348 KB | Output is correct |
9 | Correct | 0 ms | 348 KB | Output is correct |
10 | Correct | 1 ms | 348 KB | Output is correct |
11 | Correct | 1 ms | 348 KB | Output is correct |
12 | Correct | 0 ms | 348 KB | Output is correct |
13 | Correct | 0 ms | 348 KB | Output is correct |
14 | Correct | 1 ms | 348 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 12 ms | 2604 KB | Output is correct |
4 | Correct | 16 ms | 2132 KB | Output is correct |
5 | Correct | 28 ms | 3952 KB | Output is correct |
6 | Correct | 19 ms | 2908 KB | Output is correct |
7 | Correct | 29 ms | 3924 KB | Output is correct |
8 | Correct | 27 ms | 4188 KB | Output is correct |
9 | Correct | 1 ms | 344 KB | Output is correct |
10 | Correct | 0 ms | 348 KB | Output is correct |
11 | Correct | 1 ms | 344 KB | Output is correct |
12 | Correct | 0 ms | 348 KB | Output is correct |
13 | Correct | 0 ms | 348 KB | Output is correct |
14 | Correct | 0 ms | 460 KB | Output is correct |
15 | Correct | 0 ms | 348 KB | Output is correct |
16 | Correct | 0 ms | 348 KB | Output is correct |
17 | Correct | 0 ms | 348 KB | Output is correct |
18 | Correct | 1 ms | 348 KB | Output is correct |
19 | Correct | 1 ms | 348 KB | Output is correct |
20 | Correct | 0 ms | 348 KB | Output is correct |
21 | Correct | 0 ms | 348 KB | Output is correct |
22 | Correct | 1 ms | 348 KB | Output is correct |
23 | Correct | 16 ms | 2904 KB | Output is correct |
24 | Correct | 24 ms | 4176 KB | Output is correct |
25 | Correct | 40 ms | 7252 KB | Output is correct |
26 | Correct | 27 ms | 4692 KB | Output is correct |
27 | Correct | 26 ms | 4432 KB | Output is correct |
28 | Correct | 46 ms | 7764 KB | Output is correct |
29 | Correct | 47 ms | 7056 KB | Output is correct |
30 | Correct | 22 ms | 3676 KB | Output is correct |
31 | Correct | 48 ms | 7504 KB | Output is correct |