結果

問題 No.3044 April Sum of Odd
ユーザー tomarint2tomarint2
提出日時 2019-04-01 21:30:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 110 ms / 2,000 ms
コード長 296 bytes
コンパイル時間 1,094 ms
コンパイル使用メモリ 86,680 KB
実行使用メモリ 90,680 KB
最終ジャッジ日時 2023-08-17 14:20:20
合計ジャッジ時間 2,274 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,396 KB
testcase_01 AC 71 ms
71,104 KB
testcase_02 AC 71 ms
71,268 KB
testcase_03 AC 110 ms
76,480 KB
testcase_04 AC 83 ms
76,588 KB
testcase_05 AC 84 ms
76,572 KB
testcase_06 AC 86 ms
76,716 KB
testcase_07 AC 77 ms
76,412 KB
testcase_08 AC 79 ms
76,484 KB
testcase_09 AC 86 ms
76,604 KB
testcase_10 AC 94 ms
90,680 KB
testcase_11 AC 91 ms
89,028 KB
testcase_12 AC 73 ms
71,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M=map(int,input().split())
A=list(map(int,input().split()))
ans=[]
a1=0
cnt=0
for a in A:
    if a%2==1:
        a1+=a
        cnt+=1
    else:
        if a1!=0 and cnt>=M:
            ans.append(a1)
        a1=0
        cnt=0
if a1!=0 and cnt>=M:
    ans.append(a1)
for a in ans:
    print(a)
0