結果

問題 No.1535 五七五
コンテスト
ユーザー rin204
提出日時 2022-01-18 03:17:34
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 168 ms / 2,000 ms
コード長 276 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 478 ms
コンパイル使用メモリ 86,016 KB
実行使用メモリ 206,036 KB
最終ジャッジ日時 2026-05-17 06:19:56
合計ジャッジ時間 4,289 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n = int(input())
a, b, c = map(int, input().split())
S = input().split()
S = [len(s) for s in S]
ans = 0
se = {0}
tot = 0
for i in range(n):
    tot += S[i]
    se.add(tot)
    if tot - c in se and tot - c - b in se and tot - c - b - a in se:
        ans += 1
    
print(ans)
0