結果

問題 No.8044 April Sum of Odd
コンテスト
ユーザー 👑 rin204
提出日時 2021-08-29 16:35:56
言語 PyPy3
(8.0.0 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 40 ms / 2,000 ms
+ 235µs
コード長 278 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 67 ms
コンパイル使用メモリ 81,068 KB
実行使用メモリ 84,936 KB
最終ジャッジ日時 2026-09-28 00:32:03
合計ジャッジ時間 2,092 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n, m = map(int, input().split())
alst = list(map(int, input().split()))
cnt = 0
tot = 0
for a in alst:
    if a % 2 == 1:
        cnt += 1
        tot += a
    else:
        if cnt >= m:
            print(tot)
        cnt = 0
        tot = 0
        
if cnt >= m:
    print(tot)
0