結果

問題 No.935 う し た ぷ に き あ く ん 笑 ビ - ム
ユーザー tktk_snsntktk_snsn
提出日時 2020-12-26 23:25:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 160 ms / 2,000 ms
コード長 429 bytes
コンパイル時間 209 ms
コンパイル使用メモリ 81,632 KB
実行使用メモリ 76,724 KB
最終ジャッジ日時 2023-10-25 08:16:37
合計ジャッジ時間 7,092 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
72,876 KB
testcase_01 AC 63 ms
66,704 KB
testcase_02 AC 51 ms
63,972 KB
testcase_03 AC 60 ms
64,628 KB
testcase_04 AC 69 ms
68,808 KB
testcase_05 AC 55 ms
61,900 KB
testcase_06 AC 82 ms
68,768 KB
testcase_07 AC 85 ms
68,816 KB
testcase_08 AC 120 ms
72,960 KB
testcase_09 AC 107 ms
73,500 KB
testcase_10 AC 125 ms
76,724 KB
testcase_11 AC 160 ms
73,704 KB
testcase_12 AC 39 ms
53,516 KB
testcase_13 AC 37 ms
53,516 KB
testcase_14 AC 38 ms
53,516 KB
testcase_15 AC 38 ms
53,516 KB
testcase_16 AC 38 ms
53,516 KB
testcase_17 AC 87 ms
66,720 KB
testcase_18 AC 94 ms
73,480 KB
testcase_19 AC 112 ms
72,928 KB
testcase_20 AC 107 ms
72,944 KB
testcase_21 AC 71 ms
70,820 KB
testcase_22 AC 57 ms
66,068 KB
testcase_23 AC 53 ms
63,836 KB
testcase_24 AC 52 ms
63,840 KB
testcase_25 AC 55 ms
63,860 KB
testcase_26 AC 44 ms
59,560 KB
testcase_27 AC 39 ms
53,516 KB
testcase_28 AC 56 ms
66,712 KB
testcase_29 AC 56 ms
63,832 KB
testcase_30 AC 53 ms
63,816 KB
testcase_31 AC 57 ms
65,924 KB
testcase_32 AC 62 ms
68,000 KB
testcase_33 AC 107 ms
74,756 KB
testcase_34 AC 152 ms
74,096 KB
testcase_35 AC 116 ms
72,944 KB
testcase_36 AC 83 ms
73,480 KB
testcase_37 AC 112 ms
74,308 KB
testcase_38 AC 111 ms
70,864 KB
testcase_39 AC 154 ms
74,304 KB
testcase_40 AC 143 ms
76,460 KB
testcase_41 AC 146 ms
76,460 KB
testcase_42 AC 132 ms
72,940 KB
testcase_43 AC 138 ms
74,996 KB
testcase_44 AC 94 ms
73,476 KB
testcase_45 AC 160 ms
76,460 KB
testcase_46 AC 77 ms
72,868 KB
testcase_47 AC 104 ms
70,864 KB
testcase_48 AC 93 ms
73,488 KB
testcase_49 AC 100 ms
70,868 KB
testcase_50 AC 113 ms
72,964 KB
testcase_51 AC 124 ms
74,400 KB
testcase_52 AC 110 ms
74,076 KB
testcase_53 AC 130 ms
73,624 KB
testcase_54 AC 80 ms
70,900 KB
testcase_55 AC 67 ms
68,748 KB
testcase_56 AC 119 ms
74,688 KB
testcase_57 AC 107 ms
76,460 KB
testcase_58 AC 39 ms
53,516 KB
testcase_59 AC 38 ms
53,516 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import accumulate

N = int(input())
S = input()
E = [int(s == "E") for s in S]
A = list(map(int, input().split()))
E = [0] + list(accumulate(E))
A = [0] + list(accumulate(A))

Q = int(input())
for k in map(int, input().split()):
    ans = 0
    r = 0
    for l in range(N):
        r = max(l, r)
        while r + 1 <= N and A[r + 1] - A[l] <= k:
            r += 1
        ans = max(ans, E[r]-E[l])
    print(ans)
0