結果

問題 No.3044 April Sum of Odd
ユーザー uto_qkuto_qk
提出日時 2019-04-01 21:49:27
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 81 ms / 2,000 ms
コード長 325 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 10,496 KB
実行使用メモリ 19,048 KB
最終ジャッジ日時 2023-08-17 21:42:57
合計ジャッジ時間 1,304 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,856 KB
testcase_01 AC 16 ms
7,804 KB
testcase_02 AC 16 ms
7,804 KB
testcase_03 AC 19 ms
8,724 KB
testcase_04 AC 21 ms
9,080 KB
testcase_05 AC 20 ms
8,828 KB
testcase_06 AC 21 ms
9,064 KB
testcase_07 AC 17 ms
8,236 KB
testcase_08 AC 20 ms
8,852 KB
testcase_09 AC 21 ms
8,924 KB
testcase_10 AC 81 ms
19,048 KB
testcase_11 AC 54 ms
9,924 KB
testcase_12 AC 15 ms
7,808 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())
A = list(map(int,input().split()))
flag = False
c = 0
s = 0
for i in range(N):
    if A[i] % 2 == 1:
        flag = True
        c += 1
        s += A[i]
    else:
        if flag and c >= M:
            print(s)
        flag = False
        c = 0
        s = 0
if flag and c >= M:
    print(s)
0