結果
| 問題 |
No.592 括弧の対応 (2)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-11-12 14:47:57 |
| 言語 | Python2 (2.7.18) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 218 bytes |
| コンパイル時間 | 238 ms |
| コンパイル使用メモリ | 6,784 KB |
| 実行使用メモリ | 12,744 KB |
| 最終ジャッジ日時 | 2024-11-24 23:13:24 |
| 合計ジャッジ時間 | 1,653 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 1 |
| other | RE * 3 |
ソースコード
#yuki_592
N=int(raw_input())
S=raw_input()
res=['' for i in xrange(N+1)]
q=[]
for i in xrange(N):
if S[i]=='(':
q.append(i)
else:
j=q.pop()
res[i]=j
res[j]=i
for i in xrange(len(res)):
print int(res[i])+1