結果

問題 No.3044 April Sum of Odd
ユーザー tktktktk
提出日時 2019-04-02 00:34:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 291 bytes
コンパイル時間 145 ms
コンパイル使用メモリ 10,568 KB
実行使用メモリ 19,084 KB
最終ジャッジ日時 2023-08-18 04:41:57
合計ジャッジ時間 1,293 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,916 KB
testcase_01 AC 17 ms
7,908 KB
testcase_02 AC 17 ms
7,840 KB
testcase_03 AC 22 ms
8,832 KB
testcase_04 WA -
testcase_05 AC 20 ms
8,808 KB
testcase_06 AC 22 ms
9,176 KB
testcase_07 AC 18 ms
8,340 KB
testcase_08 AC 19 ms
8,816 KB
testcase_09 AC 21 ms
8,992 KB
testcase_10 AC 78 ms
19,084 KB
testcase_11 AC 54 ms
9,904 KB
testcase_12 AC 16 ms
7,748 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())
counter = 0
sum = 0
A = list(map(int,input().split()))
for i in range(N):
    if A[i] % 2 != 0:
        counter += 1
        sum += A[i]
    else:
        if counter >= M:
            print(sum)
        counter = 0
        sum = 0
if sum != 0:
    print(sum)
0