結果

問題 No.3044 April Sum of Odd
ユーザー titiytitiy
提出日時 2019-04-03 14:42:35
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 308 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 10,728 KB
実行使用メモリ 19,008 KB
最終ジャッジ日時 2023-08-23 08:08:47
合計ジャッジ時間 1,548 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,860 KB
testcase_01 AC 16 ms
7,860 KB
testcase_02 AC 16 ms
7,936 KB
testcase_03 AC 19 ms
8,748 KB
testcase_04 AC 21 ms
9,028 KB
testcase_05 AC 19 ms
8,988 KB
testcase_06 AC 21 ms
9,196 KB
testcase_07 AC 17 ms
8,316 KB
testcase_08 AC 19 ms
8,816 KB
testcase_09 AC 21 ms
9,036 KB
testcase_10 WA -
testcase_11 AC 53 ms
10,028 KB
testcase_12 AC 15 ms
7,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=map(int,input().split())
a=[int(i) for i in input().split()]
b=[]
for i in a:
    if i%2==0:
        if b!=[] and len(b)>=m:
            print(sum(b))
        b=[]
    else:
        b+=[i]
        if i==a[-1] and len(b)>=m:
            print(sum(b))
        elif i==a[-1] and len(b)<m:
            exit()
0