結果
| 問題 |
No.3044 よくあるカエルさん
|
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-03-31 17:34:07 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 688 bytes |
| コンパイル時間 | 185 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 65,664 KB |
| 最終ジャッジ日時 | 2025-03-31 17:34:56 |
| 合計ジャッジ時間 | 2,526 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 1 |
| other | RE * 20 |
ソースコード
n, m = map(int, input().split())
a = list(map(int, input().split()))
current_start = None
current_sum = 0
result = []
for i in range(n):
if a[i] % 2 == 1:
if current_start is None:
current_start = i
current_sum = a[i]
else:
current_sum += a[i]
else:
if current_start is not None:
length = i - current_start
if length >= m:
result.append(current_sum)
current_start = None
current_sum = 0
# Check the last run
if current_start is not None:
length = n - current_start
if length >= m:
result.append(current_sum)
for s in result:
print(s)
lam6er