結果
問題 | No.458 異なる素数の和 |
ユーザー |
![]() |
提出日時 | 2016-12-09 00:41:41 |
言語 | Perl (5.40.0) |
結果 |
AC
|
実行時間 | 494 ms / 2,000 ms |
コード長 | 174 bytes |
コンパイル時間 | 46 ms |
コンパイル使用メモリ | 5,120 KB |
実行使用メモリ | 6,912 KB |
最終ジャッジ日時 | 2024-07-05 05:37:54 |
合計ジャッジ時間 | 5,293 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
コンパイルメッセージ
Main.pl syntax OK
ソースコード
$n=<>; $h[0]=0; for$m(grep{!grep{$i%$_<1}2..($i=$_)-1}2..999){ for$i(reverse $m..$n){ $h[$i]=$h[$i-$m]+1 if defined $h[$i-$m] && $h[$i]<$h[$i-$m]+1; } } print $h[$n]||-1;