結果

問題 No.935 う し た ぷ に き あ く ん 笑 ビ - ム
ユーザー ttrttr
提出日時 2020-02-02 16:47:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 801 ms / 2,000 ms
コード長 450 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 81,664 KB
実行使用メモリ 76,432 KB
最終ジャッジ日時 2023-10-19 01:18:10
合計ジャッジ時間 20,386 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
75,820 KB
testcase_01 AC 221 ms
76,036 KB
testcase_02 AC 81 ms
75,536 KB
testcase_03 AC 247 ms
75,728 KB
testcase_04 AC 295 ms
76,092 KB
testcase_05 AC 82 ms
75,288 KB
testcase_06 AC 399 ms
75,964 KB
testcase_07 AC 387 ms
76,040 KB
testcase_08 AC 801 ms
76,216 KB
testcase_09 AC 520 ms
76,084 KB
testcase_10 AC 609 ms
76,124 KB
testcase_11 AC 730 ms
76,184 KB
testcase_12 AC 39 ms
53,404 KB
testcase_13 AC 38 ms
53,404 KB
testcase_14 AC 41 ms
53,404 KB
testcase_15 AC 37 ms
53,404 KB
testcase_16 AC 37 ms
53,404 KB
testcase_17 AC 537 ms
76,108 KB
testcase_18 AC 211 ms
75,964 KB
testcase_19 AC 449 ms
75,992 KB
testcase_20 AC 335 ms
75,960 KB
testcase_21 AC 98 ms
75,716 KB
testcase_22 AC 68 ms
75,280 KB
testcase_23 AC 56 ms
66,144 KB
testcase_24 AC 62 ms
75,256 KB
testcase_25 AC 62 ms
75,264 KB
testcase_26 AC 50 ms
64,060 KB
testcase_27 AC 44 ms
59,036 KB
testcase_28 AC 58 ms
72,500 KB
testcase_29 AC 66 ms
75,276 KB
testcase_30 AC 57 ms
72,288 KB
testcase_31 AC 57 ms
70,240 KB
testcase_32 AC 63 ms
75,268 KB
testcase_33 AC 381 ms
75,992 KB
testcase_34 AC 632 ms
76,164 KB
testcase_35 AC 570 ms
76,148 KB
testcase_36 AC 185 ms
75,936 KB
testcase_37 AC 379 ms
76,180 KB
testcase_38 AC 380 ms
75,948 KB
testcase_39 AC 665 ms
76,228 KB
testcase_40 AC 735 ms
76,232 KB
testcase_41 AC 712 ms
76,236 KB
testcase_42 AC 544 ms
76,104 KB
testcase_43 AC 731 ms
76,432 KB
testcase_44 AC 280 ms
75,976 KB
testcase_45 AC 727 ms
76,200 KB
testcase_46 AC 129 ms
75,724 KB
testcase_47 AC 317 ms
75,908 KB
testcase_48 AC 259 ms
75,952 KB
testcase_49 AC 283 ms
75,844 KB
testcase_50 AC 348 ms
75,972 KB
testcase_51 AC 412 ms
76,072 KB
testcase_52 AC 406 ms
76,040 KB
testcase_53 AC 646 ms
76,156 KB
testcase_54 AC 188 ms
75,940 KB
testcase_55 AC 87 ms
75,680 KB
testcase_56 AC 519 ms
76,092 KB
testcase_57 AC 367 ms
76,036 KB
testcase_58 AC 38 ms
53,404 KB
testcase_59 AC 38 ms
53,404 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
N = int(input())
S = input()
A = [int(a) for a in input().split()]
Q = int(input())
K = [int(k) for k in input().split()]

for i in range(N-1):
    A[i+1] += A[i]
A = [0] + A

enemy = [0]*(N+1)
for i in range(N):
    if S[i] == "E":
        enemy[i+1] = 1
    enemy[i+1] += enemy[i]

for k in K:
    ans = 0
    for i in range(N):
        idx = bisect.bisect_right(A, k+A[i])
        ans = max(ans, enemy[idx-1]-enemy[i])
    print(ans)
0