結果

問題 No.409 ダイエット
ユーザー jjjj
提出日時 2016-08-06 00:50:14
言語 Fortran
(gFortran 13.2.0)
結果
WA  
実行時間 -
コード長 656 bytes
コンパイル時間 182 ms
コンパイル使用メモリ 33,152 KB
実行使用メモリ 9,344 KB
最終ジャッジ日時 2024-04-24 15:52:21
合計ジャッジ時間 31,959 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 1 ms
5,376 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 OLE -
testcase_36 OLE -
testcase_37 OLE -
testcase_38 OLE -
testcase_39 OLE -
testcase_40 OLE -
testcase_41 OLE -
testcase_42 OLE -
testcase_43 OLE -
testcase_44 OLE -
testcase_45 OLE -
testcase_46 OLE -
testcase_47 OLE -
testcase_48 OLE -
testcase_49 OLE -
testcase_50 OLE -
testcase_51 OLE -
testcase_52 OLE -
testcase_53 OLE -
testcase_54 OLE -
testcase_55 OLE -
testcase_56 -- -
testcase_57 -- -
testcase_58 -- -
testcase_59 -- -
testcase_60 -- -
testcase_61 -- -
testcase_62 -- -
testcase_63 -- -
testcase_64 -- -
testcase_65 -- -
testcase_66 -- -
testcase_67 -- -
testcase_68 -- -
testcase_69 -- -
testcase_70 -- -
testcase_71 -- -
testcase_72 -- -
testcase_73 -- -
testcase_74 -- -
testcase_75 -- -
testcase_76 -- -
testcase_77 -- -
testcase_78 -- -
testcase_79 -- -
testcase_80 -- -
testcase_81 -- -
testcase_82 -- -
testcase_83 -- -
testcase_84 -- -
testcase_85 -- -
testcase_86 -- -
testcase_87 -- -
testcase_88 -- -
testcase_89 -- -
testcase_90 -- -
testcase_91 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

program main
  implicit none
  integer*8::N,A,B,W,i,str,str_max,tmp,uplimit
  integer*8,allocatable::D(:)
  integer*8,allocatable::dp(:)

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

  dp(0) = W

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

  do i=2,N
     print *, str_max,dp
     tmp = MINVAL(dp(0:str_max)) + D(i)
     if(tmp.eq.dp(0)) then
        !tabeta houga kanarazu yoi
        str_max = 0
     end if

     !str ha tamesugi nai
     do str=str_max+1,1,-1
        dp(str) = dp(str-1) - A + B*str
     end do
     dp(0) = tmp
     str_max = str_max + 1
  end do

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

end program
0