Submission #52842901


Source Code Expand

N = int(input())
A = list(map(int,input().split()))

li = []
for a in A:
    li.append(a)
    while len(li) >= 2 and li[-1] == li[-2]:
        x = li[-1]
        li.pop()
        li[-1] = x+1
print(len(li))

Submission Info

Submission Time
Task C - Merge the balls
User TsubakiMint
Language Python (PyPy 3.10-v7.3.12)
Score 250
Code Size 216 Byte
Status AC
Exec Time 95 ms
Memory 128224 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 250 / 250
Status
AC × 2
AC × 38
Set Name Test Cases
Sample example_00.txt, example_01.txt
All example_00.txt, example_01.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, hand_08.txt, hand_09.txt, hand_10.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, random_21.txt, random_22.txt, random_23.txt, random_24.txt
Case Name Status Exec Time Memory
example_00.txt AC 55 ms 76688 KiB
example_01.txt AC 54 ms 76700 KiB
hand_00.txt AC 85 ms 115208 KiB
hand_01.txt AC 78 ms 103944 KiB
hand_02.txt AC 78 ms 104216 KiB
hand_03.txt AC 86 ms 125620 KiB
hand_04.txt AC 86 ms 125712 KiB
hand_05.txt AC 82 ms 112412 KiB
hand_06.txt AC 89 ms 127304 KiB
hand_07.txt AC 57 ms 76308 KiB
hand_08.txt AC 56 ms 76284 KiB
hand_09.txt AC 57 ms 76472 KiB
hand_10.txt AC 56 ms 76292 KiB
random_00.txt AC 95 ms 121668 KiB
random_01.txt AC 93 ms 121208 KiB
random_02.txt AC 93 ms 121452 KiB
random_03.txt AC 93 ms 115024 KiB
random_04.txt AC 92 ms 121456 KiB
random_05.txt AC 93 ms 125080 KiB
random_06.txt AC 94 ms 125072 KiB
random_07.txt AC 91 ms 123468 KiB
random_08.txt AC 94 ms 118596 KiB
random_09.txt AC 92 ms 126180 KiB
random_10.txt AC 89 ms 119992 KiB
random_11.txt AC 91 ms 115020 KiB
random_12.txt AC 89 ms 124920 KiB
random_13.txt AC 89 ms 124904 KiB
random_14.txt AC 90 ms 115444 KiB
random_15.txt AC 91 ms 118144 KiB
random_16.txt AC 92 ms 115288 KiB
random_17.txt AC 93 ms 115972 KiB
random_18.txt AC 91 ms 127860 KiB
random_19.txt AC 89 ms 127764 KiB
random_20.txt AC 88 ms 128224 KiB
random_21.txt AC 88 ms 128092 KiB
random_22.txt AC 89 ms 127916 KiB
random_23.txt AC 88 ms 127616 KiB
random_24.txt AC 88 ms 127788 KiB