結果

問題 No.3044 April Sum of Odd
ユーザー taki_gtaki_g
提出日時 2019-04-01 21:08:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 63 ms / 2,000 ms
コード長 318 bytes
コンパイル時間 184 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 81,920 KB
最終ジャッジ日時 2024-05-04 19:56:51
合計ジャッジ時間 1,296 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
51,712 KB
testcase_01 AC 38 ms
51,840 KB
testcase_02 AC 37 ms
51,584 KB
testcase_03 AC 43 ms
60,416 KB
testcase_04 AC 46 ms
61,440 KB
testcase_05 AC 52 ms
62,592 KB
testcase_06 AC 52 ms
64,000 KB
testcase_07 AC 44 ms
59,648 KB
testcase_08 AC 43 ms
60,288 KB
testcase_09 AC 52 ms
64,128 KB
testcase_10 AC 63 ms
81,920 KB
testcase_11 AC 57 ms
77,568 KB
testcase_12 AC 39 ms
51,456 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

ans = []
count = 0
add = 0
for a in A:
    if a%2==0:
        if count >= M:
            ans.append(add)
        count = 0
        add = 0
    else:
        count += 1
        add += a

if count >= M:
    ans.append(add)


for i in ans:
    print(i)
0