結果

問題 No.935 う し た ぷ に き あ く ん 笑 ビ - ム
ユーザー 12354865271235486527
提出日時 2020-01-15 13:41:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 208 ms / 2,000 ms
コード長 520 bytes
コンパイル時間 394 ms
コンパイル使用メモリ 86,996 KB
実行使用メモリ 78,092 KB
最終ジャッジ日時 2023-08-30 21:31:42
合計ジャッジ時間 10,239 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
76,984 KB
testcase_01 AC 99 ms
76,696 KB
testcase_02 AC 86 ms
76,048 KB
testcase_03 AC 96 ms
76,792 KB
testcase_04 AC 102 ms
76,808 KB
testcase_05 AC 84 ms
76,352 KB
testcase_06 AC 120 ms
76,864 KB
testcase_07 AC 122 ms
76,932 KB
testcase_08 AC 161 ms
77,384 KB
testcase_09 AC 155 ms
77,288 KB
testcase_10 AC 166 ms
77,724 KB
testcase_11 AC 180 ms
77,260 KB
testcase_12 AC 71 ms
71,416 KB
testcase_13 AC 72 ms
71,340 KB
testcase_14 AC 71 ms
71,168 KB
testcase_15 AC 73 ms
71,332 KB
testcase_16 AC 72 ms
71,204 KB
testcase_17 AC 176 ms
76,672 KB
testcase_18 AC 119 ms
77,344 KB
testcase_19 AC 148 ms
76,772 KB
testcase_20 AC 147 ms
77,472 KB
testcase_21 AC 99 ms
76,880 KB
testcase_22 AC 94 ms
76,084 KB
testcase_23 AC 84 ms
75,920 KB
testcase_24 AC 87 ms
76,048 KB
testcase_25 AC 90 ms
75,984 KB
testcase_26 AC 77 ms
75,912 KB
testcase_27 AC 73 ms
71,104 KB
testcase_28 AC 90 ms
76,664 KB
testcase_29 AC 89 ms
75,868 KB
testcase_30 AC 84 ms
75,868 KB
testcase_31 AC 90 ms
76,012 KB
testcase_32 AC 89 ms
76,004 KB
testcase_33 AC 144 ms
77,720 KB
testcase_34 AC 174 ms
77,528 KB
testcase_35 AC 147 ms
77,348 KB
testcase_36 AC 117 ms
77,432 KB
testcase_37 AC 159 ms
78,092 KB
testcase_38 AC 150 ms
76,408 KB
testcase_39 AC 208 ms
77,792 KB
testcase_40 AC 177 ms
77,792 KB
testcase_41 AC 179 ms
78,084 KB
testcase_42 AC 176 ms
76,872 KB
testcase_43 AC 172 ms
77,728 KB
testcase_44 AC 129 ms
77,440 KB
testcase_45 AC 192 ms
78,092 KB
testcase_46 AC 108 ms
76,888 KB
testcase_47 AC 139 ms
76,796 KB
testcase_48 AC 133 ms
77,092 KB
testcase_49 AC 133 ms
76,608 KB
testcase_50 AC 146 ms
76,772 KB
testcase_51 AC 149 ms
77,732 KB
testcase_52 AC 143 ms
78,024 KB
testcase_53 AC 167 ms
77,676 KB
testcase_54 AC 115 ms
77,544 KB
testcase_55 AC 100 ms
76,868 KB
testcase_56 AC 157 ms
77,568 KB
testcase_57 AC 137 ms
77,712 KB
testcase_58 AC 72 ms
71,264 KB
testcase_59 AC 73 ms
71,452 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = input()
A = tuple(map(int, input().split()))
Q = int(input())
K = tuple(map(int, input().split()))
E = [0]
for s in S:
    E.append(E[-1] + (1 if s == 'E' else 0))

for i in range(Q):
    req = 0
    ans = 0
    right = 0
    for left in range(N):
        while right < N and req + A[right] <= K[i]:
            req += A[right]
            right += 1
        ans = max(ans, E[right] - E[left])
        if left == right:
            right += 1
        else:
            req -= A[left]
    print(ans)
0