結果
問題 | No.3044 April Sum of Odd |
ユーザー | titiy |
提出日時 | 2019-04-03 14:53:33 |
言語 | Python3 (3.11.6 + numpy 1.26.0 + scipy 1.11.3) |
結果 |
AC
|
実行時間 | 111 ms / 2,000 ms |
コード長 | 348 bytes |
コンパイル時間 | 104 ms |
コンパイル使用メモリ | 10,964 KB |
実行使用メモリ | 19,080 KB |
最終ジャッジ日時 | 2023-08-23 08:25:10 |
合計ジャッジ時間 | 1,905 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge13 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 15 ms
7,812 KB |
testcase_01 | AC | 15 ms
7,792 KB |
testcase_02 | AC | 15 ms
7,712 KB |
testcase_03 | AC | 21 ms
8,856 KB |
testcase_04 | AC | 22 ms
8,928 KB |
testcase_05 | AC | 22 ms
8,848 KB |
testcase_06 | AC | 23 ms
9,192 KB |
testcase_07 | AC | 17 ms
8,276 KB |
testcase_08 | AC | 19 ms
8,752 KB |
testcase_09 | AC | 21 ms
8,996 KB |
testcase_10 | AC | 111 ms
19,080 KB |
testcase_11 | AC | 57 ms
10,020 KB |
testcase_12 | AC | 15 ms
7,720 KB |
ソースコード
n,m=map(int,input().split()) a=[int(i) for i in input().split()] b=[] for i in range(n): #print(i,len(a)) if a[i]%2==0: if b!=[] and len(b)>=m: print(sum(b)) b=[] else: b+=[a[i]] if i==len(a)-1 and len(b)>=m: print(sum(b)) elif i==len(a)-1 and len(b)<m: exit()