摘要: 一、使用display的inline属性1 AAAA 2 BBBB二、通过设置float来让Div并排显示1 4 5 1111 6 2222 2222 2222 7 8 9 三、对于两个div并排,左边为绝对宽度,右边为相对宽... 阅读全文
posted @ 2015-01-05 11:57 SCAU_Xxm 阅读(184) 评论(0) 推荐(0)
摘要: 这学期选了OOAD这门课,老师布置了作业,要求写十篇技术性的博客。 其实,我原来也写过博客的。在很久以前,我参加了ACM校队,指导老师建议我们写博客记录下自己的解题思路,以达到温故而知新的作用。 最近,我翻阅了以前写的一些解题报告。另有一番风味。 我把以前的想法和思路整理了一遍,然后再加上... 阅读全文
posted @ 2014-06-12 20:40 SCAU_Xxm 阅读(229) 评论(0) 推荐(0)
摘要: Alice and Bob play the following game. A series of numbers is written on the blackboard. Alice and Bob take turns choosing one of the numbers, and rep... 阅读全文
posted @ 2013-04-17 22:23 SCAU_Xxm 阅读(179) 评论(0) 推荐(0)
摘要: You are given an R x C 2D grid consisting of several light panels. Each cell contains either a '*' or a '.'. '*' means the panel is on, and '.' means ... 阅读全文
posted @ 2013-04-14 01:42 SCAU_Xxm 阅读(466) 评论(0) 推荐(0)
摘要: 某人要在城市A买一些石头运送到城市B.给出[n,m,L,p],总共有n个城市m条双向路,此人的资产L和石头单价p.每条路[u,v,c1,c2],表示城市u和v之间有一条容量为c1的路,也可以用c2的费用使这条路的容量增加1.问最多可以买的石头数目.显然石头的个数在[0,L/p]之间,并且买的石头越多,花费越大,故可以二分枚举石头的数目,从而将最优值问题转化为可行性判定问题.对于每一次枚举的石头数目C,可以这样构图 : 建立附加源S,连边SA,容量为C,费用为p;对于原图中的每条边[u,v,c1,c2],因为通过这条边的石头数目不大于c1的话,是不收费的,而大于c1的部分,每单位石头话费c2. 阅读全文
posted @ 2013-04-04 15:02 SCAU_Xxm 阅读(215) 评论(0) 推荐(0)
摘要: 费用流,不要求流量最大,但是要获利最大,需要对费用流算法有一定理解才行。每一次寻找增广路的时候,需要SPFA一次求出各点到汇点的最短路,既最小费用。这样的话,可以建出如下的图,首先,建出原题给的图,然后,再从城市2-n中,每一个城市,都向汇点连一条边,容量为无穷大,花费为-pi。这样的话,在SPFA的时候,如果能够找到一条到达汇点的路程为负数的路径的话,才返回真,否则假,这样就保证了每条流量都是获利的,求最大流量,既最大获利。View Code 1 #include<iostream> 2 #include<cstring> 3 #include<cstdio&g 阅读全文
posted @ 2013-04-04 13:39 SCAU_Xxm 阅读(169) 评论(0) 推荐(0)
摘要: Your friend Jim has challenged you to a game. He has a bag containing red and blue marbles. There will be an odd number of marbles in the bag, and you... 阅读全文
posted @ 2013-04-04 13:11 SCAU_Xxm 阅读(253) 评论(0) 推荐(0)
摘要: 1051 - Good or BadA string is called bad if it has 3 vowels in a row, or 5 consonants in a row, or both. A string is called good if it is not bad. You... 阅读全文
posted @ 2013-04-03 22:39 SCAU_Xxm 阅读(341) 评论(0) 推荐(0)
摘要: 1120 - Rectangle UnionPDF (English)StatisticsForumTime Limit:2 second(s)Memory Limit:64 MBGiven some axis parallel rectangles, you have to find the un... 阅读全文
posted @ 2013-03-28 21:47 SCAU_Xxm 阅读(549) 评论(0) 推荐(0)
摘要: View Code 1 #include 2 #include 3 #include 4 using namespace std; 5 #define N 100010 6 #define lson l,mid,p>1 9 10 int segt[N>t;71 while(t--){72 ... 阅读全文
posted @ 2013-03-28 21:43 SCAU_Xxm 阅读(458) 评论(0) 推荐(0)