結果

問題 No.1535 五七五
ユーザー とりゐとりゐ
提出日時 2021-05-19 01:31:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 280 ms / 2,000 ms
コード長 430 bytes
コンパイル時間 316 ms
コンパイル使用メモリ 82,592 KB
実行使用メモリ 188,888 KB
最終ジャッジ日時 2024-04-21 22:11:06
合計ジャッジ時間 4,562 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
51,968 KB
testcase_01 AC 39 ms
51,968 KB
testcase_02 AC 39 ms
52,224 KB
testcase_03 AC 39 ms
52,096 KB
testcase_04 AC 221 ms
171,616 KB
testcase_05 AC 280 ms
165,816 KB
testcase_06 AC 255 ms
188,888 KB
testcase_07 AC 39 ms
51,968 KB
testcase_08 AC 39 ms
51,968 KB
testcase_09 AC 39 ms
51,968 KB
testcase_10 AC 39 ms
52,224 KB
testcase_11 AC 39 ms
51,948 KB
testcase_12 AC 39 ms
52,224 KB
testcase_13 AC 40 ms
51,968 KB
testcase_14 AC 39 ms
52,212 KB
testcase_15 AC 39 ms
52,480 KB
testcase_16 AC 39 ms
51,840 KB
testcase_17 AC 40 ms
51,968 KB
testcase_18 AC 270 ms
166,832 KB
testcase_19 AC 273 ms
166,164 KB
testcase_20 AC 274 ms
166,720 KB
testcase_21 AC 271 ms
166,620 KB
testcase_22 AC 279 ms
166,540 KB
testcase_23 AC 270 ms
166,596 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a,b,c=map(int,input().split())
s=list(map(str,input().split()))
t=[len(i) for i in s]

def f(m):
  check=[False]*n
  tmp=0
  R=-1
  for L in range(n):
    while tmp<m and R<n-1:
      R+=1
      tmp+=t[R]
    if tmp==m:
      check[L]=R+1
    tmp-=t[L]
  return check

A=f(a)
B=f(b)
C=f(c)

ans=0
for i in range(n):
  if A[i]:
    if A[i]<n and B[A[i]]:
      if B[A[i]]<n and C[B[A[i]]]:
        ans+=1

print(ans)
0