QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#876260 | #7695. Double Up | Teapot# | WA | 94ms | 8832kb | Python3 | 723b | 2025-01-30 19:11:22 | 2025-01-30 19:11:22 |
Judging History
answer
l = int(input());
ar = list(map(int,input().split()))
res = 0
for i in range(len(ar)):
res = max(res,ar[i])
while len(ar) > 0:
j = -1
for i in range(1,len(ar)):
if(ar[i] == ar[i-1]):
j = i
break
mi = ar[j]
for i in range(1,len(ar)):
if(ar[i] == ar[i-1] and ar[i] < mi):
mi = ar[i]
j = i
if j != -1:
l = ar[j]
ar.pop(j-1)
ar.pop(j-1)
ar.insert(j,2*l)
res = max(res,2*l)
else:
m = ar[0]
mi = 0
for i in range(len(ar)):
if(m > ar[i]):
m = ar[i]
mi = i
ar.pop(mi);
print(res)
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 9ms
memory: 8832kb
input:
5 4 2 2 1 8
output:
16
result:
ok single line: '16'
Test #2:
score: -100
Wrong Answer
time: 94ms
memory: 8832kb
input:
1000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
256
result:
wrong answer 1st lines differ - expected: '512', found: '256'