自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Sooowhat

step further

  • 博客(25)
  • 收藏
  • 关注

原创 poj 2886 (线段树 统计左右各有多少个节点.)

什么是反素数..#include#define N 5000006#includeusing namespace std;int div_num[N];int max_id[N];char name[N][12];int n_person; int s_id;i

2011-09-03 09:45:59 555

原创 线段树

//21:38 started#include#include#includeusing namespace std;int L,T,O;#define N 100005struct Node{ int l,r; int mid; in

2011-09-03 09:36:53 253

原创 约瑟夫

一直都在取模的地方很混乱 比如 7个人  m=4 的约瑟夫问题     要把7 个人标号从0-6;  即0 1 2 3 4 5 6 . 取m 应该取下标为 (0+4-1)%7=3;    把 p[3]去掉后  第二次取 下标应该为  (3+4-1)%7;  应该这样理解 (x

2011-09-03 09:35:06 329

原创 poj 1276 多重背包..

#include#include#include#define N 23int dp();using namespace std;int cash;int n_kind;int c[N];int num[N];#define M 300000int pro

2011-09-03 09:30:47 389

原创 2-SAT 入门题 party

#include#include#define N 2004#include#includeusing namespace std;int n,m;vector g[N];int low[N]; int dfn[N]; int stack[N]; bool in

2011-09-03 09:24:14 327

原创 poj 3207 2-sat

#include#include#include#includeusing namespace std;int n_point;int n_line;#define N 1005struct Point{ int x,y;};Point point[

2011-09-03 09:19:41 315

原创 poj 2749 看的题解...

#include#include#include#include#define N 1003#include#includeusing namespace std;int n_barn, n_hate, n_friend; int len;int stack[2

2011-08-22 13:31:14 431

原创 卡特兰数

http://www.cnblogs.com/MiYu/archive/2010/08/18/1802488.html

2011-08-12 21:41:33 799

原创 NO2 两个贪心问题 (2th day)

ACM steps 做完chapter one.  有两题是看网上的题解,有些惭愧,ps:参加集训的有些大一的都会。    Tian Ji -- The Horse Racing      Crixalis's Equipment 关于他们的题解,网上有,我也就不

2011-08-06 21:35:41 360

原创 hdu 1313 (Java)

刚刚学Java  A了一题  代码贴上来,写的不够规范。。import java.math.*;import java.util.Scanner;import java.io.*;public class Main{ public static void m

2011-08-02 22:44:06 986

原创 刚刚开始接触java 一些copy的总结

http://mingchaoyan.blogbus.com/c3479685/这个blog里面关于java在ACM里面的应用总结了几点,对于以应付ACM的简单问题的人来说应该就足够了,自己也是刚刚才接触java,今后如果有一些好的总结就写在下面把:———————

2011-08-02 20:45:26 368

原创 poj 1364 KING (差分约束系统)

前两天看了算法导论 这方面的东西 刚刚在网上搜了一道这方面的题 自己就是懒 懒得思考 懒得调试 或许不是经过那次打击自己真的认识不到这一点  独立思考的重要性,不过现在惰性又来了 ,还是要牢骚牢骚以后不应该这样了,每次wa了之后 就想拿别人的代码对比一下 看错在哪里 没有独自分析问题的能力,到了实战的时候 WA一次 自己就没辙了....总之 刚刚还想怎么判断零环 呢   实际上不用

2011-06-12 19:16:00 390

原创 poj 1190 生日蛋糕 dfs 剪枝

什么都不说了 貌似别人分类是简单题..自己照着别人的代码写的  自己写的tle了  简单的剪枝 效果这么明显...................  开始自己还求了j的下限 结果还不如不求了 直接j>=depth的效果要好很多 #include#include#include#includeusing namespace std;#define INF 999999

2011-06-12 14:31:00 449

原创 求两圆交点坐标

大概也可以说成是解二元二次方程组.是从...网站上copy的:The following note describes how to find the intersection point(s) between two circles on a plane, the following notation is used. The aim is to find the two point

2011-06-11 23:22:00 4174 1

原创 算法导论 24-2

24-4 嵌套框 也就是求有向图无环图的最长路径 We consider d-dimensional boxes.a. The nesting relation is clearly transitive.b. We can determine if a box nests within another by sorting the dimensions of each box and

2011-06-11 20:53:00 1893

原创 Clock (几何题)

题意是 在一个矩形内,有多个圆,求还能放下的最大的一个圆的半径.这个圆不能与原有的重叠.二分法枚举半径r,对于每个半径为r的圆枚举3种情况,圆在四个角落,圆与一个圆和一边相切,圆与2个圆相切 得到坐标x,y这个位于x,y的半径为r的圆不能与其他的圆相交...最终找到符合要求的最大的圆... 官方的题解:◮ Binary search on the radius of t

2011-06-10 22:40:00 631

原创 算法导论 稀疏图的最小生成树 p(353)

     自己就是没有耐心看.....       说说浅显的理解,MST-REDUCE的预处理,对每一个节点u,如果u没有在任何集合中,就找到边E(u,v),其中w(u,v)是最小的,也就是找到与u连接的最短的一条边,把u和v加入到一个集合中,也就是收缩了边u-v,把两个点合并成一个点,这样处理每一个点,最终就形成了新的点集,当然,前面收缩掉的边肯定是在最小生成树中的边,这和kr

2011-06-09 14:27:00 2550

原创 poj 1077 Eight (bfs A* IDA*)

第一次写A*算法 写的有点晕,思路还是很明显很清晰的 就是处理起来有些麻烦 ,自己写了一个堆,可以说是优先队列,网上也有看到用STL的priority_queue的 以后研究下.今天写了一天,毕竟第一次接触A*算法,第一次写,算是我的处女作,不过结果没让我失望 1A了,结果16Ms 还挺快,提交第二次就成0ms了,这就看运气. F=G+H, 就是A*算法的精华所在了 每次都取F最小的,这样是最

2011-06-06 21:07:00 700

转载 priority_queue

今天在写堆和哈夫曼树的ACM题的时候,接触到priority_queue的用法,由于比较函数的难些,请教过队内的红薯和杨大牛后才稍微弄明白些,下面总结如下,首先我是用手写的堆来过题的,其实和照黑书指导上的那个堆的代码差不多。    写完之后就看了下STL里面的priority_queue的用法就开始研究,首先是用了网上找的一个写比较函数的方法是用操作符重载做的。代码如下: //比较函数对于结构体s

2011-06-06 12:11:00 386

原创 zoj 1010 Area (求面积 叉积)

 Jerry, a middle school student, addicts himself to mathematical research. Maybe the problems he has thought are really too easy to an expert. But as an amateur, especially as a 15-year-old boy, he ha

2011-06-05 17:53:00 829

原创 zoj 1009 Enigma (模拟)

原题In World War II, Germany once used an electronic encryption machine called Enigma, which played a decisive role in the initial victories of Nazi Germany. It was proved to be one of the most reliab

2011-06-05 16:48:00 147

原创 zoj 1004 Anagrams by Stack (回溯)

开始觉得无从下手啊 毕竟自己是个菜鸟....用递归,回溯法程序写的有点乱,主要是变量命名时没有什么规则,让人看不懂,自己也懒得修改了, 注释也有点不清楚......原题:How can anagrams result from sequences of stack operations? There are two sequences of stack operators whic

2011-06-03 10:13:00 366

原创 次小生成树

<br />原题就是输入所有 i 到j 的距离  求最小生成树 和次小生成树 自己手写的:<br />prim 算法 :  不知道kruskal算法应该怎么实现得好<br />#include<iostream>#include<cstring>#include<cstdio>#include<vector>using namespace std;#define INF 999999999int n_village;#define N 1003int dist[N][N];

2011-06-02 22:47:00 237

原创 zoj 1005 Jugs

  广搜 就是往桶里倒水 每次都有六种方案   写的有一点小麻烦  可以把重复的东西弄成函数的  In the movie "Die Hard 3", Bruce Willis and Samuel L. Jackson were confronted with the following puzzle. They were given a 3-gallon jug and a 5-gallon jug and were asked to fill the 5-gallon jug with exactly

2011-06-01 20:40:00 307

原创 zoj 1003 Crashing Balloon

      自己的水平还是不够,这题想了好久也没有想出该怎么做,最后google了 看了一下别人的标题 dfs,这才想着怎么用dfs求解.  代码是自己写的 ...以后还要锻炼独立思考能力:On every June 1st, the Children's Day, there will be a game named "crashing balloon" on TV. The rule is very simple. On the ground there are 100 labeled balloons

2011-06-01 18:26:00 335

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除