結果

問題 No.935 う し た ぷ に き あ く ん 笑 ビ - ム
ユーザー 👑 KazunKazun
提出日時 2021-02-07 19:09:17
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 1,044 bytes
コンパイル時間 872 ms
コンパイル使用メモリ 86,984 KB
実行使用メモリ 94,160 KB
最終ジャッジ日時 2023-09-17 17:30:39
合計ジャッジ時間 10,658 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 148 ms
78,056 KB
testcase_01 AC 131 ms
79,264 KB
testcase_02 AC 107 ms
79,096 KB
testcase_03 AC 135 ms
81,872 KB
testcase_04 AC 160 ms
85,436 KB
testcase_05 AC 110 ms
81,260 KB
testcase_06 AC 277 ms
81,956 KB
testcase_07 AC 282 ms
83,508 KB
testcase_08 AC 594 ms
94,160 KB
testcase_09 AC 377 ms
86,888 KB
testcase_10 AC 493 ms
88,052 KB
testcase_11 AC 636 ms
92,180 KB
testcase_12 AC 73 ms
71,232 KB
testcase_13 AC 77 ms
71,140 KB
testcase_14 AC 73 ms
71,204 KB
testcase_15 AC 72 ms
71,456 KB
testcase_16 AC 79 ms
71,460 KB
testcase_17 TLE -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
testcase_52 -- -
testcase_53 -- -
testcase_54 -- -
testcase_55 -- -
testcase_56 -- -
testcase_57 -- -
testcase_58 -- -
testcase_59 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def Binary_Search_Small_Count(A,x,equal=False,sort=False):
    """2分探索によって,x未満の要素の個数を調べる.

    A:リスト
    x:調べる要素
    sort:ソートをする必要があるかどうか(Trueで必要)
    equal:Trueのときはx"未満"がx"以下"になる
    """
    if sort:
        A.sort()

    if A[0]>x or ((not equal) and A[0]==x):
        return 0

    L,R=0,len(A)
    while R-L>1:
        C=L+(R-L)//2
        if A[C]<x or (equal and A[C]==x):
            L=C
        else:
            R=C

    return L+1
#================================================
N=int(input())
S=input()
A=list(map(int,input().split()))
Q=int(input())
K=list(map(int,input().split()))

T=[]
for i in range(N):
    U=[]
    u=0
    for j in range(i,N):
        u+=A[j]
        U.append(u)
    T.append(U)

for k in K:
    X=0
    for i in range(N):
        p=Binary_Search_Small_Count(T[i],k,True)

        Y=0
        for j in range(i,i+p):
            if S[j]=="E":
                Y+=1
        X=max(X,Y)
    print(X)
0