結果

問題 No.45 回転寿司
ユーザー jjjj
提出日時 2016-07-23 15:02:54
言語 Fortran
(gFortran 13.2.0)
結果
WA  
実行時間 -
コード長 322 bytes
コンパイル時間 142 ms
コンパイル使用メモリ 31,744 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-05-03 15:28:05
合計ジャッジ時間 1,148 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
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 WA -
testcase_07 AC 1 ms
5,376 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 1 ms
5,376 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 1 ms
5,376 KB
testcase_19 WA -
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 WA -
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 WA -
testcase_28 WA -
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 WA -
testcase_33 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

program main
  implicit none
  integer::N,i,temp
  integer::V(1001),total(0:1001)
  read *, N
  read *, V(1:N)

  total(0)=0
  total(1)=V(1)

  do i=2,N-1,2
     temp =       MAX(total(i-1),total(i-2)+V(i))
     total(i)   = temp
     total(i+1) = MAX(temp,  total(i-1)+V(i+1))
  end do
  print '(i0)',total(N)
end program
0