- 博客(19)
- 资源 (1)
- 收藏
- 关注
原创 LightOJ 1407 - Explosion(2sat+枚举)
题意: 参加一个会议:其中的某些人参加不参加,有如下关系: 1 x y 表示两人两个人至少去一个; 2 x y 表示x 不去,y也不能去>>>>>>>>>>>>>可以推出 y去了x也肯定去了。。。错了n次, 无语了。 3 x y 表示两个人至少一个不去 4 x y 表示两个人只能去一个,不能少 1 x y z 三个人至少去一个 2 x y z 三个人至少一个不去
2012-11-27 12:55:58 1020
原创 Lightoj 1063 - Ant Hills
题意:求最小割为1的割点的数量。 第一次做这样的题 ,不会做啊,,做了这道题我才发现我连最基本的图论都不会。这水平,太水了。 #include #include #include #include #include #include #include using namespace std; const int N = 10009; const int M = 20009;
2012-11-25 21:08:12 680
原创 HDU 4445 Crazy Tank(枚举角度)
#include #include #include #include #include #include #include using namespace std; double h,l1,l2,r1,r2; const double PI = acos(-1.0); int n; double sp[209]; void input() { scanf("%lf%lf%l
2012-11-14 20:10:04 688
原创 HDU 4444 Walk(2012金华,搜索)
题意:问最少拐多少次弯可以从起点到终点。。 好难啊 ,可以从边界上经过的。第一次做这样的题。。。。 思路:把一个点拆成4个点。看每一个点的所有走法。 第一次画图,莫笑 #include #include #include #include #include #include #include #include using namespace std; c
2012-11-14 17:57:47 1878
原创 群赛11.10 A Very Easy Triangle Counting Game
Problem G: A Very Easy Triangle Counting Game Time Limit: 1 Sec Memory Limit: 128 MB Submit: 80 Solved: 31 [Submit][Status][Web Board] Description Input Output Sampl
2012-11-11 12:48:58 769
原创 ACdream 群赛11.10 Problem J: I can't describe the problem
Problem J: I can't describe the problem Time Limit: 10 Sec Memory Limit: 128 MB Submit: 38 Solved: 5 [Submit][Status][Web Board] Description Input Output Sample Inpu
2012-11-11 12:44:53 1040
原创 LightOJ 1026 - Critical Links (tarjan 找桥)
题意:找出所有的桥,并输出。 水题,中午肚子痛,查不出错了,晚上一看,tarjan写错了!!!! #include #include #include #include #include #include #include using namespace std; const int N = 10009; const int M = 100009; struct LT{
2012-11-09 22:46:48 1071
原创 LightOJ 1099 - Not the Best(Dijkstra次短路)
题意:求从1到n的次短路。 dijkstra,写了好久啊,太水了。。 #include #include #include #include #include #include #include using namespace std; const int INF = 0x3f3f3f3f; const int N = 5009; const int M = 100009; in
2012-11-07 12:22:09 1200
原创 LightOJ 1221 - Travel Company(SPFA判负环)
比较简单: #include #include #include #include #include #include #include using namespace std; const int M = 9999; const int N = 109; const int INF = 0x3f3f3f3f; struct LT{ int to,nex,val; }L[M
2012-11-06 22:54:43 1072 1
原创 LightOJ 1108 - Instant View of Big Bang(SPFA)
题意:跟上题一样,这题求哪些点可以进入负环。 思路:突然间想到把每一条边的方向改变一下就跟上题一模一样了,“看我,多聪明”。。 #include #include #include #include #include #include #include using namespace std; const int N = 1009; const int M = 2009;
2012-11-06 16:42:44 970
原创 LightOJ 1074 - Extended Traffic (SPFA负环)
题意:有n个城市,每一个城市有一个拥挤度ai,从一个城市I到另一个城市J的时间为:(aJ-aI)^3,存在负环。问从第一个城市到达第k个城市所话的时间,如果不能到达,或者时间小于3输出?否则输出所花的时间。。 思路:用spfa找出的所有的负环,把所有负环能到的点都标记一下。。 #include #include #include #include #include #incl
2012-11-06 11:04:45 1664
原创 LightOJ 1363 - Binary Matrix (II)
题意:给定一个矩阵,可以相邻的行或列交换一个元素。首尾也算相邻。最小交换多少次。可以使每行梅列的1的个数相同。或每一行的1的数量一样多。或每一列一样多。 #include #include #include #include #include #include #include using namespace std; const int N = 1009; const int I
2012-11-05 18:02:26 964 2
原创 HDU 4435 charge-station(天津现场赛)
比赛的时候没有做出来,没有想到解法啊,,回来之后。侯哥提醒一下。明白了。。Orz。。。 #include #include #include #include #include #include #include using namespace std; int n,d; const int N = 159; struct cpoint{ int x,y;
2012-11-05 15:40:58 750
原创 lightOJ 1251 - Forming the Council(2-sat)
题意:n个人参与投票,被选的人有m个,每一个人都有两个选择:让某个人当选,让某个人下台。。问是否存在一个方式,能够每一个选民的至少一个选择。 思路:如果一个人的第一个选择没有被满足,则另一个选择一定要被满足、 #include #include #include #include #include #include #include using namespace std
2012-11-04 18:28:37 760
原创 lightOJ 1396 - Palindromic Numbers (III)(回文数)
题意:找出比给定数大一点点的回文数; #include #include #include #include #include #include #include using namespace std; int a[100005],b[100005]; char ch[100005]; bool judge(int len) { for(int i=0;i<len
2012-11-04 12:36:20 890
原创 POJ 2699 The Maximum Number of Strong Kings(最大流)
题意:n个人比赛,得分最高的算赢了,打败了所有比自己高的分的人也算赢了,问最多有多少人赢了。。 网络流:人数很少。把每一场比赛都看作一个点。建建图;枚举答案就行了。 恶心的输入啊。。输入的每一行后面还可能有空格。再codeblocks中直接把后面的空格去掉了。。tle,wa了n多次。。。 #include #include #include #include #inclu
2012-11-03 16:50:53 959
原创 POJ 2451 Uyuw's Concert(半平面交)
这题没有模版真的写不出代码来。于是可耻的找了一份代码修改一下成了模版。。 #include #include #include #include #include #include #include using namespace std; #define EPS 1e-10 #define inf 10000 #define zero(a) fabs(a)<EPS #d
2012-11-02 21:08:18 762
原创 POJ 1279 Art Gallery(半平面交)
题意:求多边形核的面积; 思路:求所有的核心,再求凸包,在求面积。。。没用半平面交的模版。数据水了。 #include #include #include #include #include #include #include #include using namespace std; double const INF = 1e20; double const EPS
2012-11-01 21:44:49 549
原创 POJ 3130 How I Mathematician Wonder What You Are!
题意:同poj3335 只是顺序不同。。。 #include #include #include #include #include #include #include using namespace std; const double INF = 1e20; const double EPS = 1e-8; bool zero(double t){return -EPS<t&&
2012-11-01 19:24:08 427
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人