結果
| 問題 | No.3503 Brackets Stack Query 2 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-04-18 03:42:59 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 251 bytes |
| 記録 | |
| コンパイル時間 | 389 ms |
| コンパイル使用メモリ | 20,824 KB |
| 実行使用メモリ | 28,160 KB |
| 最終ジャッジ日時 | 2026-04-18 03:43:35 |
| 合計ジャッジ時間 | 8,368 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 1 |
| other | TLE * 1 -- * 29 |
ソースコード
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")