結果

問題 No.935 う し た ぷ に き あ く ん 笑 ビ - ム
ユーザー 👑 timitimi
提出日時 2020-10-26 13:56:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 619 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 11,076 KB
実行使用メモリ 8,852 KB
最終ジャッジ日時 2023-09-29 02:35:10
合計ジャッジ時間 38,718 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
8,360 KB
testcase_01 AC 161 ms
8,400 KB
testcase_02 AC 212 ms
8,336 KB
testcase_03 AC 426 ms
8,452 KB
testcase_04 AC 828 ms
8,416 KB
testcase_05 AC 409 ms
8,352 KB
testcase_06 AC 456 ms
8,436 KB
testcase_07 AC 556 ms
8,356 KB
testcase_08 AC 1,769 ms
8,756 KB
testcase_09 AC 992 ms
8,672 KB
testcase_10 AC 1,000 ms
8,736 KB
testcase_11 AC 1,550 ms
8,852 KB
testcase_12 AC 16 ms
8,236 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 15 ms
8,260 KB
testcase_17 WA -
testcase_18 AC 963 ms
8,548 KB
testcase_19 AC 432 ms
8,520 KB
testcase_20 AC 1,355 ms
8,572 KB
testcase_21 AC 49 ms
8,200 KB
testcase_22 AC 356 ms
8,264 KB
testcase_23 AC 17 ms
8,300 KB
testcase_24 AC 30 ms
8,296 KB
testcase_25 AC 29 ms
8,240 KB
testcase_26 AC 30 ms
8,348 KB
testcase_27 AC 19 ms
8,216 KB
testcase_28 AC 21 ms
8,128 KB
testcase_29 AC 25 ms
8,228 KB
testcase_30 AC 23 ms
8,244 KB
testcase_31 AC 24 ms
8,148 KB
testcase_32 AC 31 ms
8,156 KB
testcase_33 AC 1,478 ms
8,512 KB
testcase_34 AC 1,080 ms
8,596 KB
testcase_35 AC 1,168 ms
8,712 KB
testcase_36 AC 493 ms
8,336 KB
testcase_37 AC 1,300 ms
8,472 KB
testcase_38 AC 461 ms
8,440 KB
testcase_39 AC 1,102 ms
8,724 KB
testcase_40 AC 1,215 ms
8,556 KB
testcase_41 AC 1,232 ms
8,784 KB
testcase_42 AC 1,310 ms
8,660 KB
testcase_43 AC 1,258 ms
8,728 KB
testcase_44 AC 148 ms
8,424 KB
testcase_45 AC 1,701 ms
8,716 KB
testcase_46 AC 59 ms
8,332 KB
testcase_47 AC 335 ms
8,372 KB
testcase_48 AC 990 ms
8,564 KB
testcase_49 AC 385 ms
8,452 KB
testcase_50 AC 955 ms
8,576 KB
testcase_51 AC 804 ms
8,408 KB
testcase_52 AC 724 ms
8,560 KB
testcase_53 AC 1,695 ms
8,596 KB
testcase_54 AC 731 ms
8,444 KB
testcase_55 AC 52 ms
8,276 KB
testcase_56 AC 1,092 ms
8,556 KB
testcase_57 AC 613 ms
8,380 KB
testcase_58 AC 17 ms
8,252 KB
testcase_59 WA -
権限があれば一括ダウンロードができます

ソースコード

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[:-1],K[i])
    print(f)
0