上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 48 下一页
  2013年5月29日
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=15&problem=1266&mosmsg=Submission+received+with+ID+11830997容斥原理 第一题 水!代码:#include<iostream>#include<cstring>#include<cstdio>#include<string>#include<set># 阅读全文
posted @ 2013-05-29 09:59 夜-> 阅读(353) 评论(0) 推荐(0) 编辑
  2013年5月22日
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3666差分约束,关键在于找不等式,然后建图这个题 spfa 判断负环时,如果以更新次数大于等于N判断有负环,会超时只要判断更新次数大于sqrt(N)就可以,原理不知道代码:#include<iostream>#include<cstring>#include<cstdio>#include<string>#include<set>#include<map>#include<cmath>#include<algorithm 阅读全文
posted @ 2013-05-22 17:49 夜-> 阅读(218) 评论(0) 推荐(0) 编辑
  2013年5月21日
摘要: http://codeforces.com/contest/305/problem/D虽然给的是一颗树,其实跟树没有任何关系,仔细想一下就会发现是个数学题还是要缕清楚思路 然后再写代码:#include<iostream>#include<cstdio>#include<cstring>#include<string>#include<algorithm>#include<cmath>#include<vector>#define ll long longusing namespace std;const in 阅读全文
posted @ 2013-05-21 18:35 夜-> 阅读(214) 评论(0) 推荐(0) 编辑
  2013年5月10日
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3634最开始想复杂了 后来静下心来一想 原来很简单 主要还是要缕清思路代码:#include<iostream>#include<cstdio>#include<cstring>#include<string>#include<algorithm>#include<cmath>#define ll long longusing namespace std;const int N=105;const ll MOD = 1000000007; 阅读全文
posted @ 2013-05-10 17:27 夜-> 阅读(156) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3632还是做题爽kill[l][r] 表示通过一定策略 l 是否可以把 l -- r 之间的其他所以人都淘汰掉代码:#include<iostream>#include<cstdio>#include<cstring>#include<string>#include<algorithm>#include<cmath>#define ll long longusing namespace std;const int N=105;//cons 阅读全文
posted @ 2013-05-10 16:54 夜-> 阅读(172) 评论(0) 推荐(0) 编辑
  2013年5月3日
摘要: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1319这题给人的第一感觉就是最长上升子序列,按S排序,对B进行求解最长上升子序列,但是N太大o(n^2)肯定不行,所以要用优化,我是用了线段数进行优化。不是经常用类,这次用了一下,还是有很多小问题的,如果在函数内部静态申请一个局部变量对象由于对象内有很大的数组,这样就相当于在函数所占用的栈区内申请了很大数组,没有语法错误,但c++是不允许它执行的换成从堆区申请就好了,不过要记得delete否则会超内存DP思想+线段树优化代码:#include<iostream># 阅读全文
posted @ 2013-05-03 07:26 夜-> 阅读(243) 评论(0) 推荐(0) 编辑
  2013年5月2日
摘要: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1318推荐解题报告:http://www.cppblog.com/Yuan/archive/2010/05/02/114163.html自己对几何题目是一窍不通呀,尤其是精度问题 狂晕,这题也是看了别人的解析思路,把人所在位置移动到原点,其他点也移动相应位置,然后把人的船当成点,这样的话其他岛屿的半径统一加上船的半径就可以了然后相交的岛屿连线,看能不能有一个多边形把原点包起来判别方法,根据点积求角度,根据叉积求正负,然后看有没有负环更新时dist[i][j]>dist[ 阅读全文
posted @ 2013-05-02 18:37 夜-> 阅读(218) 评论(0) 推荐(0) 编辑
  2013年4月26日
摘要: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1317简单的矩阵连乘 要用到大整数 所以用java代码:import java.math.BigInteger;import java.util.Scanner;public class Main { /** * @param args */ public static int M=(1<<5); public static int [][] ma = new int[M][M]; public static int [][] mb = new int... 阅读全文
posted @ 2013-04-26 18:21 夜-> 阅读(272) 评论(0) 推荐(0) 编辑
  2013年4月24日
摘要: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1316水!!!代码:#include<iostream>#include<cstdio>#include<cstring>#include<string>#include<algorithm>#include<cmath>#define ll long longusing namespace std;const int N=200005;const ll MOD = 1000000007;ll a[N]; 阅读全文
posted @ 2013-04-24 17:21 夜-> 阅读(221) 评论(0) 推荐(0) 编辑
摘要: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1315简单的树型DP 代码:#include<iostream>#include<cstdio>#include<cstring>#include<string>#include<algorithm>#include<cmath>#include<map>#include<set>#include<vector>#include<stack>#include 阅读全文
posted @ 2013-04-24 16:52 夜-> 阅读(241) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 48 下一页