結果

問題 No.3044 April Sum of Odd
ユーザー 杉山新杉山新
提出日時 2020-07-09 09:23:04
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 390 bytes
コンパイル時間 238 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 21,468 KB
最終ジャッジ日時 2024-04-16 00:56:59
合計ジャッジ時間 1,578 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,496 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 36 ms
11,264 KB
testcase_04 AC 37 ms
11,392 KB
testcase_05 AC 36 ms
11,392 KB
testcase_06 AC 41 ms
11,520 KB
testcase_07 AC 33 ms
10,880 KB
testcase_08 AC 35 ms
11,392 KB
testcase_09 AC 38 ms
11,520 KB
testcase_10 WA -
testcase_11 AC 95 ms
12,404 KB
testcase_12 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

i=0
cnt=0
total=0

while i < len(num_list):
    a = num_list[i]
    if a % 2 == 0:
        if cnt < M:
            total=0
            cnt=0
            
        else:
            print(total)
            total=0
            cnt=0
        i+=1
        continue
    else:
        cnt+=1
        total+=a
        i+=1
0