摘要: lightoj 1014 Ifter Party链接:http://www.lightoj.com/volume_showproblem.php?problem=1014题意:给你两个数 p, l,求 cha(cha = p-l)的约数,当约数大于 l 时,按从小到大输出思路:想不出什么好解法,直接暴搞,从 1—> sqrt(ca*1.0); 然后按大小输出,最近刚学了stl,就用vector写了一个 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 8 using namespace std; 9 1 阅读全文
posted @ 2013-07-15 20:52 妮king狼 阅读(335) 评论(0) 推荐(0)
摘要: 链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=26&page=show_problem&problem=2421 题意:求 n 以内的每两个数的最大公约数gcd(a, b)的和 解题思路:假设m和n 是互质的两个数(m 2 #include 3 #include 4 #include 5 6 using namespace std; 7 8 typedef long long LL; 9 10 const int maxv = 4000002;11 阅读全文
posted @ 2013-07-11 20:57 妮king狼 阅读(327) 评论(0) 推荐(0)
摘要: Lifting the StoneTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 4214Accepted Submission(s): 1738 链接: http://acm.hdu.edu.cn/showproblem.php?pid=1115Problem Description There are many secret openings in the floor which are covered by a big heavy... 阅读全文
posted @ 2013-05-12 17:40 妮king狼 阅读(240) 评论(0) 推荐(0)
摘要: 任意多边形重心 首先,我们从最简单的三角形入手, 三角形的重心就是三条中线的交点,他的位置是((x1 + x2 + x3) / 3 , (y1 + y2 + y3) / 3 ) (假设三角形三个点坐标分别为(x1, y1) , (x2, y2), (x3, y3))。 那么, 对于 n 边的凸多边形, 我们总能把它分成不相交的 (n - 2) 个 三角形,并能求出各个重心。下面介绍几种求多边形重心的方法: 线垂法: 具体方法是:用细线提起该物体,在该物体上画细线的延长线,再移位用细线提起该物体,在该物体上画细线的延长线,两线的交叉点就是这一物体在这平面上的重心, ... 阅读全文
posted @ 2013-05-12 17:30 妮king狼 阅读(2181) 评论(0) 推荐(0)
摘要: You can Solve a Geometry Problem tooTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 5298Accepted Submission(s): 2526 链接:http://acm.hdu.edu.cn/showproblem.php?pid=1086Problem DescriptionMany geometry(几何)problems were designed in the ACM/ICPC. And n 阅读全文
posted @ 2013-05-11 21:44 妮king狼 阅读(328) 评论(0) 推荐(0)
摘要: 计算几何中,判断线段是否相交是最基本的题目。 所谓几何, 最基本的当然就是坐标, 从坐标中我们可以知道位置和方向,比如:一个点就是一个位置,两点确定一条直线,从某点指向另一点的有向线段所在的直线是一向量。要处理几何题,我们又不得不涉及到叉积和点积, 判断线段相交就要用到叉积。 下面先讲讲相交的... 阅读全文
posted @ 2013-05-11 21:38 妮king狼 阅读(13735) 评论(5) 推荐(0)
摘要: The 3n + 1 problemTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 16587Accepted Submission(s): 6109 链接:http://acm.hdu.edu.cn/showproblem.php?pid=1032Problem DescriptionProblems in Computer Science are often classified as belonging to a certain cla 阅读全文
posted @ 2013-05-10 19:24 妮king狼 阅读(228) 评论(0) 推荐(0)
摘要: find a way to escapeTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1084Accepted Submission(s): 385 链接:http://acm.hdu.edu.cn/showproblem.php?pid=1593Problem Description一日,话说0068与***泛舟湖上。忽见岸边出现他的一大敌人elnil。0068当然不想落入elnil的魔爪,于是他就得想办法逃脱。这个湖是一个很规则的圆形, 阅读全文
posted @ 2013-05-09 22:02 妮king狼 阅读(325) 评论(0) 推荐(0)
摘要: The BalanceTime Limit: 5000MSMemory Limit: 65536KTotal Submissions: 3113Accepted: 1370链接:http://poj.org/problem?id=2142DescriptionMs. Iyo Kiffa-Australis has a balance and only two kinds of weights to measure a dose of medicine. For example, to measure 200mg of aspirin using 300mg weights and 700mg 阅读全文
posted @ 2013-05-08 18:57 妮king狼 阅读(328) 评论(0) 推荐(0)
摘要: Alien's OrganTime Limit:2 Seconds Memory Limit:65536 KB题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3696There's an alien whose name is Marjar. It is an universal solder came from planet Highrich a long time ago.Marjar is a strange alien. It needs to generate new organs(b 阅读全文
posted @ 2013-05-07 20:21 妮king狼 阅读(650) 评论(0) 推荐(0)