結果
問題 |
No.618 labo-index
|
ユーザー |
![]() |
提出日時 | 2017-12-19 21:27:20 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 634 bytes |
コンパイル時間 | 279 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 22,528 KB |
最終ジャッジ日時 | 2024-12-16 02:10:32 |
合計ジャッジ時間 | 136,648 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 1 WA * 15 TLE * 19 |
ソースコード
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)