提出 #24687733


ソースコード 拡げる

import heapq
q = int(input())

a = []

base = 0

for _ in range(q):
    px = list(map(int, input().split()))
    p = px[0]
#    print(px)
    if p == 1:
        heapq.heappush(a, px[1] - base)
    elif p == 2:
        base += px[1]
    else:
        print(heapq.heappop(a) + base)

提出情報

提出日時
問題 D - Querying Multiset
ユーザ cubesat
言語 Python (3.8.2)
得点 400
コード長 296 Byte
結果 AC
実行時間 607 ms
メモリ 16880 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 400 / 400
結果
AC × 2
AC × 26
セット名 テストケース
Sample example_00.txt, example_01.txt
All example_00.txt, example_01.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, small_00.txt, small_01.txt, small_02.txt, small_03.txt, small_04.txt, small_05.txt, special_00.txt, special_01.txt, special_02.txt, special_03.txt, special_04.txt, special_05.txt
ケース名 結果 実行時間 メモリ
example_00.txt AC 28 ms 8968 KiB
example_01.txt AC 19 ms 9084 KiB
random_00.txt AC 503 ms 13024 KiB
random_01.txt AC 555 ms 10992 KiB
random_02.txt AC 548 ms 10824 KiB
random_03.txt AC 496 ms 13172 KiB
random_04.txt AC 545 ms 10608 KiB
random_05.txt AC 534 ms 11300 KiB
random_06.txt AC 518 ms 12608 KiB
random_07.txt AC 534 ms 11320 KiB
random_08.txt AC 555 ms 10696 KiB
random_09.txt AC 520 ms 12932 KiB
random_10.txt AC 530 ms 11104 KiB
random_11.txt AC 543 ms 11108 KiB
small_00.txt AC 522 ms 12500 KiB
small_01.txt AC 541 ms 10864 KiB
small_02.txt AC 545 ms 10780 KiB
small_03.txt AC 504 ms 13068 KiB
small_04.txt AC 534 ms 11100 KiB
small_05.txt AC 540 ms 11052 KiB
special_00.txt AC 395 ms 8880 KiB
special_01.txt AC 429 ms 16880 KiB
special_02.txt AC 414 ms 16732 KiB
special_03.txt AC 392 ms 8980 KiB
special_04.txt AC 607 ms 8984 KiB
special_05.txt AC 545 ms 9040 KiB