結果

問題 No.3044 April Sum of Odd
ユーザー ShizukuShizuku
提出日時 2023-02-13 01:47:42
言語 Fortran
(gFortran 13.2.0)
結果
RE  
実行時間 -
コード長 484 bytes
コンパイル時間 221 ms
コンパイル使用メモリ 26,280 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2023-09-23 08:30:25
合計ジャッジ時間 3,569 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

program main
    use iso_fortran_env
    implicit none
    integer(int64)::N,M
    integer(int64)::i,cnt,tmp
    integer,allocatable,dimension(:)::A
    read*,N,M
    read*,A
    
    cnt=0;tmp=0
    do i=1,N
        select case (mod(A(i),2))
            case(0)
                if(cnt>=M)print"(i0)",tmp
                cnt=0;tmp=0
            case(1)
                cnt=cnt+1
                tmp=tmp+A(i)
        end select
    end do
    if(cnt>=M)print"(i0)",tmp
end program main
0