結果

問題 No.385 カップ麺生活
ユーザー %20
提出日時 2018-05-22 16:55:43
言語 Perl
(5.40.0)
結果
WA  
実行時間 -
コード長 264 bytes
コンパイル時間 448 ms
コンパイル使用メモリ 5,888 KB
実行使用メモリ 6,912 KB
最終ジャッジ日時 2024-06-28 15:46:55
合計ジャッジ時間 2,371 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28 WA * 4
権限があれば一括ダウンロードができます
コンパイルメッセージ
Name "main::N" used only once: possible typo at Main.pl line 2.
Main.pl syntax OK

ソースコード

diff #

$M=<>;
$N=<>;
@C=glob<>;
for$i(reverse 1..$M){
	if($i==$M||$d[$i]){
		for$c(@C){
			$j=$-=$i-$c;
			$d[$j]+=$-=$d[$i]+1-$d[$j]
		}
	}
}
for$i(2..sqrt$M){
	if(!$p[$i]){
		for($j=$i;($j+=$i)<=$M;){
			$p[$j]=1
		}
	}
}
for(0,2..$M){
	$x+=$p[$_]?0:$d[$_]
}
print$x-1
0