結果

問題 No.935 う し た ぷ に き あ く ん 笑 ビ - ム
ユーザー MitarushiMitarushi
提出日時 2020-08-22 00:56:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 523 ms / 2,000 ms
コード長 541 bytes
コンパイル時間 240 ms
コンパイル使用メモリ 82,224 KB
実行使用メモリ 77,152 KB
最終ジャッジ日時 2024-04-23 06:47:34
合計ジャッジ時間 15,203 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
76,352 KB
testcase_01 AC 145 ms
76,220 KB
testcase_02 AC 66 ms
75,552 KB
testcase_03 AC 173 ms
76,276 KB
testcase_04 AC 194 ms
76,792 KB
testcase_05 AC 70 ms
75,532 KB
testcase_06 AC 267 ms
76,612 KB
testcase_07 AC 270 ms
76,500 KB
testcase_08 AC 503 ms
76,668 KB
testcase_09 AC 342 ms
76,900 KB
testcase_10 AC 382 ms
76,772 KB
testcase_11 AC 477 ms
76,524 KB
testcase_12 AC 38 ms
53,148 KB
testcase_13 AC 43 ms
52,372 KB
testcase_14 AC 39 ms
53,080 KB
testcase_15 AC 39 ms
52,072 KB
testcase_16 AC 37 ms
52,832 KB
testcase_17 AC 523 ms
76,592 KB
testcase_18 AC 167 ms
76,628 KB
testcase_19 AC 478 ms
76,528 KB
testcase_20 AC 259 ms
76,508 KB
testcase_21 AC 103 ms
76,240 KB
testcase_22 AC 65 ms
75,316 KB
testcase_23 AC 51 ms
64,308 KB
testcase_24 AC 53 ms
71,604 KB
testcase_25 AC 55 ms
72,664 KB
testcase_26 AC 49 ms
62,304 KB
testcase_27 AC 44 ms
58,528 KB
testcase_28 AC 54 ms
70,748 KB
testcase_29 AC 60 ms
75,176 KB
testcase_30 AC 54 ms
69,204 KB
testcase_31 AC 53 ms
68,508 KB
testcase_32 AC 61 ms
75,376 KB
testcase_33 AC 265 ms
76,656 KB
testcase_34 AC 414 ms
76,900 KB
testcase_35 AC 381 ms
76,732 KB
testcase_36 AC 142 ms
76,304 KB
testcase_37 AC 254 ms
76,744 KB
testcase_38 AC 261 ms
76,728 KB
testcase_39 AC 406 ms
76,636 KB
testcase_40 AC 480 ms
77,060 KB
testcase_41 AC 478 ms
77,020 KB
testcase_42 AC 378 ms
76,520 KB
testcase_43 AC 466 ms
76,636 KB
testcase_44 AC 205 ms
76,708 KB
testcase_45 AC 444 ms
76,848 KB
testcase_46 AC 104 ms
76,504 KB
testcase_47 AC 212 ms
77,112 KB
testcase_48 AC 195 ms
76,360 KB
testcase_49 AC 201 ms
76,448 KB
testcase_50 AC 241 ms
77,140 KB
testcase_51 AC 292 ms
76,876 KB
testcase_52 AC 278 ms
77,152 KB
testcase_53 AC 395 ms
76,524 KB
testcase_54 AC 144 ms
76,484 KB
testcase_55 AC 80 ms
76,088 KB
testcase_56 AC 354 ms
76,508 KB
testcase_57 AC 253 ms
76,732 KB
testcase_58 AC 38 ms
53,208 KB
testcase_59 AC 39 ms
52,268 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
s = input()
a = [int(i) for i in input().split()]

enemy = [0]
for i in s:
    enemy.append(enemy[-1] + (i == "E"))

hp = [0]
for i in a:
    hp.append(hp[-1] + i)


def max_ok(i, beam):
    ok = i
    ng = n+1
    while abs(ok-ng) > 1:
        m = (ok+ng)//2
        if hp[m] - hp[i] <= beam:
            ok = m
        else:
            ng = m
    return enemy[ok] - enemy[i]


q = int(input())
for k in [int(i) for i in input().split()]:
    ma = 0
    for i in range(n):
        ma = max(ma, max_ok(i, k))
    print(ma)
0