雕刻时光

just do it……nothing impossible
随笔 - 547, 文章 - 0, 评论 - 82, 阅读 - 86万
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

04 2012 档案

摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4217View Code #include<stdio.h>struct data{ int l,r; int sum;}node[1962144];void build(int ll,int rr,int n){ node[n].l=ll; node[n].r=rr; node[n].sum=rr-ll+1; if(ll==rr)return ; int mid=(ll+rr)>>1; build(ll,mid,n+n); build(mid+1,rr,... 阅读全文

posted @ 2012-04-21 21:13 huhuuu 阅读(155) 评论(0) 推荐(0) 编辑

摘要:http://acm.hdu.edu.cn/showproblem.php?pid=3549View Code #include<stdio.h>#include<iostream>#include<algorithm>using namespace std;typedef struct {int v,next,val;} edge;const int MAXN=20010;const int MAXM=500010; edge e[MAXM];int p[MAXN],eid; inline void init(){memset(p,-1,sizeof(p) 阅读全文

posted @ 2012-04-10 18:27 huhuuu 阅读(582) 评论(0) 推荐(0) 编辑

摘要:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3497//最后判断从(1,1)开始如果走p步,只能到终点,则True//如果p步还可以到其他点,则Maybe//如果p步不能到终点,则False注意n==m==1的情况矩阵乘法每次乘都要将矩阵最后一行赋值0,因为到达终点了就不能在出来了View Code #include<stdio.h>#include<string.h>struct data{ int map[30][30];};data res;int n,as[30],ha1[1000]; 阅读全文

posted @ 2012-04-09 20:11 huhuuu 阅读(391) 评论(0) 推荐(0) 编辑

摘要:http://www.bnuoj.com/bnuoj/problem_show.php?pid=10787下电影的时间所用最少是多少做法:贪心每部电影全速下载所需要的时间的最大值和所有电影同时满速下载的时间,两者取大View Code #include<stdio.h>long long gcd(long long a,long long b){ if (b==0) return a; else return gcd(b,a%b);}int main(){ long long n,m; while(scanf("%lld%lld",&n,&m)! 阅读全文

posted @ 2012-04-08 22:24 huhuuu 阅读(232) 评论(0) 推荐(0) 编辑

摘要:http://poj.org/problem?id=2230vectorView Code #include<iostream>#include<vector>using namespace std;vector<int>map[10009];void init(int n){ int i; for(i=1;i<=n;i++) map[i].clear();}void find(int now){ int i; for(i=1;i<=map[now].size();i++) { while(map[now][i-1]!=0){ ... 阅读全文

posted @ 2012-04-06 21:56 huhuuu 阅读(329) 评论(0) 推荐(0) 编辑

摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4192这道题A的好辛苦啊!!!易错点:开始时 a,b当做个位数在考虑2 42 93 11(a-b)就会错,哎思维不严密啊!!!View Code #include<iostream>#include<algorithm>#include<cstring>#include<string>#include<cmath>#include<cstdio>#include<cstdlib>#include<map>using 阅读全文

posted @ 2012-04-06 20:23 huhuuu 阅读(502) 评论(0) 推荐(0) 编辑

摘要:http://acm.hdu.edu.cn/showproblem.php?pid=3739建图用LIS处理数字10 10 20 1 2 2 ->>dp :1 1 2 1 1 2 MAX=2每个点拆做两个点建图 s 连所有dp为1的点前驱(i)汇点t连所有dp为max的点后驱(i+n)点与点的关系如果点 i与点j(i<j) dp[i]+1== [j]&&s[i]<s[j]则点i前驱与点j后驱建立容量为1的容量网络最小割OKView Code #include<iostream>#include<cmath>#include< 阅读全文

posted @ 2012-04-05 20:18 huhuuu 阅读(284) 评论(0) 推荐(0) 编辑

摘要:View Code [cpp] view plaincopy//适用于正整数 template <class T> inline void scan_d(T &ret) { char c; ret=0; while((c=getchar())<'0'||c>'9'); while(c>='0'&&c<='9') ret=ret*10+(c-'0'),c=getchar(); } ②[cpp] view plaincopy//适用于正负整数 template 阅读全文

posted @ 2012-04-04 19:38 huhuuu 阅读(329) 评论(0) 推荐(0) 编辑

摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1237不用栈的形式View Code #include<stdio.h>#include<stack>#include<string.h>#include<iostream>using namespace std;char s[209];double num[209];char fu[209];int main(){ while(gets(s)) { if(s[0]=='0'&&strlen(s)==1) return 0; me 阅读全文

posted @ 2012-04-02 20:53 huhuuu 阅读(211) 评论(0) 推荐(0) 编辑

摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4195组成多边形的边最小为多少1。先找三角形的垂心(注意线段垂直的情况)2。以垂心画圆YY,这个三角形可以把这个圆分成多少弧度(注意钝角三角形的第三边所对应的边的弧度为 2*PI的补数)3。接着枚举最小弧度的 n分之几,是否可以把其它弧度近似整除(如1801可以近似整除600)控制精度!!!View Code #include<stdio.h>#include<string.h>#include<math.h>#include<iostream>using na 阅读全文

posted @ 2012-04-02 18:59 huhuuu 阅读(423) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示