
尺取
文章平均质量分 85
cillyb
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
poj 2100 Graveyard Design(尺取)
Graveyard DesignTime Limit: 10000MS Memory Limit: 64000KTotal Submissions: 6385 Accepted: 1517Case Time Limit: 2000MSDescriptionKing George has recently dec原创 2016-09-22 15:47:53 · 541 阅读 · 0 评论 -
poj 3320 Jessica's Reading Problem(尺取)
Jessica's Reading ProblemTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 10852 Accepted: 3637DescriptionJessica's a very lovely girl wooed by lots of bo原创 2016-09-22 13:02:30 · 364 阅读 · 0 评论 -
poj 3061 Subsequence(尺取)
SubsequenceTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 12626 Accepted: 5331DescriptionA sequence of N positive integers (10 < N < 100 000), each of原创 2016-09-22 12:59:12 · 435 阅读 · 0 评论 -
CodeForces 616D Longest k-Good Segment(尺取)
D. Longest k-Good Segmenttime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe array a with n integers is g原创 2016-09-22 13:58:43 · 470 阅读 · 0 评论 -
poj 2739 Sum of Consecutive Prime Numbers(尺取,暴力)
Sum of Consecutive Prime NumbersTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 23545 Accepted: 12862DescriptionSome positive integers can be represente原创 2016-09-22 15:07:21 · 447 阅读 · 0 评论 -
51nod 1495中国好区间 && qduoj78 阿尔法狗的难题 (尺取法)
51nod 1495:点击打开链接qduoj 78:点击打开链接官方题解:对于一个数,我们只需要知道它与T的相对大小关系,因此题目可以转化为求存在多少区间大于等于k。假如固定左端点,那么对于一个好区间,那么右端点一定是连续的,若左端点向右移动,那么最近右端点不可能向左移动。因此可以使用双指针来做这题。代码:#include#include#i原创 2017-03-17 12:02:34 · 645 阅读 · 0 评论 -
Codeforces Round #418 (Div. 2) C. An impassioned circulation of affection(尺取)
题意:给你一个长度为n的字符串,q次询问m ch,每次问可最多改变m个字符,问最多连续多少个ch。n 思路:尺取法预处理记录出每个字母,改变m次最长连续。代码:#includeusing namespace std;typedef long long ll;const int maxn = 1505;char str[maxn];int n, dp[30]原创 2017-06-07 22:43:19 · 506 阅读 · 0 评论 -
51nod 1686 第K大区间(二分 尺取)
题意:定义一个区间的值为其众数出现的次数。现给出n个数,求将所有区间的值排序后,第K大的值为多少。思路:答案具有单调性,所以可以二分,关键是check的时候怎么统计有多少区间满足>=mid, 我们可以知道假如区间[L, R]满足,那么左右扩大这个区间都是满足的,所以可以尺取,枚举右端点,找到最大的符合条件的l即可,对答案贡献为l,而且l也只会向右动。右端点向右移动一步,有两种情况,一种原创 2017-09-29 17:36:58 · 373 阅读 · 0 评论