随笔分类 -  Hdu

上一页 1 2 3 4

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 阅读(243) 评论(0) 推荐(0)

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

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

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 阅读(135) 评论(0) 推荐(0)

hdu1520 树形DP
摘要:1 /* 2 * 树形DP 3 */ 4 #include 5 #include 6 #include 7 using namespace std; 8 #define Max(x,y) (x>y?x:y) 9 #define max 6000+1010 11 //dp[i][0],dp[i]... 阅读全文

posted @ 2013-07-20 13:54 Stomach_ache 阅读(120) 评论(0) 推荐(0)

HDU3486 RMQ
摘要:1 /*多么变态的一道题,交了18次*/ 2 3 4 #include 5 #include 6 #include 7 #define max(a,b) (a>b?a:b) 8 int dp[200005][20],llog2[200005];//用llog2数组进行优化 9 int n,k;... 阅读全文

posted @ 2013-07-05 18:27 Stomach_ache 阅读(160) 评论(0) 推荐(0)

HDU1950
摘要://虽然是一道LIS问题,但是还是第一次用O(n*lgn)这种算法,赶角波错哈哈哈哈。。。。至少今天有所收获#include#include#define max 40000+5int a[max],dp[max];int main(){ int t; scanf("%d",&t); while(t... 阅读全文

posted @ 2013-07-02 14:30 Stomach_ache 阅读(147) 评论(0) 推荐(0)

HDU1059
摘要:/** 母函数+优化*/#include#include#define max 20000int c1[max],c2[max];int a[7];int main(){ for(int i=1;;i++){ int sum=0; for(int j=1;j<7;j++){ scanf("... 阅读全文

posted @ 2013-06-29 17:00 Stomach_ache 阅读(102) 评论(0) 推荐(0)

HDU2056
摘要:/** 指数型母函数*/#include#define mod 100typedef long long LL;//杭电需用int64int powerMod(int a,LL b){ LL ans=1; while(b){ if(b%2){ ans=(ans*a)%mod; } a=(... 阅读全文

posted @ 2013-06-29 16:58 Stomach_ache 阅读(103) 评论(0) 推荐(0)

HDU1709
摘要:/** 好奇怪的母函数*/#include#include#include#includeusing namespace std;#define max 100*100+10int c1[max],c2[max],a[max];int main(){ int n; while(~scanf("%d... 阅读全文

posted @ 2013-06-29 16:52 Stomach_ache 阅读(111) 评论(0) 推荐(0)

HDU2699 扩展欧几里德
摘要://赤裸裸,不解释#includetypedef long long LL; //hdu需用int64void gcd(int a,int b,LL& d,LL& x,LL& y){ if(!b){ d=a;x=1;y=0; } else{ gcd(b,a%b,d,y,x); y-=x*(a/... 阅读全文

posted @ 2013-06-26 13:01 Stomach_ache 阅读(125) 评论(0) 推荐(0)

HDU4355 三分查找
摘要:/** 三分查找*/#include#include#define eps 1e-6//typedef __int64 LL;int n;double x[50005], w[50005];double func(double y){ double res=0; for(int i=0;ieps)... 阅读全文

posted @ 2013-06-25 17:32 Stomach_ache 阅读(121) 评论(0) 推荐(0)

HDU4004 二分答案
摘要:第一道二分答案。。。今天看了大牛的博客,突然发现有个叫“二分枚举答案”的方法好像很牛,于是便搜了些资料。。发现并不是很难,可能是我了解的只是冰山一脚罢了。。。加油ACMer!!!!#include#include#includeusing namespace std;#define max 5000... 阅读全文

posted @ 2013-06-24 16:25 Stomach_ache 阅读(123) 评论(0) 推荐(0)

上一页 1 2 3 4

导航