摘要: CompromiseIn a few months the European Currency Union will become a reality. However, to join the club, the Maastricht criteria must be fulfilled, and this is not a trivial task for the countries (maybe except for Luxembourg). To enforce that Germany will fulfill the criteria, our government has so 阅读全文
posted @ 2014-02-25 21:18 ~~Snail~~ 阅读(179) 评论(0) 推荐(0) 编辑
摘要: SuperSaleThere is a SuperSale in a SuperHiperMarket. Every person can take only one object of each kind, i.e. one TV, one carrot, but for extra low price. We are going with a whole family to that SuperHiperMarket. Every person can take as many objects, as he/she can carry out from the SuperSale. We 阅读全文
posted @ 2014-02-25 21:12 ~~Snail~~ 阅读(203) 评论(0) 推荐(0) 编辑
摘要: CDYou have a long drive by car ahead. You have a tape recorder, but unfortunately your best music is on CDs. You need to have it on tapes so the problem to solve is: you have a tapeNminutes long. How to choose tracks from CD to get most out of tape space and have as short unused space as possible.As 阅读全文
posted @ 2014-02-25 21:08 ~~Snail~~ 阅读(363) 评论(0) 推荐(0) 编辑
摘要: Air RaidTime Limit:1000MSMemory Limit:10000KTotal Submissions:6275Accepted:3756DescriptionConsider a town where all the streets are one-way and each street leads from one intersection to another. It is also known that starting from an intersection and walking through town's streets you can never 阅读全文
posted @ 2014-02-25 20:57 ~~Snail~~ 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #define MAX_V 80 4 5 int V; //顶点数 6 int match[MAX_V]; //所匹配的顶点 7 bool used[MAX_V]; //DFS中用到 的访问标记 8 vector G[MAX_V]; //图的邻接表表示 9 10 //向图中增加一条边接u和v的边11 void add_edge(int u,int v)12 {13 G[u].push_back(v);14 G[v].push_ba... 阅读全文
posted @ 2014-02-25 09:34 ~~Snail~~ 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 #define INF 0x7fffffff 6 #define MAX_V 210 7 8 using namespace std; 9 10 //用于表示边的结构体11 struct edge12 {13 int to; //终点14 int cap; //容量15 int rev; //反向边16 };17 18 int m,n;19 int iter[MAX_V]; //顶点到源咪的距离标号20 int level[MAX_V]; ... 阅读全文
posted @ 2014-02-25 09:28 ~~Snail~~ 阅读(180) 评论(0) 推荐(0) 编辑
摘要: Dividing coinsIt's commonly known that the Dutch have invented copper-wire. Two Dutch men were fighting over a nickel, which was made of copper. They were both so eager to get it and the fighting was so fierce, they stretched the coin to great length and thus created copper-wire.Not commonly kno 阅读全文
posted @ 2014-02-25 09:16 ~~Snail~~ 阅读(294) 评论(0) 推荐(0) 编辑
摘要: Optimal Array Multiplication SequenceGiven two arraysAandB, we can determine the arrayC=ABusing the standard definition of matrix multiplication:The number of columns in theAarray must be the same as the number of rows in theBarray. Notationally, let's say thatrows(A) andcolumns(A) are the numbe 阅读全文
posted @ 2014-02-25 07:48 ~~Snail~~ 阅读(191) 评论(0) 推荐(0) 编辑
摘要: Let Me Count The WaysAfter making a purchase at a large department store, Mel's change was 17 cents. He received 1 dime, 1 nickel, and 2 pennies. Later that day, he was shopping at a convenience store. Again his change was 17 cents. This time he received 2 nickels and 7 pennies. He began to wond 阅读全文
posted @ 2014-02-25 07:35 ~~Snail~~ 阅读(231) 评论(0) 推荐(0) 编辑
摘要: Goldbach's ConjectureIn 1742, Christian Goldbach, a German amateur mathematician, sent a letter to Leonhard Euler in which he made the following conjecture:Every number greater than 2 can be written as the sum of three prime numbers.Goldbach cwas considering 1 as a primer number, a convention th 阅读全文
posted @ 2014-02-25 07:27 ~~Snail~~ 阅读(209) 评论(0) 推荐(0) 编辑
摘要: Error CorrectionA boolean matrix has theparity propertywhen each row and each column has an even sum, i.e. contains an even number of bits which are set. Here's a 4 x 4 matrix which has the parity property:1 0 1 00 0 0 01 1 1 10 1 0 1The sums of the rows are 2, 0, 4 and 2. The sums of the column 阅读全文
posted @ 2014-02-25 07:21 ~~Snail~~ 阅读(294) 评论(0) 推荐(0) 编辑