結果

問題 No.3044 April Sum of Odd
ユーザー mlihua09mlihua09
提出日時 2020-08-23 16:11:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 61 ms / 2,000 ms
コード長 324 bytes
コンパイル時間 213 ms
コンパイル使用メモリ 82,404 KB
実行使用メモリ 84,352 KB
最終ジャッジ日時 2024-04-23 18:03:59
合計ジャッジ時間 1,542 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
52,224 KB
testcase_01 AC 36 ms
51,840 KB
testcase_02 AC 35 ms
52,224 KB
testcase_03 AC 41 ms
60,800 KB
testcase_04 AC 42 ms
61,568 KB
testcase_05 AC 43 ms
63,232 KB
testcase_06 AC 46 ms
64,060 KB
testcase_07 AC 42 ms
60,032 KB
testcase_08 AC 39 ms
60,288 KB
testcase_09 AC 49 ms
65,536 KB
testcase_10 AC 61 ms
84,352 KB
testcase_11 AC 55 ms
79,104 KB
testcase_12 AC 34 ms
51,456 KB
権限があれば一括ダウンロードができます

ソースコード

diff #


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


A = list(map(int, input().split())) + [0]

ans = 0
count = 0


for a in A:
    
    if a % 2 == 1:
        
        ans += a
        count += 1
        
    else:
        
        if count >= M:
            
            print(ans)
            
        ans = 0
        count = 0
        
0