結果

問題 No.1767 BLUE to RED
ユーザー tailstails
提出日時 2021-11-30 17:04:24
言語 Perl
(5.38.2)
結果
AC  
実行時間 1,856 ms / 2,000 ms
コード長 203 bytes
コンパイル時間 680 ms
コンパイル使用メモリ 5,372 KB
実行使用メモリ 70,792 KB
最終ジャッジ日時 2023-09-16 11:39:51
合計ジャッジ時間 24,000 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
5,148 KB
testcase_01 AC 6 ms
5,084 KB
testcase_02 AC 6 ms
5,368 KB
testcase_03 AC 6 ms
5,192 KB
testcase_04 AC 8 ms
5,372 KB
testcase_05 AC 9 ms
5,460 KB
testcase_06 AC 6 ms
5,196 KB
testcase_07 AC 9 ms
5,360 KB
testcase_08 AC 11 ms
5,464 KB
testcase_09 AC 706 ms
41,964 KB
testcase_10 AC 931 ms
51,680 KB
testcase_11 AC 819 ms
47,844 KB
testcase_12 AC 753 ms
41,920 KB
testcase_13 AC 1,111 ms
55,328 KB
testcase_14 AC 1,426 ms
70,504 KB
testcase_15 AC 1,541 ms
70,560 KB
testcase_16 AC 1,552 ms
70,644 KB
testcase_17 AC 1,577 ms
70,536 KB
testcase_18 AC 1,705 ms
70,792 KB
testcase_19 AC 1,856 ms
70,592 KB
testcase_20 AC 1,779 ms
70,724 KB
testcase_21 AC 1,781 ms
70,452 KB
testcase_22 AC 1,804 ms
70,592 KB
testcase_23 AC 1,712 ms
70,608 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Unquoted string "a" may clash with future reserved word at Main.pl line 2.
Unquoted string "c" may clash with future reserved word at Main.pl line 2.
Name "main::b" used only once: possible typo at Main.pl line 4.
Name "main::c" used only once: possible typo at Main.pl line 4.
Main.pl syntax OK

ソースコード

diff #

sub f{$y=$x<$y+$d?$x:$y+$d;}
@$_=glob<>.2e9for a..c;
$p=-2e9;
while($u=$b[$i],$v=$c[$j]){
	if($u<$v){
		f$d=$u-$p;
		$x=$y;
		$p=$u;
		++$i;
	}else{
		f$d=$v-$p;
		$x+=$d;
		$p=$v;
		++$j;
	}
}
print$y;
0