結果

問題 No.409 ダイエット
ユーザー jjjj
提出日時 2016-08-05 23:46:29
言語 Fortran
(gFortran 13.2.0)
結果
RE  
実行時間 -
コード長 427 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 33,664 KB
実行使用メモリ 568,320 KB
最終ジャッジ日時 2024-04-24 19:45:39
合計ジャッジ時間 7,954 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
10,752 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 1 ms
5,376 KB
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 1 ms
5,376 KB
testcase_15 AC 1 ms
5,376 KB
testcase_16 AC 1 ms
5,376 KB
testcase_17 AC 1 ms
5,376 KB
testcase_18 AC 1 ms
5,376 KB
testcase_19 AC 1 ms
5,376 KB
testcase_20 AC 1 ms
5,376 KB
testcase_21 AC 1 ms
5,376 KB
testcase_22 AC 1 ms
5,376 KB
testcase_23 AC 1 ms
5,376 KB
testcase_24 AC 1 ms
5,376 KB
testcase_25 AC 1 ms
5,376 KB
testcase_26 AC 1 ms
5,376 KB
testcase_27 AC 1 ms
5,376 KB
testcase_28 AC 1 ms
5,376 KB
testcase_29 AC 1 ms
5,376 KB
testcase_30 AC 1 ms
5,376 KB
testcase_31 AC 1 ms
5,376 KB
testcase_32 AC 1 ms
5,376 KB
testcase_33 AC 1 ms
5,376 KB
testcase_34 AC 1 ms
5,376 KB
testcase_35 AC 68 ms
35,968 KB
testcase_36 AC 92 ms
42,240 KB
testcase_37 AC 83 ms
40,064 KB
testcase_38 AC 80 ms
39,552 KB
testcase_39 AC 74 ms
37,632 KB
testcase_40 AC 90 ms
42,368 KB
testcase_41 AC 106 ms
47,744 KB
testcase_42 AC 101 ms
45,056 KB
testcase_43 AC 83 ms
39,296 KB
testcase_44 AC 70 ms
35,968 KB
testcase_45 AC 90 ms
42,496 KB
testcase_46 AC 92 ms
43,264 KB
testcase_47 AC 90 ms
42,368 KB
testcase_48 AC 76 ms
37,376 KB
testcase_49 AC 98 ms
44,800 KB
testcase_50 AC 88 ms
41,600 KB
testcase_51 AC 92 ms
42,752 KB
testcase_52 AC 104 ms
45,696 KB
testcase_53 AC 97 ms
44,544 KB
testcase_54 AC 67 ms
35,840 KB
testcase_55 RE -
testcase_56 RE -
testcase_57 RE -
testcase_58 RE -
testcase_59 RE -
testcase_60 RE -
testcase_61 RE -
testcase_62 RE -
testcase_63 RE -
testcase_64 RE -
testcase_65 RE -
testcase_66 RE -
testcase_67 RE -
testcase_68 RE -
testcase_69 RE -
testcase_70 RE -
testcase_71 RE -
testcase_72 RE -
testcase_73 RE -
testcase_74 RE -
testcase_75 RE -
testcase_76 RE -
testcase_77 RE -
testcase_78 RE -
testcase_79 RE -
testcase_80 RE -
testcase_81 RE -
testcase_82 RE -
testcase_83 RE -
testcase_84 RE -
testcase_85 MLE -
testcase_86 -- -
testcase_87 -- -
testcase_88 -- -
testcase_89 -- -
testcase_90 -- -
testcase_91 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

program main
  implicit none
  integer*8::N,A,B,W,i,j
  integer*8,allocatable::D(:)
  integer*8,allocatable::dp(:,:)

  read *, N,A,B,W
  allocate(D(N))
  allocate(dp(0:N,0:N))
  read *, D

  dp(0,0) = W
  dp(1,0) = W + D(1)
  dp(1,1) = W - A + B*1

  do i=2,N
     dp(i,0) = MINVAL(dp(i-1,0:i-1)) + D(i)
     do j=1,i
        dp(i,j) =dp(i-1,j-1) - A + B*j
     end do
  end do

  print '(i0)', MINVAL(dp(N,0:N))

end program
0