結果

問題 No.8044 April Sum of Odd
ユーザー mlihua09
提出日時 2020-08-23 16:11:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 324 bytes
コンパイル時間 324 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 83,840 KB
最終ジャッジ日時 2024-10-15 18:43:11
合計ジャッジ時間 2,254 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #


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


A = list(map(int, input().split())) + [0]

ans = 0
count = 0


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