B. 躲猪猪

    Type: Default 1000ms 256MiB

躲猪猪

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

时间限制:1s1s

空间限制:512MB512MB

题目背景

在小猪的世界里,有一种小猪们最爱玩的游戏——躲猪猪

题目描述

今天,piggypiggy喊来了朋友们一起玩躲猪猪,他躲进了一个字符串ss中,你需要在字符串中找到piggypiggy!由于piggypiggy的实力实在是太强了,所以他允许朋友们使用一次作弊器,对某一个位置的字符进行任意修改。你需要告诉piggypiggy的朋友们,他们最多能在字符串ss中找出多少piggypiggy子串

子串,计算机术语,串中任意个连续的字符组成的子序列称为该串的子串

注意:题目保证字符串中所有字符均为小写字母

输入格式

第一行,一个字符串ss

输出格式

一个整数,表示使用一次作弊器后,最多能找出的piggypiggy子串个数

样例输入1

piggy

样例输出1

0

样例输入2

pigqy

样例输出2

1

数据范围

| 测试点 | s|s| | | ------ | ----------- | | 131-3 | 1000\leq 1000 | | 464-6 | 105\leq 10^5 | | 7107-10 | 106\leq 10^6 |

8.18日竞赛3班训练

Not Attended
Status
Done
Rule
IOI
Problem
4
Start at
2025-8-18 18:00
End at
2025-8-18 21:00
Duration
3 hour(s)
Host
Partic.
11