結果
問題 | No.409 ダイエット |
ユーザー |
![]() |
提出日時 | 2016-08-06 00:18:31 |
言語 | Fortran (gFortran 14.2.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 521 bytes |
コンパイル時間 | 669 ms |
コンパイル使用メモリ | 33,024 KB |
実行使用メモリ | 13,768 KB |
最終ジャッジ日時 | 2024-11-07 00:17:43 |
合計ジャッジ時間 | 5,271 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 WA * 52 TLE * 1 -- * 36 |
ソースコード
program mainimplicit noneinteger*8::N,A,B,W,i,j,tmp,uplimitinteger*8,allocatable::D(:)integer*8,allocatable::dp(:),pdp(:)read *, N,A,B,Wallocate(D(N))allocate(dp(0:N))read *, Ddp(0) = W + D(1)dp(1) = W - A + B*1if(B.eq.0) thenprint '(i0)',W-N*Areturnelseuplimit = A/Bend ifdo i=2,Ntmp = MINVAL(dp(0:i-1)) + D(i)do j=uplimit,1,-1dp(j) = dp(j-1) - A + B*jend dodp(0) = tmpend doprint '(i0)', MINVAL(dp(0:N))end program