結果
| 問題 | No.592 括弧の対応 (2) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-08-18 05:54:02 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 1,772 ms / 5,000 ms |
| コード長 | 216 bytes |
| 記録 | |
| コンパイル時間 | 175 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 84,352 KB |
| 最終ジャッジ日時 | 2024-10-12 21:04:48 |
| 合計ジャッジ時間 | 3,959 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 3 |
ソースコード
n = int(input())
s = input()
st = []
rec = [0] * n
for i in range(n):
if s[i] == "(":
st.insert(0, i)
else:
j = st.pop(0)
rec[i] = j
rec[j] = i
for i in rec:
print(i + 1)