結果

問題 No.935 う し た ぷ に き あ く ん 笑 ビ - ム
ユーザー 12354865271235486527
提出日時 2020-01-15 11:17:48
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 1,921 ms / 2,000 ms
コード長 460 bytes
コンパイル時間 390 ms
コンパイル使用メモリ 87,012 KB
実行使用メモリ 78,128 KB
最終ジャッジ日時 2023-08-30 04:37:26
合計ジャッジ時間 12,699 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
77,592 KB
testcase_01 AC 103 ms
77,100 KB
testcase_02 AC 87 ms
76,424 KB
testcase_03 AC 97 ms
76,956 KB
testcase_04 AC 103 ms
77,004 KB
testcase_05 AC 85 ms
76,748 KB
testcase_06 AC 136 ms
77,680 KB
testcase_07 AC 134 ms
77,708 KB
testcase_08 AC 188 ms
77,824 KB
testcase_09 AC 172 ms
77,936 KB
testcase_10 AC 187 ms
77,800 KB
testcase_11 AC 195 ms
77,728 KB
testcase_12 AC 73 ms
71,240 KB
testcase_13 AC 74 ms
71,608 KB
testcase_14 AC 73 ms
71,292 KB
testcase_15 AC 73 ms
71,308 KB
testcase_16 AC 74 ms
71,460 KB
testcase_17 AC 1,921 ms
77,968 KB
testcase_18 AC 134 ms
77,696 KB
testcase_19 AC 174 ms
77,684 KB
testcase_20 AC 167 ms
77,952 KB
testcase_21 AC 104 ms
77,504 KB
testcase_22 AC 93 ms
76,076 KB
testcase_23 AC 86 ms
76,348 KB
testcase_24 AC 95 ms
76,008 KB
testcase_25 AC 93 ms
76,372 KB
testcase_26 AC 78 ms
76,112 KB
testcase_27 AC 72 ms
71,412 KB
testcase_28 AC 90 ms
76,712 KB
testcase_29 AC 87 ms
76,424 KB
testcase_30 AC 85 ms
76,056 KB
testcase_31 AC 93 ms
76,392 KB
testcase_32 AC 94 ms
76,520 KB
testcase_33 AC 156 ms
77,864 KB
testcase_34 AC 198 ms
77,904 KB
testcase_35 AC 167 ms
77,328 KB
testcase_36 AC 121 ms
77,620 KB
testcase_37 AC 164 ms
77,864 KB
testcase_38 AC 163 ms
77,524 KB
testcase_39 AC 223 ms
77,836 KB
testcase_40 AC 203 ms
78,040 KB
testcase_41 AC 204 ms
77,856 KB
testcase_42 AC 192 ms
78,028 KB
testcase_43 AC 206 ms
77,624 KB
testcase_44 AC 142 ms
77,904 KB
testcase_45 AC 212 ms
78,128 KB
testcase_46 AC 118 ms
77,768 KB
testcase_47 AC 150 ms
77,272 KB
testcase_48 AC 135 ms
77,528 KB
testcase_49 AC 144 ms
77,592 KB
testcase_50 AC 158 ms
77,764 KB
testcase_51 AC 160 ms
77,912 KB
testcase_52 AC 158 ms
78,108 KB
testcase_53 AC 190 ms
77,728 KB
testcase_54 AC 119 ms
77,756 KB
testcase_55 AC 102 ms
77,036 KB
testcase_56 AC 178 ms
77,776 KB
testcase_57 AC 152 ms
77,880 KB
testcase_58 AC 74 ms
71,444 KB
testcase_59 AC 74 ms
71,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = input()
A = tuple(map(int, input().split()))
Q = int(input())
K = tuple(map(int, input().split()))
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, S[left:right].count('E'))
        if left == right:
            right += 1
        else:
            req -= A[left]
    print(ans)
0