結果

問題 No.1225 I hate I hate Matrix Construction
ユーザー tails
提出日時 2020-09-11 21:48:09
言語 Perl
(5.40.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 215 bytes
コンパイル時間 347 ms
コンパイル使用メモリ 5,120 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-27 11:06:44
合計ジャッジ時間 1,611 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 35
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

$n=<>;$s=<>;$t=<>;
$x=$s=~y/2//;
$y=$t=~y/2//;
if($x&&$y){
	print+($x+$y)*$n-$x*$y;
}elsif($x){
	print$x*$n+$s=~y/1//;
}elsif($y){
	print$y*$n+$t=~y/1//;
}else{
	$x=$s=~y/1//+0;
	$y=$t=~y/1//+0;
	print$x>$y?$x:$y;
}
0