会员
周边
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
dy blog
大学喵
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
17
18
19
20
21
22
23
24
下一页
2015年11月25日
UVA 1193 区间相关(greedy)
摘要: input n d 1<=n<=1000 n行坐标xi,yi output 位于x轴扫描器的扫描距离为d,至少要多少个扫描器才能扫描到所有坐标 如果无法扫描完输出-1,否则输出扫描器个数 做法:将每个坐标转化为扫描器可扫到它的区间,然后取最少区间,最少区间为最多的不连续区间数 1 #include<
阅读全文
posted @ 2015-11-25 19:17 cdongyang
阅读(339)
评论(0)
推荐(0)
2015年11月23日
UVA 11992 线段树
摘要: inputr c m r 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #d...
阅读全文
posted @ 2015-11-23 20:29 cdongyang
阅读(251)
评论(0)
推荐(0)
UVA 1400 线段树
摘要: inputn m 1 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #defi...
阅读全文
posted @ 2015-11-23 09:09 cdongyang
阅读(302)
评论(0)
推荐(0)
2015年11月22日
NBUT 1120 线段树
摘要: inputq nq行 F a b或者Q a boutputface left face top face right可以用map或者线段树做 1 //map 2 #include 3 #include 4 using namespace std; 5 mapa; 6 int main() 7 {...
阅读全文
posted @ 2015-11-22 19:32 cdongyang
阅读(173)
评论(0)
推荐(0)
2015年11月18日
最大连续区间和的算法总结(转)
摘要: 最大连续区间和是一个经典的问题。给定一个长度为n的序列a[1],a[2]...a[n-1],a[n],求一个连续的子序列a[i],a[i+1]...a[j-1],a[j],使得a[i]+a[i+1]...a[j-1]+a[j]最大。①最简单最容易想到的就是根据定义来枚举。枚举上下界{i,j | 0<
阅读全文
posted @ 2015-11-18 20:46 cdongyang
阅读(363)
评论(0)
推荐(0)
2015年11月5日
hiho 1015 KMP
摘要: input1 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 13 using namespace st...
阅读全文
posted @ 2015-11-05 10:11 cdongyang
阅读(180)
评论(0)
推荐(0)
2015年11月3日
hiho#1128 : 二分·二分查找
摘要: input 1<=n<=1e6 1<=k<=2*1e9 a1 a2 ... an 1<=an<=2*1e9 output k存在则输出k是第几大的数,否则输出-1 做法,从两端开始找到中间,把比b大的和比b小的交换 1 #include <cstdio> 2 #include <queue> 3 #
阅读全文
posted @ 2015-11-03 12:28 cdongyang
阅读(196)
评论(0)
推荐(0)
2015年11月2日
hiho1246(数学求模)
摘要: input1 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 13 using ...
阅读全文
posted @ 2015-11-02 21:52 cdongyang
阅读(286)
评论(0)
推荐(0)
HUST - 1599 Multiple
摘要: input长度不大于3*10e5的数字串output不含前导0的能整除64的字串的个数(0算一个,064不算)一般数组中找能整除一个数的字串都是用取余来做的用一个a[64]来存下从1-i位累加到第i位的余数为0-63的个数,每次都加上余数为0的个数,第一位为0的只统计一次,不加入a数组中 1 #in...
阅读全文
posted @ 2015-11-02 17:11 cdongyang
阅读(181)
评论(0)
推荐(0)
hdu 5532
摘要: input 1<=T<=2000 2<=n<=10e5 a1 a2 ... an 1<=ai<=10e5 最多二十个n>1000 output 能否从数组中移除一个数使数组变为升序或降序,能输出YES,不能输出NO 做法,用后一个数减前一个数,统计正数的个数和负数的个数,如果全部为正或全部为负肯定可
阅读全文
posted @ 2015-11-02 10:09 cdongyang
阅读(409)
评论(0)
推荐(0)
上一页
1
···
17
18
19
20
21
22
23
24
下一页
公告