結果
| 問題 | No.3503 Brackets Stack Query 2 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-04-17 23:35:03 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 319 bytes |
| 記録 | |
| コンパイル時間 | 449 ms |
| コンパイル使用メモリ | 85,888 KB |
| 実行使用メモリ | 211,800 KB |
| 最終ジャッジ日時 | 2026-04-17 23:35:54 |
| 合計ジャッジ時間 | 46,519 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 6 WA * 24 |
ソースコード
S=[]
T=[]
Q=int(input())
for _ in range(Q):
q=list(input().split())
if q[0]=="1":
S.append(q[1])
if q[1]==")" and (len(T)>=3 and T[-2:]==["(","|"]):T.pop();T.pop()
else:T.append(q[1])
else:
S.pop()
if T:T.pop()
print("Yes" if T==[] or T==["(","|",")"] else "No")