
ACM解题报告
文章平均质量分 71
timluoTC
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
pku 2398
http://acm.pku.edu.cn/JudgeOnline/problem?id=2398. 敲的时候sb掉了。。写数论习惯性的是 unsigned __int64 u64..于是乎也贴了上去...于是乎。。因为unsigned....... #include #include #include #include #include #include #include原创 2012-03-11 11:20:57 · 468 阅读 · 0 评论 -
hdu 3532 Max Angle
1. atan2(y,x)返回值在 -pi 到 pi 之间。要划区间 2.当两线段夹角 angel > pi 时 , 取 angle = 2Pi - angle . #include #include #include using namespace std; #define FOR(i,s,e) for (int (i)=(s);(i)<(e);i++) const double IN原创 2012-03-11 11:15:27 · 585 阅读 · 0 评论 -
hdu 1048
#include #include #include using namespace std; struct strCmp { bool operator()(const char s1 ,const char s2) const { return s1 < s2; } }; int main() { // freopen("in.txt","r",stdin); string原创 2012-03-11 11:08:23 · 350 阅读 · 0 评论 -
pku 2823 双端队列
PKU 2823 双端队列特点: 1.队列具有单调性(desc or asc)。 2.只能在对头或队尾进行插入删除操作。 本题维护一个递增和一个递减的两个队列 #include #include #include #include using namespace std; int a[1000010]; int answer_min[1000010]; int answer_m原创 2012-03-11 11:05:11 · 405 阅读 · 0 评论 -
swjtu oj 1579 加号问题
http://acm.swjtu.edu.cn/JudgeOnline/showproblem?problem_id=1579 明显的DP算法。方便起见,定义一个结构体answer。用来储存一个字符串数字,当然拉,也可以不用,看个人喜好。输入字符串s ,加号个数 m,一个answer的二维数组 OPT[ i ][ j ] ,表示: 用 s 的前 i 的 字符,在这i个字符中加入 j 个加原创 2012-03-11 11:02:05 · 525 阅读 · 0 评论 -
pku 3304 Segments
http://acm.pku.edu.cn/JudgeOnline/problem?id=3304 假设存在 符合题意的一条直线l ,它经过所有线段。 那么, 必可以通过旋转,平移等操作,使得该直线至少经过两个#include #include #include using namespace std; #define FOR(i,s,e) for (int (i)=(s); (i) <原创 2012-03-11 11:20:00 · 419 阅读 · 0 评论 -
pku 2653 Pick-up sticks
http://acm.pku.edu.cn/JudgeOnline/problem?id=2653 我明明越界,pku 给tle... 害的我一顿改。就是不过。还以为模板有问题 #include #define FOR(i,s,e) for (int (i)=(s); (i) < (e);i++) inline double max(double a, double b) {return a原创 2012-03-11 11:18:14 · 441 阅读 · 0 评论 -
PKU 1696 Space Ant
http://acm.pku.edu.cn/JudgeOnline/problem?id=1696 贪心一下就可以了,每次选择最佳点。然后将点设为新的起点。数据很弱。 #include #include #include #include using namespace std; #define FOR(i,s,e) for (int (i)=(s); (i) < (e);i++)原创 2012-03-11 11:16:17 · 367 阅读 · 0 评论 -
DP:HDU_1081_To The Max
http://acm.hdu.edu.cn/showproblem.php?pid=1081 题意很容易理解: 现在以 0 -2 -7 0 9 2 -6 2 -4 1 -4 1 -1 8 0 -2 为数据,说明解答过程. 写一个函数maxHelp(i,j),实现以下目的: 当i = 0 , j = 0 时: 传入参数 0 -2 -7 0 。得到新的数组 HELP : 0 -2 -7 0 。原创 2012-03-11 11:09:21 · 389 阅读 · 0 评论 -
hdu 1022
没什么好说,还是练STL #include #include #include #include #include using namespace std; int main() { // freopen("in.txt","r",stdin); string train; string trainOrder; vector answer; i原创 2012-03-11 11:06:14 · 292 阅读 · 0 评论 -
swjtu oj 1589 Help Alice!
http://acm.swjtu.edu.cn/JudgeOnline/showproblem?problem_id=1589 没涉及到什么算法,两个二进制数,求最大公约数,但是这两个数字必须用字符串表示,算是要求自己模板吧,这里给出我AC的程序:二进制字符串的减法和取模运算. #include #include typedef struct {原创 2012-03-11 11:03:51 · 456 阅读 · 0 评论 -
zoj 3425 Similarity
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4109 模拟+KM。表示只会写模拟。。。手贱把'\0' 写成' \n ' 而导致RE。 #include #include #include #include using namespace std; #原创 2012-03-11 10:55:28 · 364 阅读 · 0 评论 -
pku 3587 The Biggest Cake
http://poj.org/problem?id=3587 首先按照O(n^3)暴了一次,2000MS。然后按照O(n^2logn)写了一次,700MS.主要有一些计算几何的注意事项。 1。 sin , cos , atan ,tan ,sqrt 等数学函数执行的速度很慢,最好避免频繁使用 2. 关于精度。 爆的时候开了一个eps = 1e-10,.wa . 改1e-5。ac。继续改直接原创 2012-03-11 11:14:17 · 424 阅读 · 0 评论 -
foj 1971 A math problem
AC大牛的神题。 比赛时候没写出来。 首先,是思维问题。 一开始大部分队伍想的都是算出N,M然后找公式求,也确实找到一些,但是都不可行。赛后看了解题报告才明白将 ANS 写成 ANS = wi mod (pi ^ ci) 的形式,通过求 wi 。 再套用中国剩余定理。确定 ANS 。 首先, 直接求出 N 。 然后 求 wi = 1^A + 2^A + 3^A + ...+ N ^A原创 2012-03-11 11:22:46 · 415 阅读 · 0 评论