結果

問題 No.3044 April Sum of Odd
ユーザー 👑 rin204rin204
提出日時 2021-08-29 16:35:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 61 ms / 2,000 ms
コード長 278 bytes
コンパイル時間 372 ms
コンパイル使用メモリ 82,576 KB
実行使用メモリ 82,804 KB
最終ジャッジ日時 2024-05-01 22:55:17
合計ジャッジ時間 1,585 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
52,520 KB
testcase_01 AC 35 ms
53,092 KB
testcase_02 AC 36 ms
53,272 KB
testcase_03 AC 41 ms
61,532 KB
testcase_04 AC 41 ms
63,688 KB
testcase_05 AC 45 ms
63,548 KB
testcase_06 AC 44 ms
65,344 KB
testcase_07 AC 38 ms
60,768 KB
testcase_08 AC 40 ms
61,808 KB
testcase_09 AC 46 ms
66,060 KB
testcase_10 AC 61 ms
82,804 KB
testcase_11 AC 53 ms
79,088 KB
testcase_12 AC 34 ms
52,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
alst = list(map(int, input().split()))
cnt = 0
tot = 0
for a in alst:
    if a % 2 == 1:
        cnt += 1
        tot += a
    else:
        if cnt >= m:
            print(tot)
        cnt = 0
        tot = 0
        
if cnt >= m:
    print(tot)
0