結果
| 問題 | No.3503 Brackets Stack Query 2 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-04-18 03:41:41 |
| 言語 | PyPy2 (7.3.20) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 251 bytes |
| 記録 | |
| コンパイル時間 | 2,205 ms |
| コンパイル使用メモリ | 80,128 KB |
| 実行使用メモリ | 81,408 KB |
| 最終ジャッジ日時 | 2026-04-18 03:41:54 |
| 合計ジャッジ時間 | 6,206 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 1 |
| other | RE * 30 |
ソースコード
def check(s):
while True:
s = s.replace("(|)", "")
if "(|)" not in s:
return s == ""
S = ""
for i in range(int(input())):
q = input()
if q.startswith("1"):
S += q[2:]
else:
S = S[:-1]
print("Yes" if check(S) else "No")