結果

問題 No.935 う し た ぷ に き あ く ん 笑 ビ - ム
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2022-05-07 22:26:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 179 ms / 2,000 ms
コード長 468 bytes
コンパイル時間 317 ms
コンパイル使用メモリ 87,004 KB
実行使用メモリ 78,060 KB
最終ジャッジ日時 2023-09-21 10:23:04
合計ジャッジ時間 10,342 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
76,892 KB
testcase_01 AC 106 ms
76,896 KB
testcase_02 AC 86 ms
75,968 KB
testcase_03 AC 98 ms
76,636 KB
testcase_04 AC 95 ms
76,644 KB
testcase_05 AC 84 ms
76,660 KB
testcase_06 AC 114 ms
77,156 KB
testcase_07 AC 130 ms
77,500 KB
testcase_08 AC 130 ms
77,596 KB
testcase_09 AC 140 ms
77,424 KB
testcase_10 AC 153 ms
77,508 KB
testcase_11 AC 124 ms
77,468 KB
testcase_12 AC 74 ms
71,296 KB
testcase_13 AC 76 ms
71,220 KB
testcase_14 AC 79 ms
71,200 KB
testcase_15 AC 76 ms
71,428 KB
testcase_16 AC 75 ms
71,044 KB
testcase_17 AC 179 ms
77,008 KB
testcase_18 AC 101 ms
76,660 KB
testcase_19 AC 148 ms
78,060 KB
testcase_20 AC 115 ms
76,656 KB
testcase_21 AC 91 ms
76,120 KB
testcase_22 AC 91 ms
76,060 KB
testcase_23 AC 80 ms
75,816 KB
testcase_24 AC 84 ms
75,892 KB
testcase_25 AC 86 ms
75,852 KB
testcase_26 AC 82 ms
75,896 KB
testcase_27 AC 76 ms
71,192 KB
testcase_28 AC 83 ms
75,852 KB
testcase_29 AC 85 ms
75,856 KB
testcase_30 AC 80 ms
75,928 KB
testcase_31 AC 83 ms
75,920 KB
testcase_32 AC 84 ms
76,048 KB
testcase_33 AC 104 ms
76,400 KB
testcase_34 AC 128 ms
77,184 KB
testcase_35 AC 120 ms
76,916 KB
testcase_36 AC 99 ms
76,520 KB
testcase_37 AC 107 ms
76,728 KB
testcase_38 AC 122 ms
77,276 KB
testcase_39 AC 125 ms
77,460 KB
testcase_40 AC 134 ms
77,448 KB
testcase_41 AC 164 ms
77,464 KB
testcase_42 AC 120 ms
76,916 KB
testcase_43 AC 133 ms
77,448 KB
testcase_44 AC 114 ms
77,336 KB
testcase_45 AC 130 ms
77,352 KB
testcase_46 AC 100 ms
76,592 KB
testcase_47 AC 136 ms
77,336 KB
testcase_48 AC 116 ms
76,492 KB
testcase_49 AC 127 ms
77,472 KB
testcase_50 AC 103 ms
76,752 KB
testcase_51 AC 115 ms
77,168 KB
testcase_52 AC 115 ms
77,188 KB
testcase_53 AC 121 ms
77,164 KB
testcase_54 AC 95 ms
76,372 KB
testcase_55 AC 89 ms
76,248 KB
testcase_56 AC 121 ms
77,184 KB
testcase_57 AC 128 ms
77,380 KB
testcase_58 AC 76 ms
71,292 KB
testcase_59 AC 76 ms
71,456 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
S = input()
A = list(map(int,input().split()))
q = int(input())
K = list(map(int,input().split()))
sK = sorted([[k,i] for i,k in enumerate(K)])
ans = [0]*q
for i in range(n):
    num = 0
    now = i
    hp = 0
    for k,ind in sK:
        while now < n and hp+A[now] <= k:
            hp += A[now]
            if S[now] == "E":
                num += 1
            
            now += 1
        ans[ind] = max(ans[ind],num)

for i in ans:
    print(i)
0