結果

問題 No.8044 April Sum of Odd
ユーザー kai yo
提出日時 2020-11-08 19:50:41
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 117 ms / 2,000 ms
コード長 395 bytes
コンパイル時間 174 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 19,168 KB
最終ジャッジ日時 2024-07-22 15:40:08
合計ジャッジ時間 1,255 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

A = input().split()
B = input().split()

try:
    C = 0
    D = 0
    for x in range(int(A[0])):
        if 1 == int(B[x]) % 2:
            C = C + int(B[x])
            D = D + 1
        else:
            if C != 0 and D >= int(A[1]):
                print(C)
            C = 0
            D = 0              
    if C != 0 and D >= int(A[1]):
        print(C)
except IndexError:
    print("")
0