
ACM-区间-尺取法
GDUFE_SSS
这个作者很懒,什么都没留下…
展开
-
POJ 3061 Subsequence 尺取法附基础模板
传送门:http://poj.org/problem?id=3061题意&&思路:数列中找子数列和值,尺取法裸题;AC代码&&模板:#include #include #include const int INF =1000000;using namespace std;int a[100010];int n, t, ans = INF;int su原创 2017-08-04 14:11:22 · 336 阅读 · 0 评论 -
POJ 2566 Bound Found (尺取法)
题意:N个数字组成的数列,K个值,找出数列中一段和的绝对值与K个值相差最小的,输出和的绝对值以及起点和终点。输入0 0 结束思路:一般尺取法只适用单调数列(一般和值递增),该题使用了数列求和的思想,把数列的s都求出来,并使用结构体保存下标,对和进行排序,就可以完美适用尺取法,最后通过下标获取左右区间节点即可Sample Input:5 1-10 -5 0 5原创 2017-07-31 12:44:43 · 456 阅读 · 0 评论 -
An impassioned circulation of affection CodeForces - 814C
Nadeko's birthday is approaching! As she decorated the room for the party, a long garland of Dianthus-shaped paper pieces was placed on a prominent part of the wall. Brother Koyomi will like it!Stil原创 2017-11-23 21:16:59 · 396 阅读 · 0 评论