QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#876260#7695. Double UpTeapot#WA 94ms8832kbPython3723b2025-01-30 19:11:222025-01-30 19:11:22

Judging History

This is the latest submission verdict.

  • [2025-01-30 19:11:22]
  • Judged
  • Verdict: WA
  • Time: 94ms
  • Memory: 8832kb
  • [2025-01-30 19:11:22]
  • Submitted

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)
            

詳細信息

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'