結果
問題 |
No.45 回転寿司
|
ユーザー |
![]() |
提出日時 | 2016-07-23 15:03:56 |
言語 | Fortran (gFortran 14.2.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 321 bytes |
コンパイル時間 | 204 ms |
コンパイル使用メモリ | 31,488 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-27 14:56:37 |
合計ジャッジ時間 | 1,182 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 30 |
ソースコード
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,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