結果

問題 No.618 labo-index
ユーザー Bioinfo_KBioinfo_K
提出日時 2017-12-19 21:27:20
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 634 bytes
コンパイル時間 161 ms
コンパイル使用メモリ 10,836 KB
実行使用メモリ 9,016 KB
最終ジャッジ日時 2023-08-22 07:03:05
合計ジャッジ時間 9,786 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 21 ms
8,768 KB
testcase_01 AC 20 ms
8,692 KB
testcase_02 AC 21 ms
8,824 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 TLE -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,collections,heapq,copy
sys.setrecursionlimit(10**7)
def Is(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())

q = I()
h = []
d,power = 0,0
for i in range(q):
    t,x = Is()
    if   t == 1:
        h.append(x)
    elif t == 2:
        h[x-1] = -10**15
        d += 1
    else:
        power += x
    l = copy.deepcopy(h)
    l.sort(reverse=True)
    l = l[:len(l)-d]
#    print(l,power)
    ans = 0
    for i,e in enumerate(l):
        e = 0 if e+power<=0 else e+power
        if i+1 <=e:
            ans = min(i+1,e)
        else:
            break
    print(ans)
        
0