随笔分类 -  心得

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 阅读(1253) 评论(3) 推荐(0)

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

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

把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 阅读(520) 评论(0) 推荐(0)

导航