結果
| 問題 | No.935 う し た ぷ に き あ く ん 笑 ビ - ム |
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2026-01-03 17:56:51 |
| 言語 | Python3 (3.14.2 + numpy 2.4.0 + scipy 1.16.3) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 488 bytes |
| 記録 | |
| コンパイル時間 | 676 ms |
| コンパイル使用メモリ | 21,664 KB |
| 実行使用メモリ | 20,856 KB |
| 最終ジャッジ日時 | 2026-01-03 17:57:16 |
| 合計ジャッジ時間 | 21,674 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 2 |
| other | RE * 58 |
ソースコード
n, k = map(int, input().split())
types = input().split()
A = list(map(int, input().split()))
left = 0
total_endurance = 0
enemy_count = 0
max_enemies = 0
for right in range(n):
total_endurance += A[right]
if types[right] == 'E':
enemy_count += 1
while total_endurance > k:
total_endurance -= A[left]
if types[left] == 'E':
enemy_count -= 1
left += 1
max_enemies = max(max_enemies, enemy_count)
print(max_enemies)
vjudge1