結果
| 問題 | No.592 括弧の対応 (2) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-03-31 01:48:58 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 541 bytes |
| 記録 | |
| コンパイル時間 | 79 ms |
| コンパイル使用メモリ | 15,104 KB |
| 実行使用メモリ | 14,548 KB |
| 最終ジャッジ日時 | 2026-09-25 12:14:50 |
| 合計ジャッジ時間 | 9,167 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | TLE * 1 -- * 2 |
ソースコード
N = int(input())
S = input()
l = list(S)
ans_l = [0 for i in range(N)]
count = 0
for i in range(len(l)):
if l[i] != "(":
continue
for j in range(len(l)):
if i >= j:
pass
else:
if l[j] == "(":
count += 1
else:
if count == 0:
ans_l[i] = j + 1
ans_l[j] = i + 1
count = 0
break
else:
count -= 1
for li in ans_l:
print(li)