結果
| 問題 | 
                            No.385 カップ麺生活
                             | 
                    
| コンテスト | |
| ユーザー | 
                             angel_p_57
                         | 
                    
| 提出日時 | 2016-09-18 09:29:46 | 
| 言語 | Ruby  (3.4.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 153 bytes | 
| コンパイル時間 | 46 ms | 
| コンパイル使用メモリ | 7,296 KB | 
| 実行使用メモリ | 18,944 KB | 
| 最終ジャッジ日時 | 2024-11-17 08:51:02 | 
| 合計ジャッジ時間 | 5,315 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 WA * 2 | 
| other | AC * 12 WA * 19 RE * 1 | 
コンパイルメッセージ
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){|p|s+=f[m-p]}
p s
            
            
            
        
            
angel_p_57