08 2017 档案
摘要:Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but
阅读全文
摘要:Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whe
阅读全文
摘要:Given a connected undirected graph, tell if its minimum spanning tree is unique. Definition 1 (Spanning Tree): Consider a connected, undirected graph
阅读全文
摘要:证明详细的博客:http://blog.csdn.net/hillgong/article/details/4214327 模板: 1 #include<iostream> 2 #include<algorithm> 3 #include<queue> 4 #include<cstdio> 5 #i
阅读全文
摘要:The aspiring Roy the Robber has seen a lot of American movies, and knows that the bad guys usually gets caught in the end, often because they become t
阅读全文
摘要:A group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the roof of a building, and at the mean time
阅读全文
摘要:Jesus, what a great movie! Thousands of people are rushing to the cinema. However, this is really a tuff time for Joe who sells the film tickets. He i
阅读全文
摘要:Now I think you have got an AC in Ignatius.L's "Max Sum" problem. To be a brave ACMer, we always challenge ourselves to more difficult problems. Now y
阅读全文
摘要:#include #define inf 1q; bool vis[100000]; memset(vis,0,sizeof vis); vis[s]=1; dis[s]=0; q.push(s); while(!q.empty()){ int f=q.front(); q.pop(); vis[f]...
阅读全文
摘要:The shortest common superstring of 2 strings S 1 and S 2 is a string S with the minimum number of characters which contains both S 1 and S 2 as a sequ
阅读全文
摘要:我们首先来看一下什么是前向星. 前向星是一种特殊的边集数组,我们把边集数组中的每一条边按照起点从小到大排序,如果起点相同就按照终点从小到大排序, 并记录下以某个点为起点的所有边在数组中的起始位置和存储长度,那么前向星就构造好了. 用len[i]来记录所有以i为起点的边在数组中的存储长度. 用head
阅读全文
摘要:目前看来,简单深搜题大致分为三类题型: 1是连通块问题,求连通块大小和数量。 2是棋盘问题,问地图内放几个坐标,有几个放法。 3是输出路径问题。 1.这个问题的经典例题是计算水塘(pku-2386 lake counting) 例题: Due to recent rains, water has p
阅读全文
摘要:If you ever tried to read a html document on a Macintosh, you know how hard it is if no Netscape is installed. Now, who can forget to install a HTML b
阅读全文
摘要:一个规则的实心十二面体,它的 20个顶点标出世界著名的20个城市,你从一个城市出发经过每个城市刚好一次后回到出发的城市。 Input前20行的第i行有3个数,表示与第i个城市相邻的3个城市.第20行以后每行有1个数m,m<=20,m>=1.m=0退出. Output输出从第m个城市出发经过每个城市1
阅读全文
摘要:1 2 3 4 5 6 7 ############################# 1 # | # | # | | # ##### ##### # ##### # 2 # # | # # # # # # ##### ##### ##### # 3 # | | # # # # # # ######
阅读全文
摘要:在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。 Input 输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将
阅读全文
摘要:Sudoku is a very simple task. A square table with 9 rows and 9 columns is divided to 9 smaller squares 3x3 as shown on the Figure. In some of the cell
阅读全文
摘要:1282: ykc想吃好吃的 题目描述 一天,ykc在学校闲的无聊,于是决定上街买点吃的,ykc很懒,本来就不是很像逛街,于是找来了czl帮他买,这里应该有滑稽,而czl也不愿为ykc买东西吃,但是ykc很强势,非让他去买,呢没办法了,然而czl还有很多事要做,没呢么多时间帮ykc,而这条小吃街又很
阅读全文
摘要:A common pastime for poker players at a poker table is to shuffle stacks of chips. Shuffling chips is performed by starting with two stacks of poker c
阅读全文
摘要:There is a strange lift.The lift can stop can at every floor as you want, and there is a number Ki(0 <= Ki <= N) on every floor.The lift have just two
阅读全文
摘要:Rectangle frog has a piece of paper divided into nn rows and mm columns. Today, she would like to draw a rectangle whose perimeter is not greater than
阅读全文
摘要:1281: 邪能炸弹 题目描述 正在入侵艾泽拉斯的古尔丹偶然间得到了一颗邪能炸弹,经过研究,他发现这是一颗威力极其巨大且难以控制的炸弹。但是精通邪能的古尔丹突然有了一个大胆的想法,他对炸弹进行了一些小小的改造。这使得炸弹需要n天的充能才能爆炸,在这n天中,每天炸弹的邪能值都会产生波动,波动值为xi,
阅读全文
摘要:]Edward has an array A with N integers. He defines the beauty of an array as the summation of all distinct integers in the array. Now Edward wants to
阅读全文
摘要:For an upcoming programming contest, Edward, the headmaster of Marjar University, is forming a two-man team from N students of his university. Edward
阅读全文