結果

問題 No.3044 April Sum of Odd
ユーザー ohanaohana
提出日時 2023-09-25 17:30:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 105 ms / 2,000 ms
コード長 224 bytes
コンパイル時間 459 ms
コンパイル使用メモリ 86,868 KB
実行使用メモリ 97,128 KB
最終ジャッジ日時 2023-09-25 17:30:57
合計ジャッジ時間 3,029 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,448 KB
testcase_01 AC 73 ms
71,112 KB
testcase_02 AC 73 ms
71,248 KB
testcase_03 AC 84 ms
76,616 KB
testcase_04 AC 89 ms
76,596 KB
testcase_05 AC 92 ms
77,000 KB
testcase_06 AC 92 ms
76,776 KB
testcase_07 AC 83 ms
76,432 KB
testcase_08 AC 84 ms
76,636 KB
testcase_09 AC 95 ms
76,896 KB
testcase_10 AC 105 ms
97,128 KB
testcase_11 AC 97 ms
93,712 KB
testcase_12 AC 74 ms
71,400 KB
権限があれば一括ダウンロードができます

ソースコード

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