#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
const int N = 1e7;
int a[N];
signed main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
int num=0;
for(int i=0; i < n; i++){
int cnt=0;
int x;
cin >> x;
while(x%2==0){
x/=2;
cnt++;
}
for(int j=0; j< (1<<cnt); j++){
a[num]=x;
num++;
}
}
int q;
cin >> q;
while(q--){
int x;
cin >> x;
cout << a[x-1] << '\n';
}
}
# |
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 |
13 ms |
5372 KB |
Output is correct |
4 |
Correct |
20 ms |
3932 KB |
Output is correct |
5 |
Correct |
33 ms |
6792 KB |
Output is correct |
6 |
Correct |
20 ms |
7772 KB |
Output is correct |
7 |
Correct |
36 ms |
8672 KB |
Output is correct |
8 |
Correct |
38 ms |
16976 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 |
Runtime error |
79 ms |
159060 KB |
Execution killed with signal 11 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
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 |
13 ms |
5372 KB |
Output is correct |
4 |
Correct |
20 ms |
3932 KB |
Output is correct |
5 |
Correct |
33 ms |
6792 KB |
Output is correct |
6 |
Correct |
20 ms |
7772 KB |
Output is correct |
7 |
Correct |
36 ms |
8672 KB |
Output is correct |
8 |
Correct |
38 ms |
16976 KB |
Output is correct |
9 |
Correct |
1 ms |
344 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Runtime error |
79 ms |
159060 KB |
Execution killed with signal 11 |
12 |
Halted |
0 ms |
0 KB |
- |