QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#331961#7695. Double Upcry#WA 126ms9924kbPython3603b2024-02-19 01:17:442024-02-19 01:17:44

Judging History

你现在查看的是最新测评结果

  • [2024-02-19 01:17:44]
  • 评测
  • 测评结果:WA
  • 用时:126ms
  • 内存:9924kb
  • [2024-02-19 01:17:44]
  • 提交

answer

n = int(input())
a = list(map(int, input().split()))
na = [0] * n
for i in range(n):
    v = 0;
    while a[i] > 0:
        v += 1;
        a[i] //= 2;
    na[i] = v - 1

ans = 0
# print(na)
for val in range(0, 1000):
    # greedy delete
    ca = []
    for i in range(len(na)):
        if na[i] == val:
            if i < len(na) - 1 and na[i + 1] == na[i]:
                ca.append(na[i] + 1)
                i += 1
        else:
            ca.append(na[i])
    # print(ca)
    if len(ca) == 1:
        ans = max(ans, max(ca))
        break
    na = ca
print(2**ans)
    

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 8ms
memory: 9924kb

input:

5
4 2 2 1 8

output:

16

result:

ok single line: '16'

Test #2:

score: -100
Wrong Answer
time: 126ms
memory: 9880kb

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:

5357543035931336604742125245300009052807024058527668037218751941851755255624680612465991894078479290637973364587765734125935726428461570217992288787349287401967283887412115492710537302531185570938977091076523237491790970633699383779582771973038531457285598238843271083830214915826312193418602834034688

result:

wrong answer 1st lines differ - expected: '512', found: '535754303593133660474212524530...0214915826312193418602834034688'