結果

問題 No.935 う し た ぷ に き あ く ん 笑 ビ - ム
ユーザー hedwig100hedwig100
提出日時 2020-04-13 15:22:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 971 bytes
コンパイル時間 737 ms
コンパイル使用メモリ 11,912 KB
実行使用メモリ 10,660 KB
最終ジャッジ日時 2023-10-25 05:51:22
合計ジャッジ時間 36,218 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 102 ms
10,532 KB
testcase_01 AC 276 ms
10,512 KB
testcase_02 AC 45 ms
10,408 KB
testcase_03 AC 307 ms
10,492 KB
testcase_04 AC 348 ms
10,504 KB
testcase_05 AC 63 ms
10,448 KB
testcase_06 AC 713 ms
10,568 KB
testcase_07 AC 644 ms
10,540 KB
testcase_08 AC 1,495 ms
10,644 KB
testcase_09 AC 920 ms
10,580 KB
testcase_10 AC 1,100 ms
10,608 KB
testcase_11 AC 1,370 ms
10,640 KB
testcase_12 AC 31 ms
10,332 KB
testcase_13 AC 31 ms
10,332 KB
testcase_14 AC 31 ms
10,332 KB
testcase_15 AC 32 ms
10,332 KB
testcase_16 AC 32 ms
10,332 KB
testcase_17 TLE -
testcase_18 AC 387 ms
10,532 KB
testcase_19 AC 1,070 ms
10,616 KB
testcase_20 AC 723 ms
10,560 KB
testcase_21 AC 137 ms
10,432 KB
testcase_22 AC 52 ms
10,428 KB
testcase_23 AC 33 ms
10,344 KB
testcase_24 AC 38 ms
10,340 KB
testcase_25 AC 38 ms
10,340 KB
testcase_26 AC 32 ms
10,344 KB
testcase_27 AC 31 ms
10,336 KB
testcase_28 AC 36 ms
10,344 KB
testcase_29 AC 42 ms
10,344 KB
testcase_30 AC 36 ms
10,340 KB
testcase_31 AC 35 ms
10,344 KB
testcase_32 AC 41 ms
10,344 KB
testcase_33 AC 648 ms
10,564 KB
testcase_34 AC 1,181 ms
10,612 KB
testcase_35 AC 1,042 ms
10,584 KB
testcase_36 AC 254 ms
10,476 KB
testcase_37 AC 662 ms
10,560 KB
testcase_38 AC 694 ms
10,564 KB
testcase_39 AC 1,247 ms
10,624 KB
testcase_40 AC 1,353 ms
10,660 KB
testcase_41 AC 1,342 ms
10,632 KB
testcase_42 AC 1,007 ms
10,568 KB
testcase_43 AC 1,391 ms
10,660 KB
testcase_44 AC 490 ms
10,612 KB
testcase_45 AC 1,363 ms
10,620 KB
testcase_46 AC 174 ms
10,496 KB
testcase_47 AC 579 ms
10,564 KB
testcase_48 AC 412 ms
10,524 KB
testcase_49 AC 495 ms
10,520 KB
testcase_50 AC 600 ms
10,548 KB
testcase_51 AC 737 ms
10,548 KB
testcase_52 AC 719 ms
10,548 KB
testcase_53 AC 1,182 ms
10,616 KB
testcase_54 AC 258 ms
10,496 KB
testcase_55 AC 74 ms
10,384 KB
testcase_56 AC 939 ms
10,564 KB
testcase_57 AC 610 ms
10,560 KB
testcase_58 AC 32 ms
10,332 KB
testcase_59 AC 31 ms
10,332 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10 ** 9 + 7
INF = 10 ** 10
import sys
sys.setrecursionlimit(100000000)
dy = (-1,0,1,0)
dx = (0,1,0,-1)
from collections import deque
from heapq import heapify,heappush,heappop
from copy import deepcopy

def main():
    n = int(input())
    s = input()
    a = list(map(int,input().split()))
    q = int(input())
    query = list(map(int,input().split()))

    for index in range(q):
        t = query[index]
        r = 0
        tot = 0
        ans = 0
        cnt = 0
        for l in range(n):
            while r < n and tot + a[r] <= t:
                if s[r] == 'E':
                    cnt += 1
                tot += a[r]
                r += 1
            
            ans = max(ans,cnt)
            if l == r:
                r += 1
                cnt = 0
                tot = 0
            else:
                if s[l] == 'E':
                    cnt -= 1
                tot -= a[l]
        
        print(ans)

if __name__ == '__main__':
    main()
0