a=int(input())
s=[1]
for i in range (a):
d=int(input())
s.append(d)
x=int(input())
z=a
while(z!=-1):
if(s[z]%2==0):
c=s[z]//2
s.pop(z)
if z!=a:
s.insert(z,c)
s.insert(z,c)
else :
s.append(c)
s.append(c)
z+=2
a+=1
z-=1
#print(s)
for i in range(x):
v=int(input())
print(s[v])
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
19 ms |
2772 KB |
Output is correct |
2 |
Correct |
13 ms |
2772 KB |
Output is correct |
3 |
Execution timed out |
2066 ms |
5460 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
16 ms |
2808 KB |
Output is correct |
2 |
Correct |
18 ms |
2744 KB |
Output is correct |
3 |
Execution timed out |
2068 ms |
3460 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
19 ms |
2772 KB |
Output is correct |
2 |
Correct |
13 ms |
2772 KB |
Output is correct |
3 |
Execution timed out |
2066 ms |
5460 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |