結果

問題 No.592 括弧の対応 (2)
ユーザー tails
提出日時 2017-02-13 00:09:26
言語 Perl
(5.40.0)
結果
AC  
実行時間 145 ms / 5,000 ms
コード長 175 bytes
コンパイル時間 601 ms
コンパイル使用メモリ 7,076 KB
実行使用メモリ 12,544 KB
最終ジャッジ日時 2024-12-29 17:06:52
合計ジャッジ時間 1,604 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 3
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

$n=<>;
$s=<>;
for$i(1..$n){
	$c=substr($s,$i-1,1);
	if($c eq '('){
		push@d,$i;
	}
	if($c eq ')'){
		$j=pop@d;
		$c[$i]=$j;
		$c[$j]=$i;
	}
}
for$i(1..$n){
	print $c[$i],$/;
}
0