結果

問題 No.3044 April Sum of Odd
ユーザー pypypymipypypymi
提出日時 2022-02-20 19:32:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 104 ms / 2,000 ms
コード長 335 bytes
コンパイル時間 371 ms
コンパイル使用メモリ 87,220 KB
実行使用メモリ 97,320 KB
最終ジャッジ日時 2023-09-11 21:08:43
合計ジャッジ時間 2,744 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,616 KB
testcase_01 AC 73 ms
71,364 KB
testcase_02 AC 73 ms
71,160 KB
testcase_03 AC 87 ms
76,564 KB
testcase_04 AC 87 ms
76,444 KB
testcase_05 AC 92 ms
76,576 KB
testcase_06 AC 93 ms
76,884 KB
testcase_07 AC 80 ms
76,644 KB
testcase_08 AC 82 ms
76,696 KB
testcase_09 AC 94 ms
76,940 KB
testcase_10 AC 104 ms
97,320 KB
testcase_11 AC 94 ms
89,080 KB
testcase_12 AC 74 ms
71,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m = map(int,input().split())
an = list(map(int,input().split()))
result = []
tmp = []
for i in range(len(an)):
    #print(an[i])
    if an[i]%2==1:
        tmp.append(an[i])
    else:
        if len(tmp)>=m:
            result.append(tmp)
        tmp = []
if len(tmp)>=m:
    result+=[tmp]
for i in result:
    print(sum(i))
        
0