結果
| 問題 |
No.385 カップ麺生活
|
| コンテスト | |
| ユーザー |
angel_p_57
|
| 提出日時 | 2016-09-18 09:38:00 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 166 bytes |
| コンパイル時間 | 65 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 15,488 KB |
| 最終ジャッジ日時 | 2024-11-17 08:51:20 |
| 合計ジャッジ時間 | 5,118 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 12 WA * 20 |
コンパイルメッセージ
Main.rb:2: warning: assigned but unused variable - n Syntax OK
ソースコード
require"prime"
m,n,*c=$<.read.split.map &:to_i
s=m/c[-1]
a=[]
f=->x{a[x]||=c.map{|e|x==e ?1:(x>e&&0<t=f[x-e])?t+1:0}.max}
Prime.each(m).reverse_each{|p|s+=f[m-p]}
p s
angel_p_57