結果

問題 No.935 う し た ぷ に き あ く ん 笑 ビ - ム
ユーザー pekempeypekempey
提出日時 2019-11-29 22:02:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 237 ms / 2,000 ms
コード長 432 bytes
コンパイル時間 1,432 ms
コンパイル使用メモリ 87,092 KB
実行使用メモリ 77,944 KB
最終ジャッジ日時 2023-10-12 06:20:22
合計ジャッジ時間 12,156 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
77,120 KB
testcase_01 AC 123 ms
77,440 KB
testcase_02 AC 99 ms
75,904 KB
testcase_03 AC 125 ms
77,148 KB
testcase_04 AC 133 ms
77,392 KB
testcase_05 AC 106 ms
76,372 KB
testcase_06 AC 159 ms
77,180 KB
testcase_07 AC 159 ms
77,276 KB
testcase_08 AC 212 ms
77,144 KB
testcase_09 AC 177 ms
77,304 KB
testcase_10 AC 182 ms
77,556 KB
testcase_11 AC 201 ms
77,568 KB
testcase_12 AC 75 ms
71,416 KB
testcase_13 AC 75 ms
71,376 KB
testcase_14 AC 75 ms
70,912 KB
testcase_15 AC 76 ms
71,112 KB
testcase_16 AC 74 ms
71,392 KB
testcase_17 AC 150 ms
76,444 KB
testcase_18 AC 145 ms
77,256 KB
testcase_19 AC 184 ms
77,440 KB
testcase_20 AC 160 ms
77,616 KB
testcase_21 AC 117 ms
77,388 KB
testcase_22 AC 112 ms
76,492 KB
testcase_23 AC 92 ms
75,832 KB
testcase_24 AC 95 ms
75,804 KB
testcase_25 AC 98 ms
75,968 KB
testcase_26 AC 83 ms
75,724 KB
testcase_27 AC 78 ms
71,040 KB
testcase_28 AC 98 ms
76,432 KB
testcase_29 AC 95 ms
75,820 KB
testcase_30 AC 94 ms
75,852 KB
testcase_31 AC 96 ms
75,824 KB
testcase_32 AC 115 ms
76,836 KB
testcase_33 AC 166 ms
77,356 KB
testcase_34 AC 217 ms
77,928 KB
testcase_35 AC 193 ms
77,312 KB
testcase_36 AC 145 ms
77,288 KB
testcase_37 AC 169 ms
77,472 KB
testcase_38 AC 167 ms
77,772 KB
testcase_39 AC 222 ms
77,496 KB
testcase_40 AC 229 ms
77,520 KB
testcase_41 AC 237 ms
77,556 KB
testcase_42 AC 192 ms
76,564 KB
testcase_43 AC 232 ms
77,252 KB
testcase_44 AC 162 ms
77,416 KB
testcase_45 AC 229 ms
77,224 KB
testcase_46 AC 133 ms
77,440 KB
testcase_47 AC 151 ms
76,732 KB
testcase_48 AC 146 ms
77,460 KB
testcase_49 AC 151 ms
77,604 KB
testcase_50 AC 167 ms
77,644 KB
testcase_51 AC 180 ms
77,452 KB
testcase_52 AC 178 ms
77,304 KB
testcase_53 AC 217 ms
77,472 KB
testcase_54 AC 148 ms
77,316 KB
testcase_55 AC 122 ms
77,064 KB
testcase_56 AC 200 ms
77,348 KB
testcase_57 AC 167 ms
77,944 KB
testcase_58 AC 76 ms
71,036 KB
testcase_59 AC 77 ms
71,036 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = input()
A = list(map(int, input().split()))
Q = int(input())
K = list(map(int, input().split()))

for k in K:
  j = 0
  s = 0
  c = 0
  ans = 0
  for i in range(N):
    if j < i:
      j = i
      s = 0
      c = 0
    while j < N and s + A[j] <= k:
      s += A[j]
      if S[j] == 'E':
        c += 1
      j += 1
    ans = max(ans, c)
    if S[i] == 'E':
      c -= 1
    s -= A[i]
  print(ans)
    
    
  
0