結果

問題 No.3044 April Sum of Odd
ユーザー ohanaohana
提出日時 2023-09-25 17:31:21
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 58 ms / 2,000 ms
コード長 224 bytes
コンパイル時間 316 ms
コンパイル使用メモリ 10,664 KB
実行使用メモリ 18,964 KB
最終ジャッジ日時 2023-09-25 17:31:23
合計ジャッジ時間 1,449 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,080 KB
testcase_01 AC 16 ms
8,152 KB
testcase_02 AC 16 ms
8,064 KB
testcase_03 AC 20 ms
8,888 KB
testcase_04 AC 21 ms
8,964 KB
testcase_05 AC 21 ms
8,944 KB
testcase_06 AC 23 ms
9,236 KB
testcase_07 AC 17 ms
8,440 KB
testcase_08 AC 20 ms
8,752 KB
testcase_09 AC 22 ms
8,960 KB
testcase_10 AC 58 ms
18,964 KB
testcase_11 AC 41 ms
9,932 KB
testcase_12 AC 17 ms
8,168 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