結果

問題 No.3044 April Sum of Odd
ユーザー taki_gtaki_g
提出日時 2019-04-01 21:08:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 96 ms / 2,000 ms
コード長 318 bytes
コンパイル時間 319 ms
コンパイル使用メモリ 87,188 KB
実行使用メモリ 90,952 KB
最終ジャッジ日時 2023-08-17 13:19:52
合計ジャッジ時間 2,247 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,588 KB
testcase_01 AC 72 ms
71,532 KB
testcase_02 AC 72 ms
71,280 KB
testcase_03 AC 79 ms
76,700 KB
testcase_04 AC 81 ms
76,636 KB
testcase_05 AC 83 ms
76,604 KB
testcase_06 AC 86 ms
76,780 KB
testcase_07 AC 77 ms
76,540 KB
testcase_08 AC 80 ms
76,604 KB
testcase_09 AC 85 ms
76,876 KB
testcase_10 AC 96 ms
90,952 KB
testcase_11 AC 92 ms
89,276 KB
testcase_12 AC 72 ms
71,120 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())

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

ans = []
count = 0
add = 0
for a in A:
    if a%2==0:
        if count >= M:
            ans.append(add)
        count = 0
        add = 0
    else:
        count += 1
        add += a

if count >= M:
    ans.append(add)


for i in ans:
    print(i)
0