結果

問題 No.3044 April Sum of Odd
ユーザー titiatitia
提出日時 2019-04-01 21:42:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 78 ms / 2,000 ms
コード長 249 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 10,520 KB
実行使用メモリ 18,920 KB
最終ジャッジ日時 2023-08-17 21:30:54
合計ジャッジ時間 1,130 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,820 KB
testcase_01 AC 15 ms
7,764 KB
testcase_02 AC 15 ms
7,764 KB
testcase_03 AC 19 ms
8,744 KB
testcase_04 AC 20 ms
8,864 KB
testcase_05 AC 20 ms
8,744 KB
testcase_06 AC 22 ms
9,020 KB
testcase_07 AC 17 ms
8,148 KB
testcase_08 AC 18 ms
8,676 KB
testcase_09 AC 20 ms
8,788 KB
testcase_10 AC 78 ms
18,920 KB
testcase_11 AC 53 ms
9,788 KB
testcase_12 AC 15 ms
7,828 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M=map(int,input().split())
A=list(map(int,input().split()))
A.append(0)

NOW=0
COUNT=0
for i in range(N+1):
    if A[i]%2==1:
        NOW+=A[i]
        COUNT+=1

    else:
        if COUNT>=M:
            print(NOW)

        NOW=0
        COUNT=0
0