結果
問題 |
No.592 括弧の対応 (2)
|
ユーザー |
![]() |
提出日時 | 2020-06-28 03:47:14 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 86 ms / 5,000 ms |
コード長 | 202 bytes |
コンパイル時間 | 192 ms |
コンパイル使用メモリ | 82,412 KB |
実行使用メモリ | 92,260 KB |
最終ジャッジ日時 | 2024-07-06 13:22:31 |
合計ジャッジ時間 | 1,382 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 3 |
ソースコード
n = int(input()) s = str(input()) C = [-1]*n d = [] for i in range(n): if s[i] == '(': d.append(i) else: j = d.pop() C[i] = j+1 C[j] = i+1 print(*C, sep='\n')