結果

問題 No.3044 April Sum of Odd
ユーザー 杉山新杉山新
提出日時 2020-07-09 09:19:16
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
WA  
実行時間 -
コード長 390 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 10,560 KB
実行使用メモリ 18,952 KB
最終ジャッジ日時 2023-07-28 16:36:03
合計ジャッジ時間 2,140 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())

num_list = list(map(int,input().split()))

i=0
cnt=0
total=0

while i < len(num_list):
    a = num_list[i]
    if i % 2 == 0:
        if cnt < M:
            total=0
            cnt=0
            
        else:
            print(total)
            total=0
            cnt=0
        i+=1
        continue
    else:
        cnt+=1
        total+=a
        i+=1
0