結果
| 問題 |
No.3044 よくあるカエルさん
|
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 15:18:06 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 414 bytes |
| コンパイル時間 | 176 ms |
| コンパイル使用メモリ | 82,276 KB |
| 実行使用メモリ | 54,184 KB |
| 最終ジャッジ日時 | 2025-06-12 15:18:15 |
| 合計ジャッジ時間 | 1,840 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 20 |
ソースコード
n, m = map(int, input().split())
A = list(map(int, input().split()))
current_sum = 0
current_len = 0
res = []
for a in A:
if a % 2 == 1:
current_sum += a
current_len += 1
else:
if current_len >= m:
res.append(current_sum)
current_sum = 0
current_len = 0
# Check the last run
if current_len >= m:
res.append(current_sum)
for s in res:
print(s)
gew1fw