上一页 1 2 3 4 5 6 7 ··· 9 下一页

2012年11月12日

codeforce 11 11 A B

摘要: A. Heads or Tailstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPetya and Vasya are tossing a coin. Their friend Valera is appointed as a judge. The game is very simple. First Vasya tosses a coin x times, then Petya tosses a coin y times. If the 阅读全文

posted @ 2012-11-12 17:25 yumao 阅读(319) 评论(0) 推荐(0)

2012年11月10日

usaco 1.1 Trasformations

摘要: TransformationsA square pattern of size N x N (1 <= N <= 10) black and white square tiles is transformed into another square pattern. Write a program that will recognize the minimum transformation that has been applied to the original pattern given the following list of possible transformation 阅读全文

posted @ 2012-11-10 22:44 yumao 阅读(182) 评论(0) 推荐(0)

2012年11月8日

usaco 1.1 Miking Cows

摘要: Milking CowsThree farmers rise at 5 am each morning and head for the barn to milk three cows. The first farmer begins milking his cow at time 300 (measured in seconds after 5 am) and ends at time 1000. The second farmer begins at time 700 and ends at time 1200. The third farmer begins at time 1500 a 阅读全文

posted @ 2012-11-08 19:13 yumao 阅读(158) 评论(0) 推荐(0)

2012年11月7日

usaco 1.1 Broken Necklace

摘要: Broken NecklaceYou have a necklace of N red, white, or blue beads (3<=N<=350) some of which are red, others blue, and others white, arranged at random. Here are two examples for n=29: 1 2 1 2 r b b r b r r b r... 阅读全文

posted @ 2012-11-07 18:14 yumao 阅读(716) 评论(0) 推荐(0)

2012年11月6日

最大流模板 Ford-Fulkerson and Dinic

摘要: 自己码的哟~Ford-Fulkerson: 算法: 用cup[][]记录流量; 一开始就用初始的图做残流网络 用BFS找到一条最短的从起点到终点的路径,并用a[]记录且标记这条路径上的最小流量 更新残流网络图,正向的减去最小流量,反向的加上最小流量; 累加最小流量做总和;循环以上的操作,直到BFS到不了终点为止。代码:View Code 1 #include<iostream> 2 using namespace std; 3 #define INF 100000000 4 int cup[205][205]; 5 int a[205]; 6 int fa[205]; 7 int 阅读全文

posted @ 2012-11-06 19:19 yumao 阅读(344) 评论(0) 推荐(0)

2012年11月5日

codeforce 11 04 A

摘要: A. Two Bags of Potatoestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputValera had two bags of potatoes, the first of these bags contains x (x ≥ 1) potatoes, and the second — y (y ≥ 1) potatoes. Valera — very scattered boy, so the first bag of pota 阅读全文

posted @ 2012-11-05 11:41 yumao 阅读(203) 评论(0) 推荐(0)

2012年11月2日

Contest on codeforce A

摘要: A. Old Peykantime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n cities in the country where the Old Peykan lives. These cities are located on a straight line, we'll denote them from left to right as c1, c2, ..., cn. The Old Peykan wa 阅读全文

posted @ 2012-11-02 22:09 yumao 阅读(241) 评论(0) 推荐(0)

2012年10月31日

poj 1002 stl map

摘要: 487-3279Time Limit: 2000MSMemory Limit: 65536KTotal Submissions: 198847Accepted: 34639DescriptionBusinesses like to have memorable telephone numbers. One way to make a telephone number memorable is to have it spell a memorable word or phrase. For example, you can call the University of Waterloo by d 阅读全文

posted @ 2012-10-31 19:53 yumao 阅读(661) 评论(0) 推荐(0)

usaco 1.1 greedy gift givers

摘要: Greedy Gift GiversA group of NP (2 ≤ NP ≤ 10) uniquely named friends has decided to exchange gifts of money. Each of these friends might or might not give some money to any or all of the other friends. Likewise, each friend might or might not receive money from any or all of the other friends. Your 阅读全文

posted @ 2012-10-31 15:30 yumao 阅读(239) 评论(0) 推荐(0)

2012年10月28日

hdu 3664

摘要: Permutation CountingTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 912 Accepted Submission(s): 456Problem DescriptionGiven a permutation a1, a2, … aN of {1, 2, …, N}, we define its E-value as the amount of elements where ai > i. For example, t 阅读全文

posted @ 2012-10-28 22:14 yumao 阅读(203) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 7 ··· 9 下一页

导航