結果

問題 No.8044 April Sum of Odd
ユーザー ohana
提出日時 2023-09-25 17:30:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 61 ms / 2,000 ms
コード長 224 bytes
コンパイル時間 154 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 89,856 KB
最終ジャッジ日時 2024-07-18 13:45:12
合計ジャッジ時間 1,641 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

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

G = [list(g) for k, g in itertools.groupby(A, key=lambda x: x % 2)]

for B in G:
    if len(B) >= m and B[0] % 2:
        print(sum(B))
0