結果

問題 No.935 う し た ぷ に き あ く ん 笑 ビ - ム
ユーザー 👑 timitimi
提出日時 2020-10-26 13:59:17
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,755 ms / 2,000 ms
コード長 615 bytes
コンパイル時間 311 ms
コンパイル使用メモリ 11,020 KB
実行使用メモリ 8,992 KB
最終ジャッジ日時 2023-09-29 02:36:30
合計ジャッジ時間 38,385 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
8,492 KB
testcase_01 AC 162 ms
8,400 KB
testcase_02 AC 212 ms
8,420 KB
testcase_03 AC 417 ms
8,488 KB
testcase_04 AC 817 ms
8,628 KB
testcase_05 AC 399 ms
8,364 KB
testcase_06 AC 471 ms
8,472 KB
testcase_07 AC 556 ms
8,580 KB
testcase_08 AC 1,755 ms
8,676 KB
testcase_09 AC 991 ms
8,756 KB
testcase_10 AC 1,028 ms
8,640 KB
testcase_11 AC 1,548 ms
8,992 KB
testcase_12 AC 17 ms
8,184 KB
testcase_13 AC 16 ms
8,244 KB
testcase_14 AC 17 ms
8,252 KB
testcase_15 AC 17 ms
8,356 KB
testcase_16 AC 16 ms
8,312 KB
testcase_17 AC 1,679 ms
8,908 KB
testcase_18 AC 982 ms
8,656 KB
testcase_19 AC 424 ms
8,420 KB
testcase_20 AC 1,373 ms
8,676 KB
testcase_21 AC 50 ms
8,300 KB
testcase_22 AC 359 ms
8,420 KB
testcase_23 AC 16 ms
8,232 KB
testcase_24 AC 29 ms
8,280 KB
testcase_25 AC 29 ms
8,328 KB
testcase_26 AC 29 ms
8,396 KB
testcase_27 AC 19 ms
8,164 KB
testcase_28 AC 22 ms
8,224 KB
testcase_29 AC 25 ms
8,232 KB
testcase_30 AC 23 ms
8,308 KB
testcase_31 AC 23 ms
8,372 KB
testcase_32 AC 30 ms
8,384 KB
testcase_33 AC 1,505 ms
8,708 KB
testcase_34 AC 1,035 ms
8,644 KB
testcase_35 AC 1,126 ms
8,768 KB
testcase_36 AC 491 ms
8,404 KB
testcase_37 AC 1,280 ms
8,632 KB
testcase_38 AC 467 ms
8,552 KB
testcase_39 AC 1,177 ms
8,812 KB
testcase_40 AC 1,142 ms
8,672 KB
testcase_41 AC 1,241 ms
8,620 KB
testcase_42 AC 1,352 ms
8,756 KB
testcase_43 AC 1,265 ms
8,860 KB
testcase_44 AC 139 ms
8,356 KB
testcase_45 AC 1,704 ms
8,548 KB
testcase_46 AC 58 ms
8,324 KB
testcase_47 AC 330 ms
8,500 KB
testcase_48 AC 994 ms
8,676 KB
testcase_49 AC 371 ms
8,416 KB
testcase_50 AC 975 ms
8,680 KB
testcase_51 AC 796 ms
8,620 KB
testcase_52 AC 709 ms
8,556 KB
testcase_53 AC 1,668 ms
8,616 KB
testcase_54 AC 721 ms
8,440 KB
testcase_55 AC 52 ms
8,308 KB
testcase_56 AC 1,099 ms
8,800 KB
testcase_57 AC 603 ms
8,536 KB
testcase_58 AC 16 ms
8,156 KB
testcase_59 AC 16 ms
8,260 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
S=input()
A=list(map(int, input().split()))
Q=int(input())
K=list(map(int, input().split()))
E=[0]
H=[0]
e=0
if S=='W'*N:
    for i in range(Q):
        print(0)
    exit()
for i in S:
    if i=='E':
        e+=1 
    E.append(e)
for i in range(N):
    H.append(H[-1]+A[i])
D={}
for l in range(N):
    for r in range(l,N):
        e=E[r+1]-E[l]
        h=H[r+1]-H[l]
        if e not in D:
            D[e]=h
        else:
            D[e]=min(D[e],h)
ans=[]
t=S.count('E')
for i in range(1,t+1):
    ans.append(D[i])
import bisect

for i in range(Q):
    f=bisect.bisect_right(ans,K[i])
    print(f)
0