結果

問題 No.1535 五七五
ユーザー とりゐとりゐ
提出日時 2021-05-11 23:26:22
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 263 ms / 2,000 ms
コード長 433 bytes
コンパイル時間 346 ms
コンパイル使用メモリ 87,100 KB
実行使用メモリ 170,488 KB
最終ジャッジ日時 2023-08-03 23:30:06
合計ジャッジ時間 5,239 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,204 KB
testcase_01 AC 77 ms
71,552 KB
testcase_02 AC 72 ms
71,560 KB
testcase_03 AC 75 ms
71,296 KB
testcase_04 AC 191 ms
155,932 KB
testcase_05 AC 256 ms
161,724 KB
testcase_06 AC 215 ms
170,488 KB
testcase_07 AC 71 ms
71,352 KB
testcase_08 AC 69 ms
71,560 KB
testcase_09 AC 70 ms
71,184 KB
testcase_10 AC 75 ms
71,240 KB
testcase_11 AC 73 ms
71,232 KB
testcase_12 AC 74 ms
71,416 KB
testcase_13 AC 71 ms
71,272 KB
testcase_14 AC 73 ms
71,372 KB
testcase_15 AC 71 ms
71,264 KB
testcase_16 AC 72 ms
71,368 KB
testcase_17 AC 74 ms
71,264 KB
testcase_18 AC 252 ms
169,700 KB
testcase_19 AC 258 ms
169,592 KB
testcase_20 AC 262 ms
169,520 KB
testcase_21 AC 253 ms
169,540 KB
testcase_22 AC 263 ms
169,684 KB
testcase_23 AC 251 ms
169,556 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):
  cnt=[-1]*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:
      cnt[L]=R+1
    tmp-=t[L]
  return cnt

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

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

print(ans)
0