結果

問題 No.3044 April Sum of Odd
ユーザー zutsuzutsu
提出日時 2022-05-12 20:54:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 61 ms / 2,000 ms
コード長 232 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 10,504 KB
実行使用メモリ 18,824 KB
最終ジャッジ日時 2023-09-27 20:40:22
合計ジャッジ時間 1,251 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,884 KB
testcase_01 AC 13 ms
7,740 KB
testcase_02 AC 12 ms
7,860 KB
testcase_03 AC 16 ms
8,724 KB
testcase_04 AC 16 ms
8,984 KB
testcase_05 AC 17 ms
8,788 KB
testcase_06 AC 18 ms
9,024 KB
testcase_07 AC 14 ms
8,272 KB
testcase_08 AC 16 ms
8,768 KB
testcase_09 AC 16 ms
9,000 KB
testcase_10 AC 61 ms
18,824 KB
testcase_11 AC 43 ms
9,976 KB
testcase_12 AC 13 ms
7,812 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

S = 0
ct = 0
for a in A:
    if a % 2 == 1:
        S += a
        ct += 1
    else:
        if ct >= M: print(S)
        S = 0
        ct = 0
if ct >= M: print(S)
0