2013年8月10日

HDU 4585

摘要: 1 //也是个水题,不过以前没用过set。。。。所以逼着我去学。 2 3 4 5 #include 6 #include 7 #include 8 #include 9 #include10 #include11 #include12 using namespace std;13 14 se... 阅读全文

posted @ 2013-08-10 20:01 Stomach_ache 阅读(119) 评论(0) 推荐(0) 编辑

HDU 4584

摘要: 1 //也是简单题,因为n太小,故暴力之! 2 3 4 #include 5 #include 6 #include 7 #define max 45 8 9 char map[max][max];10 11 int dis(int x1,int y1,int x2,int y2){12 ... 阅读全文

posted @ 2013-08-10 20:00 Stomach_ache 阅读(114) 评论(0) 推荐(0) 编辑

HDU 4576 Robot

摘要: //题目并不算难,但是特么的就是坑死你。。。//用数组a[]维护每轮的结果,a[i]就是代表走到i的概率。。。还需借助辅助数组q[]。#include#include#define max 205int n,m,l,r;double q[max],a[max];int main(){ while(s... 阅读全文

posted @ 2013-08-10 19:58 Stomach_ache 阅读(107) 评论(0) 推荐(0) 编辑

2013年8月8日

HDU 3714

摘要: 1 最大值最小问题,三分。。。。竟然排第六当时。。。。。 2 #include 3 4 #include 5 #define max 10000+10 6 #define Max(x,y) (x>y?x:y) 7 #define Min(x,y) (xinf){35 do... 阅读全文

posted @ 2013-08-08 20:02 Stomach_ache 阅读(200) 评论(0) 推荐(0) 编辑

POJ 1011

摘要: 做了这题,才知道剪枝的厉害。。。正要的剪枝:如果当前木棍能恰好填满一根原始木棍,但因剩余的木棍无法组合出合法解而返回,那么让我们考虑接下来的两种策略,一是用更长的木棍来代替当前木棍,显然这样总长度会超过原始木棍的长度,违法。二是用更短的木棍组合来代替这根木棍,他们的总长恰好是当前木棍的长度,但是由于... 阅读全文

posted @ 2013-08-08 18:48 Stomach_ache 阅读(146) 评论(0) 推荐(0) 编辑

2013年8月6日

hdu 1505 && hdu1506 &&hdu 2830 && 2870 总结---------DP之状图选最大矩形

摘要: /*多谢了“闭眼,睁眼” 同学给我一套dp专题,不然真是没接触过这种题型。做个4个简单的,很高兴有所收获。2013-08-06/*HDU 1506最基础的一道题目,其主要精髓就在于两个数组 l[i],r[i];其中,l[i]用来存储第i个矩形的左边界,r[i]存储的是第i个矩形的右边界,也就是说对于... 阅读全文

posted @ 2013-08-06 19:06 Stomach_ache 阅读(231) 评论(0) 推荐(0) 编辑

2013年8月4日

hdu 1058

摘要: 通过此题有两个收获:第一-----------------序数词的正确拼写。第二----------------学会了map的基本使用方法。 ------------------------------------------------------------------------------... 阅读全文

posted @ 2013-08-04 20:59 Stomach_ache 阅读(137) 评论(0) 推荐(0) 编辑

2013年7月31日

HDU 3415 单调队列

摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 #define max 100000+10 6 7 int a[max],sum[(max q;10 11 void inq(int i){12 while(!q.empt... 阅读全文

posted @ 2013-07-31 16:27 Stomach_ache 阅读(125) 评论(0) 推荐(0) 编辑

2013年7月26日

Ubuntu下安装Libpcap

摘要: Libpcap是 Unix/Linux 平台下的网络数据捕获函数包,百度百科是这么说的,唉,不管什么来头,只要帮我完成作业就行,安装过程记录如下:还是那个套路,先在网上搜了一把,大概也就那样,被疯狂转载的方法。首先安装gcc编译器,这个早就装好了,然后由于Libpcap有一些依赖包,所以在安装Li... 阅读全文

posted @ 2013-07-26 10:38 Stomach_ache 阅读(436) 评论(0) 推荐(0) 编辑

2013年7月25日

Hamming Codes

摘要: /*ID: weitong4LANG: C++TASK: hamming*/#include#include#define max 64int ans[max+5];int N,B,D;bool ham_dis(int x,int y){ int cnt=0; for(int i=0;i>=1; ... 阅读全文

posted @ 2013-07-25 21:05 Stomach_ache 阅读(186) 评论(0) 推荐(0) 编辑

导航