結果
| 問題 | No.3503 Brackets Stack Query 2 |
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2026-10-18 01:27:15 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 570 bytes |
| 記録 | |
| コンパイル時間 | 87 ms |
| コンパイル使用メモリ | 64,668 KB |
| 実行使用メモリ | 60,760 KB |
| 最終ジャッジ日時 | 2026-10-18 01:27:38 |
| 合計ジャッジ時間 | 12,877 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 31 |
ソースコード
Q = int(input())
st = []
for _ in range(Q):
qs = input().split()
if True:
continue
match qs:
case ('1', c):
if c == ')':
if len(st) >= 2 and st[-2][0] == '(' and st[-1][0] == '|':
st.append((c, True))
else:
st.append((c, False))
else:
st.append((c, False))
case ('2',):
st.pop()
case _:
assert False
if len(st) == 0 or st[-1][1]:
print('Yes')
else:
print('No')
norioc