結果

問題 No.457 (^^*)
ユーザー tailstails
提出日時 2016-12-08 00:12:43
言語 Perl
(5.38.2)
結果
AC  
実行時間 12 ms / 2,000 ms
コード長 385 bytes
コンパイル時間 456 ms
コンパイル使用メモリ 5,360 KB
実行使用メモリ 5,780 KB
最終ジャッジ日時 2023-08-18 20:42:12
合計ジャッジ時間 1,252 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,680 KB
testcase_01 AC 2 ms
4,680 KB
testcase_02 AC 2 ms
4,800 KB
testcase_03 AC 3 ms
4,684 KB
testcase_04 AC 2 ms
4,580 KB
testcase_05 AC 3 ms
4,864 KB
testcase_06 AC 2 ms
4,756 KB
testcase_07 AC 3 ms
4,772 KB
testcase_08 AC 4 ms
4,896 KB
testcase_09 AC 5 ms
4,844 KB
testcase_10 AC 8 ms
5,128 KB
testcase_11 AC 12 ms
5,780 KB
testcase_12 AC 11 ms
5,652 KB
testcase_13 AC 12 ms
5,656 KB
testcase_14 AC 12 ms
5,768 KB
testcase_15 AC 11 ms
5,548 KB
testcase_16 AC 12 ms
5,656 KB
testcase_17 AC 12 ms
5,776 KB
testcase_18 AC 2 ms
4,680 KB
testcase_19 AC 2 ms
4,740 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

$_=<>;
$o5=0;
for(/./g){
	if($_ eq'('){
		++$o1;
	}
	if($_ eq'*'){
		$o2+=$o1; $o1=0;
	}
	if($_ eq'^'){
		$o4+=$o3; $o3=$o2; $o2=0;
	}
	if($_ eq')'){
		$o5+=$o4;
	}
}
$r=$o5;
$o1=$o2=$o3=$o4=$o5=0;
y/()/)(/;
for(reverse /./g){
	if($_ eq'('){
		++$o1;
	}
	if($_ eq'*'){
		$o2+=$o1; $o1=0;
	}
	if($_ eq'^'){
		$o4+=$o3; $o3=$o2; $o2=0;
	}
	if($_ eq')'){
		$o5+=$o4;
	}
}
print $o5,$",$r
0