結果
| 問題 |
No.592 括弧の対応 (2)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-03-31 01:48:58 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 541 bytes |
| コンパイル時間 | 202 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 25,188 KB |
| 最終ジャッジ日時 | 2024-11-17 18:24:32 |
| 合計ジャッジ時間 | 19,050 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | TLE * 3 |
ソースコード
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)