QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#876074#7695. Double UpWeaRD276#WA 28ms11392kbPython3395b2025-01-30 16:53:262025-01-30 16:53:30

Judging History

This is the latest submission verdict.

  • [2025-01-30 16:53:30]
  • Judged
  • Verdict: WA
  • Time: 28ms
  • Memory: 11392kb
  • [2025-01-30 16:53:26]
  • Submitted

answer

from inspect import stack

n = int(input())
a = list(map(int, input().split()))

st = list()
for i in range(n):
    if len(st) > 0 and st[-1] == a[i]:
        st.pop()
        st.append(2 * a[i])
    else:
        st.append(a[i])

st = sorted(st)
nm = st[0]
for i in range(1, len(st)):
    if (nm == st[i]):
        nm *= 2
    else:
        nm = max(nm, st[i])

print(nm)

詳細信息

Test #1:

score: 100
Accepted
time: 26ms
memory: 11392kb

input:

5
4 2 2 1 8

output:

16

result:

ok single line: '16'

Test #2:

score: -100
Wrong Answer
time: 28ms
memory: 11392kb

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:

4

result:

wrong answer 1st lines differ - expected: '512', found: '4'