結果

問題 No.3044 April Sum of Odd
ユーザー tomarint2tomarint2
提出日時 2019-04-01 21:29:18
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 282 bytes
コンパイル時間 913 ms
コンパイル使用メモリ 87,080 KB
実行使用メモリ 90,968 KB
最終ジャッジ日時 2023-08-17 14:15:44
合計ジャッジ時間 2,351 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
70,996 KB
testcase_01 AC 68 ms
71,048 KB
testcase_02 AC 67 ms
71,224 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 92 ms
90,968 KB
testcase_11 AC 86 ms
89,216 KB
testcase_12 AC 69 ms
71,308 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
if a1!=0 and cnt>=M:
    ans.append(a1)
for a in ans:
    print(a)
0