結果
| 問題 | No.935 う し た ぷ に き あ く ん 笑 ビ - ム |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-03-24 21:19:48 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 498 bytes |
| 記録 | |
| コンパイル時間 | 196 ms |
| コンパイル使用メモリ | 84,992 KB |
| 実行使用メモリ | 72,064 KB |
| 最終ジャッジ日時 | 2026-05-21 07:19:32 |
| 合計ジャッジ時間 | 11,995 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 2 |
| other | AC * 8 TLE * 1 -- * 49 |
ソースコード
from itertools import accumulate
N = int(input())
S = list(str(input()))
A = list(map(int,input().split()))
Q = int(input())
K = list(map(int,input().split()))
sumA = [0]+list(accumulate(A))
E = [0]
for s in S:
if s == 'E':
E.append(1)
else:
E.append(0)
sumE = list(accumulate(E))
j = 0
for k in K:
ans = 0
for i in range(N+1):
j = 0
while j < N+1 and sumA[j]-sumA[i] <= k:
ans = max(ans,sumE[j]-sumE[i])
j += 1
print(ans)