結果

問題 No.3044 April Sum of Odd
ユーザー anagohirameanagohirame
提出日時 2019-04-01 22:43:04
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 99 ms / 2,000 ms
コード長 246 bytes
コンパイル時間 85 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 21,512 KB
最終ジャッジ日時 2024-05-05 08:30:26
合計ジャッジ時間 1,254 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,624 KB
testcase_01 AC 30 ms
10,624 KB
testcase_02 AC 32 ms
10,624 KB
testcase_03 AC 36 ms
11,392 KB
testcase_04 AC 35 ms
11,520 KB
testcase_05 AC 35 ms
11,392 KB
testcase_06 AC 35 ms
11,648 KB
testcase_07 AC 31 ms
10,880 KB
testcase_08 AC 32 ms
11,264 KB
testcase_09 AC 35 ms
11,520 KB
testcase_10 AC 99 ms
21,512 KB
testcase_11 AC 73 ms
12,488 KB
testcase_12 AC 29 ms
10,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
a = list(map(int, input().split())) + [0]
cnt = 0
res = 0
for i in range(n+1):
    if a[i]%2 == 1:
        cnt += 1
        res += a[i]
    else:
        if cnt >= m:
            print(res)
        cnt, res = 0, 0
0