結果
| 問題 | No.3503 Brackets Stack Query 2 |
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2026-10-18 01:22:11 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 539 bytes |
| 記録 | |
| コンパイル時間 | 83 ms |
| コンパイル使用メモリ | 64,852 KB |
| 実行使用メモリ | 160,192 KB |
| 最終ジャッジ日時 | 2026-10-18 01:23:39 |
| 合計ジャッジ時間 | 79,542 ms |
|
ジャッジサーバーID (参考情報) |
judge6_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 1 TLE * 30 |
ソースコード
Q = int(input())
st = []
for _ in range(Q):
qs = input().split()
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