結果

問題 No.3044 April Sum of Odd
ユーザー nebukuro09nebukuro09
提出日時 2019-04-01 21:30:53
言語 Python2
(2.7.18)
結果
AC  
実行時間 82 ms / 2,000 ms
コード長 279 bytes
コンパイル時間 631 ms
コンパイル使用メモリ 6,664 KB
実行使用メモリ 14,428 KB
最終ジャッジ日時 2023-08-17 14:22:23
合計ジャッジ時間 1,782 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
5,876 KB
testcase_01 AC 11 ms
5,948 KB
testcase_02 AC 10 ms
6,076 KB
testcase_03 AC 15 ms
6,148 KB
testcase_04 AC 16 ms
6,332 KB
testcase_05 AC 16 ms
6,136 KB
testcase_06 AC 17 ms
6,572 KB
testcase_07 AC 13 ms
6,040 KB
testcase_08 AC 14 ms
6,216 KB
testcase_09 AC 17 ms
6,260 KB
testcase_10 AC 82 ms
14,428 KB
testcase_11 AC 64 ms
7,348 KB
testcase_12 AC 11 ms
5,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, raw_input().split())
A = map(int, raw_input().split())

cnt = 0
tmp = 0
for i in xrange(N):
    if A[i] % 2 == 1:
        cnt += 1
        tmp += A[i]
    else:
        if cnt >= M:
            print tmp
        cnt = 0
        tmp = 0

if cnt >= M:
    print tmp
0