#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
#define eb emplace_back
#define all(v) v.begin(),v.end()
#define ff first
#define ss second
const ll mxn=2e5+5;
int a[mxn];
vector<pl> vt;
int main()
{
ios::sync_with_stdio(0); cin.tie(0);
int n; cin>>n;
for (int i=1;i<=n;i++)
{
cin>>a[i];
int cnt=1;
while (a[i]%2==0)
{
a[i]/=2;
cnt*=2;
}
vt.eb(a[i],cnt);
}
int q; cin>>q;
while (q--)
{
ll x; cin>>x;
int c=0,pos=0;
while (c<n and pos+vt[c].ss<x)
{
pos+=vt[c].ss;
c++;
}
cout<<vt[c].ff<<'\n';
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Execution timed out |
2073 ms |
5012 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
1 ms |
340 KB |
Output is correct |
7 |
Correct |
1 ms |
340 KB |
Output is correct |
8 |
Correct |
1 ms |
340 KB |
Output is correct |
9 |
Incorrect |
0 ms |
340 KB |
Output isn't correct |
10 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Execution timed out |
2073 ms |
5012 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |