結果

問題 No.409 ダイエット
ユーザー jjjj
提出日時 2016-08-05 23:38:59
言語 Fortran
(gFortran 13.2.0)
結果
WA  
実行時間 -
コード長 442 bytes
コンパイル時間 329 ms
コンパイル使用メモリ 33,792 KB
実行使用メモリ 543,488 KB
最終ジャッジ日時 2024-04-24 19:39:12
合計ジャッジ時間 8,202 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 1 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 WA -
testcase_10 AC 2 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 2 ms
5,376 KB
testcase_33 AC 2 ms
5,376 KB
testcase_34 AC 1 ms
5,376 KB
testcase_35 WA -
testcase_36 AC 93 ms
42,368 KB
testcase_37 AC 84 ms
40,064 KB
testcase_38 AC 81 ms
39,296 KB
testcase_39 AC 76 ms
37,760 KB
testcase_40 WA -
testcase_41 AC 115 ms
47,872 KB
testcase_42 AC 108 ms
45,184 KB
testcase_43 AC 87 ms
39,296 KB
testcase_44 AC 73 ms
35,968 KB
testcase_45 AC 95 ms
42,368 KB
testcase_46 WA -
testcase_47 AC 94 ms
42,496 KB
testcase_48 AC 78 ms
37,120 KB
testcase_49 AC 106 ms
44,928 KB
testcase_50 AC 90 ms
41,600 KB
testcase_51 AC 99 ms
42,880 KB
testcase_52 AC 110 ms
45,568 KB
testcase_53 WA -
testcase_54 WA -
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) = MAX(W - A + B*1,0)

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

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

end program
0