首页 > TAG信息列表 > 1157

ZZULIOJ:1157: 连续的n个1

题目描述 计算机数据都是由0和1组成的,看着长长的0101001110101111011,要找出连续n个1的子串有多少个,确实麻烦,请你编程实现吧。 输入 输入第一行为一个字符串,由0和1组成,长度小于1000;输入第二行为一个正整数n。 输出 输出一个整数,表示连续n个的1的子串的个数。 样例输入 Copy 01

[LeetCode] 1157. Online Majority Element In Subarray 子数组中占绝大多数的元素

Design a data structure that efficiently finds the majority element of a given subarray. The majority element of a subarray is an element that occurs threshold times or more in the subarray. Implementing the MajorityChecker class: MajorityChecker(in

C++9018:1157/POJ1088——滑雪

题目来自:http://218.5.5.242:9018/JudgeOnline/problem.php?id=1157 题目来自:http://poj.org/problem?id=1088 题目描述         trs喜欢滑雪。他来到了一个滑雪场,这个滑雪场是一个矩形,为了简便,我们用r行c列的矩阵来表示每块地形。为了得到更快的速度,滑行的路线必须向下倾斜