結果

問題 No.3044 April Sum of Odd
ユーザー kai yokai yo
提出日時 2020-11-08 19:50:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 105 ms / 2,000 ms
コード長 395 bytes
コンパイル時間 82 ms
コンパイル使用メモリ 10,756 KB
実行使用メモリ 15,660 KB
最終ジャッジ日時 2023-09-29 21:38:36
合計ジャッジ時間 1,140 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,848 KB
testcase_01 AC 14 ms
7,848 KB
testcase_02 AC 16 ms
7,888 KB
testcase_03 AC 20 ms
8,572 KB
testcase_04 AC 21 ms
8,360 KB
testcase_05 AC 20 ms
8,704 KB
testcase_06 AC 22 ms
8,880 KB
testcase_07 AC 18 ms
8,124 KB
testcase_08 AC 20 ms
8,564 KB
testcase_09 AC 22 ms
8,708 KB
testcase_10 AC 105 ms
15,660 KB
testcase_11 AC 58 ms
9,088 KB
testcase_12 AC 15 ms
7,916 KB
権限があれば一括ダウンロードができます

ソースコード

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