結果
問題 | No.409 ダイエット |
ユーザー |
![]() |
提出日時 | 2017-02-16 21:12:17 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 185 bytes |
コンパイル時間 | 148 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 824,496 KB |
最終ジャッジ日時 | 2024-12-30 00:52:23 |
合計ジャッジ時間 | 166,970 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 34 WA * 1 TLE * 55 MLE * 2 |
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - n Syntax OK
ソースコード
n,A,B,w,*c=`dd`.split.map &:to_i def d c,s x,*y,z=*c,B*s-A c[1]||(return [x,z].min) return x+d(y,1)if x<=z return z+d(y,s+1)if x-z>B*B [x+d(y,1),z+d(y,s+1)].min end p d(c,1)+w