Pentium.Labs

System全家桶:https://zhuanlan.zhihu.com/c_1238468913098731520

导航

上一页 1 ··· 4 5 6 7 8 9 10 11 12 下一页

2015年1月25日 #

bc#27做题笔记

摘要: rating掉的哗哗的T^T1001:水题1002:水题,但是题目看错了+手速太捉急 看一下样例解释就会知道,实际上第i个人只能坐第i辆公交车。= =好反人类 这样的话题目就简单了许多.....1003:想出了相邻元素相除再模式匹配的方法......无奈第二题卡题ing+不会AC自动机,... 阅读全文

posted @ 2015-01-25 00:00 Pentium.Labs 阅读(266) 评论(0) 推荐(0) 编辑

2015年1月23日 #

线段的规范香蕉和非规范香蕉

摘要: 丢图跑(逃 阅读全文

posted @ 2015-01-23 11:25 Pentium.Labs 阅读(186) 评论(0) 推荐(0) 编辑

poj3502 恶心题

摘要: 巨恶心的一个题::>___ 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 #... 阅读全文

posted @ 2015-01-23 11:17 Pentium.Labs 阅读(302) 评论(0) 推荐(0) 编辑

2015年1月20日 #

poj1113 凸包

摘要: result=对所有点凸包周长+pi*2*LWA了一次,被Pi的精度坑了以后注意Pi尽可能搞精确一点。Pi=3.14还是不够用Code: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #inclu... 阅读全文

posted @ 2015-01-20 17:48 Pentium.Labs 阅读(303) 评论(0) 推荐(0) 编辑

2015年1月18日 #

gdb简明手册

摘要: 如果是在windows环境下,首先要添加环境变量:新建一个环境变量MinGW_PATH,值为MinGW的运行目录:然后在系统的Path变量后面加上一句:(每两个变量之间用 ; 分开)-------------------------------我是萌萌哒分割线( ̄▽ ̄)---------------... 阅读全文

posted @ 2015-01-18 16:47 Pentium.Labs 阅读(178) 评论(0) 推荐(0) 编辑

2014年12月28日 #

[转]计算几何模板

摘要: Repost1. 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #includ... 阅读全文

posted @ 2014-12-28 17:41 Pentium.Labs 阅读(241) 评论(0) 推荐(0) 编辑

2014年12月22日 #

poj 2945 trie树统计字符串出现次数

摘要: 用记录附加信息的val数组记录次数即可。 trie的原理:每个可能出现的字目给一个编号c,那么整个树就是一个c叉树 ch[u][c]表示 节点u走c边过去之后的节点 PS:trie树还有种动态写法,使用指针和动态分配内存代替了连续的ch数组,更加节省内存。 Reference:http://blog 阅读全文

posted @ 2014-12-22 00:45 Pentium.Labs 阅读(223) 评论(0) 推荐(0) 编辑

2014年12月20日 #

hdu 5147 树状数组

摘要: 题意:求满足a 2 #include 3 #include 4 using namespace std; 5 int c[50010],f[50010],a[50010],g[50010]; 6 int n,T; 7 8 int lowbit(int x) 9 {10 return x... 阅读全文

posted @ 2014-12-20 23:48 Pentium.Labs 阅读(559) 评论(0) 推荐(0) 编辑

树状数组模板

摘要: 1 /* 2 树状数组基本模板 3 2014.4.20 4 5 初始:设a[i]为要读入的数组,共n个元素,则 6 for i:=1 to n do add(i,a[i]); 7 8 add(x,d):在x的位置加上d 9 sum(x):求a[1]~a[x]的和 10 */... 阅读全文

posted @ 2014-12-20 22:27 Pentium.Labs 阅读(165) 评论(0) 推荐(0) 编辑

2014年12月12日 #

hdu 2857 求点关于线段的对称点

摘要: 本来很简单的一个题,但是有个大坑:因为模板中Tline用到了直线的一般方程ax+by+c=0,所以有种很坑的情况需要特判:斜率不存在啊喂老子坑了一下午2333 1 #include 2 #include 3 4 #define eps 1e-6 5 #define PI ... 阅读全文

posted @ 2014-12-12 21:35 Pentium.Labs 阅读(166) 评论(0) 推荐(0) 编辑

2014年12月11日 #

poj 1269 线段相交/平行

摘要: 模板题注意原题中说的线段其实要当成没有端点的直线。被坑了= = 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 #define eps 1e-8 ... 阅读全文

posted @ 2014-12-11 21:54 Pentium.Labs 阅读(192) 评论(0) 推荐(0) 编辑

poj 2653 线段相交

摘要: 题意:一堆线段依次放在桌子上,上面的线段会压住下面的线段,求找出没被压住的线段。sol:从下向上找,如果发现上面的线段与下面的相交,说明被压住了。break掉其实这是个n^2的算法,但是题目已经说了没被压住的线段不超过1000个,所以不会爆 1 #include 2 #include ... 阅读全文

posted @ 2014-12-11 21:11 Pentium.Labs 阅读(197) 评论(0) 推荐(0) 编辑

USACO 3.4 Electric Fence 皮克定理

摘要: 题意:在方格纸上画出一个三角形,求三角形里面包含的格点的数目因为其中一条边就是X轴,一开始想的是算出两条边对应的数学函数,然后枚举x坐标值求解。但其实不用那么麻烦。皮克定理:给定顶点坐标均是整点(或正方形格点)的简单多边形,皮克定理说明了其面积A和内部格点数目i、边上格点数目b的关系:A = i +... 阅读全文

posted @ 2014-12-11 13:49 Pentium.Labs 阅读(205) 评论(0) 推荐(0) 编辑

2014年12月8日 #

使用74283搭建的四位二进制加法器

摘要: MultiSim模拟文件 阅读全文

posted @ 2014-12-08 18:14 Pentium.Labs 阅读(2690) 评论(0) 推荐(0) 编辑

2014年11月22日 #

poj1811 数论

摘要: 题意:判断一个数是否是质数+分解质因数sol:模板题分解质因数用xudyh模板,注意factor返回的是无序的,factorG返回是从小到大的顺序(包括了1)判断质数用kuangbin随机化模板 1 #include 2 #include 3 #include 4 #include ... 阅读全文

posted @ 2014-11-22 21:36 Pentium.Labs 阅读(228) 评论(0) 推荐(0) 编辑

2014年11月18日 #

POJ3735 矩阵

摘要: 题意:有n只猫咪,开始时每只猫咪有花生0颗,现有一组操作,由下面三个中的k个操作组成: 1. g i 给i只猫咪一颗花生米 2. e i 让第i只猫咪吃掉它拥有的所有花生米 3. s i j 将猫咪i与猫咪j的拥有的花生米交换 现将上述一组操作做m次后,问每只猫咪有多少颗花生?sol: 可参考Mat... 阅读全文

posted @ 2014-11-18 20:55 Pentium.Labs 阅读(145) 评论(0) 推荐(0) 编辑

xudyh的gcd模板

摘要: hdu 5019 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include... 阅读全文

posted @ 2014-11-18 19:24 Pentium.Labs 阅读(668) 评论(0) 推荐(0) 编辑

[转]vi command summary

摘要: 1 The following tables contain all the basic vi commands. 2 3 *Starting vi* 4 5 Command Description 6 vi file ... 阅读全文

posted @ 2014-11-18 13:11 Pentium.Labs 阅读(198) 评论(0) 推荐(0) 编辑

2014年11月17日 #

Uva11538 排列组合水题

摘要: 画个图就很容易推出公式:设mn=min(m,n),mx=max(m,n)对角线上:横向:m*C(n,2)纵向:n*C(m,2)因为所有的C函数都是只拿了两个,所以可以优化下。不过不优化也过了= = 1 #include 2 using namespace std; 3 #define LL lon... 阅读全文

posted @ 2014-11-17 21:42 Pentium.Labs 阅读(132) 评论(0) 推荐(0) 编辑

UVA11426 欧拉函数

摘要: 大白书P125 1 #include 2 #include 3 using namespace std; 4 #define MMX 4000010 5 #define LL long long 6 int phi[MMX],f[MMX]; 7 LL S[MMX]; 8 9 void calc... 阅读全文

posted @ 2014-11-17 18:55 Pentium.Labs 阅读(171) 评论(0) 推荐(0) 编辑

上一页 1 ··· 4 5 6 7 8 9 10 11 12 下一页



Pentium.Lab Since 1998