結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
8,360 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 406 ms
8,460 KB
testcase_04 AC 838 ms
8,544 KB
testcase_05 AC 415 ms
8,420 KB
testcase_06 AC 448 ms
8,428 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 1,493 ms
8,724 KB
testcase_12 AC 16 ms
8,096 KB
testcase_13 AC 17 ms
8,032 KB
testcase_14 AC 16 ms
8,088 KB
testcase_15 WA -
testcase_16 AC 16 ms
8,080 KB
testcase_17 WA -
testcase_18 AC 938 ms
8,536 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 343 ms
8,420 KB
testcase_23 WA -
testcase_24 AC 29 ms
8,176 KB
testcase_25 AC 29 ms
8,116 KB
testcase_26 AC 29 ms
8,244 KB
testcase_27 WA -
testcase_28 AC 21 ms
8,200 KB
testcase_29 AC 24 ms
8,232 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 29 ms
8,232 KB
testcase_33 AC 1,485 ms
8,540 KB
testcase_34 AC 1,054 ms
8,568 KB
testcase_35 AC 1,124 ms
8,576 KB
testcase_36 AC 496 ms
8,416 KB
testcase_37 AC 1,319 ms
8,556 KB
testcase_38 AC 449 ms
8,332 KB
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 1,195 ms
8,768 KB
testcase_42 AC 1,303 ms
8,680 KB
testcase_43 WA -
testcase_44 AC 142 ms
8,520 KB
testcase_45 AC 1,692 ms
8,736 KB
testcase_46 AC 61 ms
8,376 KB
testcase_47 WA -
testcase_48 WA -
testcase_49 WA -
testcase_50 AC 1,005 ms
8,536 KB
testcase_51 AC 788 ms
8,468 KB
testcase_52 AC 713 ms
8,316 KB
testcase_53 AC 1,702 ms
8,736 KB
testcase_54 WA -
testcase_55 AC 52 ms
8,244 KB
testcase_56 AC 1,113 ms
8,460 KB
testcase_57 AC 647 ms
8,452 KB
testcase_58 AC 17 ms
8,212 KB
testcase_59 AC 16 ms
8,236 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=[]
for i in D:
    ans.append(D[i])
import bisect
for i in range(Q):
    f=bisect.bisect_right(ans[:-1],K[i])
    print(f)
0