2015年7月24日

最近很长的一段时间都很忙,博客暂时停止更新?也有可能更新更快!

摘要: 虽然也没有人会来光顾我的博客,不过这个博客本来就是写给自己看的,无所谓啦 阅读全文

posted @ 2015-07-24 01:14 windrises 阅读(159) 评论(2) 推荐(0) 编辑

2015年7月20日

UVa-140 - Bandwidth

摘要: 决定跳过数据结构那章,来看暴力求解法。暴力这章之前也看过,可是前几天做了一道POJ的暴力题,却没有想起来自己曾经在书上看过类似的暴力枚举解法,所以决定再仔细看一遍。感觉要是不刷题,只是单纯的看书的话,记不住啊。书中也说了,可以剪枝(“发现两个结点的距离大于或等于k”,“如果在搜索到结点u时,u结点还... 阅读全文

posted @ 2015-07-20 00:12 windrises 阅读(165) 评论(0) 推荐(0) 编辑

2015年7月17日

UVa-230 - Borrowers

摘要: 终于在UVa上AC了50题了,感觉还有很长的路要走!!!这道题有点麻烦,还是用STL写的。 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 const int maxx=1010; 8 t... 阅读全文

posted @ 2015-07-17 21:26 windrises 阅读(739) 评论(0) 推荐(0) 编辑

UVa-10317 - Equating Equations

摘要: 一个即将高一的网友问的我的题。汗,我怎么大一才接触编程!用STL写的,当时UVa挂了,没有去测试。之后发现TLE了,把vector改成数组依然如此。一时没想到怎么解决,先这样吧,以后再看看。 1 #include 2 #include 3 #include 4 #include 5 #include... 阅读全文

posted @ 2015-07-17 20:57 windrises 阅读(156) 评论(2) 推荐(0) 编辑

UVa-1595 - Symmetry

摘要: 在看了别人的代码后发现有很多可以避免出现精度问题的方法(如坐标都乘2等) 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 const int maxx=1010; 7 const double eps=1e-5... 阅读全文

posted @ 2015-07-17 01:47 windrises 阅读(230) 评论(0) 推荐(0) 编辑

UVa-10391 - Compound Words

摘要: 继续用STL写,虽然比较耗时,但是简洁方便,不容易出错。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 const int maxx=1200... 阅读全文

posted @ 2015-07-17 01:45 windrises 阅读(141) 评论(0) 推荐(0) 编辑

UVa-10763 - Foreign Exchange

摘要: 掌握了新姿势 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 const int maxx=500010; 7 int a[maxx],b[maxx]; 8 int main() 9 {10 //fre... 阅读全文

posted @ 2015-07-17 01:44 windrises 阅读(261) 评论(0) 推荐(0) 编辑

UVa-10935 - Throwing cards away I

摘要: 简单的队列。 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 int main() 7 { 8 //freopen("in.in","r",stdin); 9 //freopen("out.in... 阅读全文

posted @ 2015-07-17 01:41 windrises 阅读(142) 评论(0) 推荐(0) 编辑

UVa-1594 - Ducci Sequence

摘要: 学到了新姿势,对结构体用map,set,sort等,可以在结构体中重载小于号(也有别的方式,没有仔细研究。)。注意const偷懒不加的话会通不过编译。 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace s... 阅读全文

posted @ 2015-07-17 01:40 windrises 阅读(472) 评论(0) 推荐(0) 编辑

UVa-1593 - Alignment of Code

摘要: 这几天一直在刷《算法竞赛入门经典》,由于是STL章节,所以这篇和下面的几篇都用STL来写。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 co... 阅读全文

posted @ 2015-07-17 01:28 windrises 阅读(290) 评论(0) 推荐(0) 编辑

从CSDN搬过来了

摘要: 放暑假了,这几天一直待在学校自己刷题。7.20-8.20一个月将会在集训中度过。 阅读全文

posted @ 2015-07-17 01:24 windrises 阅读(130) 评论(0) 推荐(0) 编辑

2015年6月19日

memset会显著增加时间和空间的消耗吗

摘要: 刷OJ时,发现差不多的代码,室友的内存大约是我的一半。 经过详细的比对,发现问题出现在memset函数上面。const int maxx=1010;int a[maxx][maxx];memset(a,0,sizeof(a));结果如图 如果手写循环进行初始化的话:const int maxx=10... 阅读全文

posted @ 2015-06-19 02:15 windrises 阅读(1184) 评论(3) 推荐(0) 编辑

2015年6月14日

memset对数组的初始化

摘要: 好久没更新了。 花了半个下午,总结了一下memset对int,long long,char型数组的初始化。//0x(零和英文字母x)是十六进制的前缀(十六进制不区分大小写)//memset对字节赋值#include#includeusing namespace std;const int maxx=... 阅读全文

posted @ 2015-06-14 01:09 windrises 阅读(382) 评论(0) 推荐(0) 编辑

2015年4月6日

把N!分解成质数幂的乘积

摘要: 题面http://acm.buaa.edu.cn/contest/184/problem/C/ 大意就是把N!分解成质数幂的乘积。最暴力的方法当然会超时,比如下面这个:#include#include#includeusing namespace std;int result[5010];int m... 阅读全文

posted @ 2015-04-06 16:06 windrises 阅读(497) 评论(0) 推荐(0) 编辑

2015年4月5日

Orz

摘要: 刷了BC和CFOrz 阅读全文

posted @ 2015-04-05 04:07 windrises 阅读(123) 评论(0) 推荐(0) 编辑

导航