結果
| 問題 | No.3503 Brackets Stack Query 2 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-04-18 19:39:45 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 297 bytes |
| 記録 | |
| コンパイル時間 | 705 ms |
| コンパイル使用メモリ | 20,700 KB |
| 実行使用メモリ | 28,284 KB |
| 最終ジャッジ日時 | 2026-04-18 19:40:28 |
| 合計ジャッジ時間 | 10,118 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 1 |
| other | TLE * 1 -- * 29 |
ソースコード
import re
q=int(input())
s=""
def check(ss):
i=1
while i!=0:
ss,i=re.subn(r"\(\|\)","",ss)
return ss==""
for _ in range(q):
a=input().split()
if a[0]=="1":
s+=a[1]
else:
s=s[:-1]
if check(s):
print("Yes")
else:
print("No")