結果
| 問題 |
No.2927 Reverse Polish Equation
|
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2024-10-14 15:54:29 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 280 bytes |
| コンパイル時間 | 323 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 138,796 KB |
| 最終ジャッジ日時 | 2024-10-16 00:32:36 |
| 合計ジャッジ時間 | 12,594 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 40 WA * 3 |
ソースコード
Y=int(input().split()[1]) S=input().split() def f(x): A=[] for s in S: if"0">s:a=A.pop();A[-1]+=a elif"m">s:A+=[int(s)if"X">s else x] else:A[-2]=[min,max]["mi">s](A[-2:]);A.pop() return A[0] l,r=-1,Y while l<r-1: m=(l+r)>>1 if f(m)<Y:l=m else:r=m print([r,-1][f(r)>Y])