結果
| 問題 | No.3503 Brackets Stack Query 2 |
| コンテスト | |
| ユーザー |
2251799813685248
|
| 提出日時 | 2026-11-26 15:28:34 |
| 言語 | Codon (0.20.6) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 715 bytes |
| 記録 | |
| コンパイル時間 | 7,673 ms |
| コンパイル使用メモリ | 434,080 KB |
| 実行使用メモリ | 157,048 KB |
| 最終ジャッジ日時 | 2026-11-26 15:29:49 |
| 合計ジャッジ時間 | 73,950 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 18 WA * 13 |
ソースコード
stk = []
Q = [0]
def f(Q):
if not Q[0]:
return
# print(Q[0])
Q[0] -= 1
q = input().split()
erased = False
if q[0] == "1":
c = q[1]
stk.append(c)
if len(stk) >= 3 and c == ")":
if stk[len(stk)-1] == ")" and stk[len(stk)-2] == "|" and stk[len(stk)-3] == "(":
erased = True
stk.pop()
stk.pop()
stk.pop()
print("No" if len(stk) else "Yes")
f(Q)
if erased:
stk.append("(")
stk.append("|")
stk.append(")")
stk.pop()
if Q[0]:
print("No" if len(stk) else "Yes")
f(Q)
Q[0] = int(input())
f(Q)
2251799813685248