結果

問題 No.935 う し た ぷ に き あ く ん 笑 ビ - ム
ユーザー rlangevinrlangevin
提出日時 2023-01-26 23:15:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 830 ms / 2,000 ms
コード長 483 bytes
コンパイル時間 1,167 ms
コンパイル使用メモリ 86,652 KB
実行使用メモリ 78,408 KB
最終ジャッジ日時 2023-09-09 21:14:45
合計ジャッジ時間 22,971 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
77,256 KB
testcase_01 AC 245 ms
77,692 KB
testcase_02 AC 107 ms
76,800 KB
testcase_03 AC 277 ms
77,384 KB
testcase_04 AC 314 ms
78,032 KB
testcase_05 AC 111 ms
77,072 KB
testcase_06 AC 430 ms
77,864 KB
testcase_07 AC 396 ms
77,644 KB
testcase_08 AC 830 ms
78,056 KB
testcase_09 AC 544 ms
78,408 KB
testcase_10 AC 635 ms
77,912 KB
testcase_11 AC 752 ms
77,864 KB
testcase_12 AC 75 ms
71,404 KB
testcase_13 AC 77 ms
71,468 KB
testcase_14 AC 74 ms
71,320 KB
testcase_15 AC 72 ms
71,452 KB
testcase_16 AC 74 ms
71,396 KB
testcase_17 AC 532 ms
77,940 KB
testcase_18 AC 241 ms
77,648 KB
testcase_19 AC 468 ms
78,160 KB
testcase_20 AC 366 ms
77,896 KB
testcase_21 AC 128 ms
77,500 KB
testcase_22 AC 97 ms
76,768 KB
testcase_23 AC 89 ms
76,248 KB
testcase_24 AC 93 ms
76,548 KB
testcase_25 AC 93 ms
76,760 KB
testcase_26 AC 85 ms
76,152 KB
testcase_27 AC 80 ms
75,356 KB
testcase_28 AC 90 ms
76,712 KB
testcase_29 AC 97 ms
76,528 KB
testcase_30 AC 91 ms
76,208 KB
testcase_31 AC 90 ms
76,080 KB
testcase_32 AC 94 ms
76,624 KB
testcase_33 AC 410 ms
77,852 KB
testcase_34 AC 659 ms
77,980 KB
testcase_35 AC 584 ms
77,688 KB
testcase_36 AC 213 ms
77,396 KB
testcase_37 AC 402 ms
77,640 KB
testcase_38 AC 401 ms
77,656 KB
testcase_39 AC 684 ms
78,016 KB
testcase_40 AC 717 ms
77,996 KB
testcase_41 AC 721 ms
77,704 KB
testcase_42 AC 569 ms
78,088 KB
testcase_43 AC 754 ms
77,924 KB
testcase_44 AC 303 ms
77,740 KB
testcase_45 AC 749 ms
77,968 KB
testcase_46 AC 153 ms
77,528 KB
testcase_47 AC 349 ms
77,892 KB
testcase_48 AC 289 ms
77,700 KB
testcase_49 AC 315 ms
77,572 KB
testcase_50 AC 381 ms
77,612 KB
testcase_51 AC 440 ms
77,772 KB
testcase_52 AC 433 ms
77,804 KB
testcase_53 AC 665 ms
78,292 KB
testcase_54 AC 212 ms
77,588 KB
testcase_55 AC 112 ms
77,280 KB
testcase_56 AC 515 ms
77,876 KB
testcase_57 AC 381 ms
77,496 KB
testcase_58 AC 73 ms
71,404 KB
testcase_59 AC 75 ms
71,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import *

N = int(input())
S = list(input())
A = list(map(int, input().split()))
D = [0] * N
for i, s in enumerate(S):
    if s == "E":
        D[i] = 1
Ac, Dc = [0] * (N + 1), [0] * (N + 1)
for i in range(N):
    Ac[i + 1] = Ac[i] + A[i]
    Dc[i + 1] = Dc[i] + D[i]

Q = int(input())
K = list(map(int, input().split()))
for q in K:
    ans = 0
    for i in range(N + 1):
        ind = bisect_right(Ac, Ac[i] + q)
        ans = max(ans, Dc[ind-1] - Dc[i])
    print(ans)
0