結果
| 問題 | No.2927 Reverse Polish Equation |
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2024-10-14 16:03:06 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 281 bytes |
| 記録 | |
| コンパイル時間 | 418 ms |
| コンパイル使用メモリ | 84,904 KB |
| 実行使用メモリ | 136,140 KB |
| 最終ジャッジ日時 | 2026-05-05 13:16:56 |
| 合計ジャッジ時間 | 12,063 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 33 WA * 10 |
ソースコード
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=0,Y+1 while l+1<r: m=(l+r)>>1 if f(m)>Y:r=m else:l=m print([l,-1][f(l)<Y])