摘要: 五段记录...以后不知道什么时候才能再次玩一下。。。 阅读全文
posted @ 2013-07-13 23:52 舞步い嫣语逝爱醉灵魂 阅读(105) 评论(0) 推荐(0)
摘要: 题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4888题目大意:给你n根蜡烛,一圈一圈围起来,中心可放可不放,总r*k的最小值是多少,有多个相等的时候取r较小的那个.坑死人的二分有木有,我很想看看此題的全部测试数据,我wa在哪组。AC代码:AC代码 1 #include<cstdio> 2 #include<cmath> 3 4 typedef long long LL; 5 6 LL n,num_r; 7 //n:输入的n,num_r:r的循环. 8 9 LL deal(LL x){10 阅读全文
posted @ 2012-10-17 20:11 舞步い嫣语逝爱醉灵魂 阅读(170) 评论(2) 推荐(0)
摘要: 给你一些骨牌。。看能不能一笔走完~赤裸裸的欧拉~代码:SGU101 1 #include<cstdio> 2 #include<cstring> 3 4 const int maxn=110; 5 6 struct Edge{ 7 int to,next; 8 }; 9 Edge edge[maxn],tol[maxn];10 int Map[10][10];11 int etot;12 int exist[10];13 14 void Eular_dfs(int idx){15 for(int i=0;i<7;i++){16 if(Map[idx][i])... 阅读全文
posted @ 2012-10-02 09:33 舞步い嫣语逝爱醉灵魂 阅读(262) 评论(0) 推荐(0)
摘要: 题目链接:http://poj.org/problem?id=1386这题主要是欧拉思想,有向图,出度与入度之间的恩怨。。。有兴趣自行搜之~代码:pku 1386 1 #include<cstdio> 2 #include<cstring> 3 4 int root[30]; 5 char str[1010]; 6 int In[30],Out[30];//入度与出度 7 8 void Init(){ 9 memset(In,0,sizeof(In));10 memset(Out,0,sizeof(Out));11 for(int i=0;i<30;i++) ro 阅读全文
posted @ 2012-09-20 23:11 舞步い嫣语逝爱醉灵魂 阅读(136) 评论(0) 推荐(0)
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4288【list】【vector】今天都是现学现用- -。结果还是差一点点才AC,。太囧了- -。他们都用线段树,几百行的高端代码,看不懂,我也肿么都看不出来是用线段树搞,然后就想到STL。开始用了list,TLE了,后来打定vector。但没想到add的时候也要用二分,RE到哭呀,- -。代码:View Code 1 #include<cstdio> 2 #include<cstring> 3 #include<vector> 4 #include<alg 阅读全文
posted @ 2012-09-16 23:28 舞步い嫣语逝爱醉灵魂 阅读(177) 评论(0) 推荐(0)