#B. 查找字符串“33”

    Type: Default 1000ms 256MiB

查找字符串“33”

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.

题目描述

给你一个只包含数字字符的,长度为 nn 的字符串 ss,请你找找在不允许重叠的情况下,里面最多有多少个 3333 子串。

输入格式

第一行为字符串长度 nn

第二行为字符串 ss

输出格式

一个整数,即不重叠的 3333 的数量。

11
01234567890
0
3
333
1
4
3333
2
5
33333
2

数据规模与约定

对于 100%100\% 的数据,1n10001 \le n \le 1000

  • 子任务 1(30 分):保证 ss 中仅包含字符 33
  • 子任务 2(30 分):保证 ss 的长度为 44
  • 子任务 3(40 分):没有特殊限制。

零基础作业(1)

Not Claimed
Status
Done
Problem
6
Open Since
2024-12-14 0:00
Deadline
2024-12-22 23:59
Extension
24 hour(s)