码迷,mamicode.com
首页 >  
搜索关键字:尺取    ( 337个结果
POJ 2566(尺取法
自己看了半天并没有看出这题怎么用尺取法(虽然一看就觉得肯定是尺取法。。),由于是绝对值,那么在计算的时候头和尾的实际位置并不重要,而应用尺取法这个数列肯定得是单调,那么我们把前缀和处理出来排序就可以直接应用尺取法了#include#include#include#include#include#in...
分类:其他好文   时间:2015-05-03 00:41:31    阅读次数:208
尺取法 枚举区间
A - 炒鸡想减肥的字符串 Time Limit:1000MS    Memory Limit:65535KB    64bit IO Format: SubmitStatusPracticeNBUT 1576 Description 从前,有一串很长很长的字符串,它由n个小写字母组成。 有一天它在照镜子的时候,觉得自己太肥了,于是它想减肥。减肥的时候,可以不断地去掉第...
分类:其他好文   时间:2015-05-02 09:51:31    阅读次数:156
NOJ1553---Beautiful Walls(尺取法)
问题描述 To simplify the building process, XadillaX built some template on the ground. The template is a very big wall and the height of each unit may be different.8Mao and Hungar have to choose any part...
分类:其他好文   时间:2015-04-16 21:59:28    阅读次数:152
[ACM] CSU 1553 Good subsequence(尺取法)
题目地址:http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1553 给定n的数的序列,求最长连续区间满足区间内的数最大值与最小值的差 (尺取法) const int maxn=10010; int num[maxn]; int n,k; int MIN,MAX; int main() { while(scanf("%d%d",&n,&...
分类:其他好文   时间:2015-04-05 20:30:41    阅读次数:259
Codeforces Round #116 (Div. 2, ACM-ICPC Rules)---E. Cubes
Let’s imagine that you’re playing the following simple computer game. The screen displays n lined-up cubes. Each cube is painted one of m colors. You are allowed to delete not more than k cubes (that d...
分类:其他好文   时间:2015-03-31 09:16:05    阅读次数:141
POJ3320---Jessica's Reading Problem(尺取法)
DescriptionJessica’s a very lovely girl wooed by lots of boys. Recently she has a problem. The final exam is coming, yet she has spent little time on it. If she wants to pass it, she has to master all...
分类:其他好文   时间:2015-03-31 09:10:50    阅读次数:163
POJ3061---Subsequence(尺取法)
Description A sequence of N positive integers (10 < N < 100 000), each of them less than or equal 10000, and a positive integer S (S < 100 000 000) are given. Write a program to find the minimal lengt...
分类:其他好文   时间:2015-03-30 16:36:02    阅读次数:117
POJ-2442 Sequence (K路归并问题拓展)
题意:有n行含m个元素序列,从每行取一个数得到他们的和,一共可以得到m^n个和。输出前n个最小的和。 思路:可以用优先队列递归解决,当只取前两行的数,得到两个数的和的前n小的序列。这个序列就相当于把第一行和第二行合并,再解决n-1行的子问题。 用优先队列解决的时候也有点小技巧,类似尺取法。 //236 KB 563 ms C++ 1480 B #include #include #incl...
分类:其他好文   时间:2015-03-30 13:28:22    阅读次数:151
Subsequence poj 3061 二分(nlog n)或尺取法(n)
SubsequenceTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 9236Accepted: 3701DescriptionA sequence of N positive integers (10 2 #include 3 .....
分类:其他好文   时间:2015-03-29 19:29:16    阅读次数:175
[POJ] 3320 Jessica's Reading Problem (尺取法)
题目地址:http://poj.org/problem?id=3320 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include10 #include11 #i...
分类:其他好文   时间:2015-03-21 22:53:22    阅读次数:504
337条   上一页 1 ... 29 30 31 32 33 34 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!