結果

問題 No.8044 April Sum of Odd
ユーザー もりを
提出日時 2019-04-01 21:37:32
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 288 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 21,604 KB
最終ジャッジ日時 2024-11-26 21:38:55
合計ジャッジ時間 1,302 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m = map(int,input().split())
a = list(map(int,input().split()))

cnt = 0
res = 0
for i in a:
    if i % 2 == 0:
        if res > 0 and cnt >= m:
            print(res)
        res = 0
        cnt = 0
    else:
        res += i
        cnt += 1
else:
    if res != 0:
        print(res)
0