上一页 1 2 3 4 5 6 ··· 19 下一页
摘要: Alice lives in the country where people like to make friends. The friendship is bidirectional and if any two person have no less than k friends in common, they will become friends in several days. Currently, there are totally n people in the country, and m friendship among them. Assume that any new 阅读全文
posted @ 2013-10-04 15:55 forevermemory 阅读(208) 评论(0) 推荐(0) 编辑
摘要: Recently, the ACM/ICPC team of Marjar University decided to choose some new members from freshmen to take part in the ACM/ICPC competitions of the next season. As a traditional elite university in ACM/ICPC, there is no doubt that application forms will fill up the mailbox. To constitute some powerfu 阅读全文
posted @ 2013-10-04 12:50 forevermemory 阅读(275) 评论(0) 推荐(0) 编辑
摘要: 题目描述HJ,LWC,HRQ三个人在外面比赛,比赛前他们想去外面玩,但是三个人相去的地方不一样。他们坐一辆出租车,请问怎么走,把他们三个都送到目的地的路程最短?输入第一行是一个整数K(K#include#include#include#include#include#define inf 100000000using namespace std;int visit[1005];int pre[1005];int des[1005];int save[4];int sg[4][4];int n,m;struct lmx{int to;int next;int w;};lmx lm[80004]; 阅读全文
posted @ 2013-09-30 14:32 forevermemory 阅读(340) 评论(0) 推荐(0) 编辑
摘要: DescriptionLittle Johnny has got a new car. He decided to drive around the town to visit his friends. Johnny wanted to visit all his friends, but there was many of them. In each street he had one friend. He started thinking how to make his trip as short as possible. Very soon he realized that the be 阅读全文
posted @ 2013-09-27 21:54 forevermemory 阅读(269) 评论(0) 推荐(0) 编辑
摘要: DescriptionA catenym is a pair of words separated by a period such that the last letter of the first word is the same as the last letter of the second. For example, the following are catenyms:dog.gopher gopher.rat rat.tiger aloha.aloha arachnid.dogA compound catenym is a sequence of three or more wo 阅读全文
posted @ 2013-09-27 16:35 forevermemory 阅读(227) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionNow you are given one non-negative integer n in 10-base notation, it will only contain digits ('0'-'9'). You are allowed to choose 2 integers i and j, such that: i!=j, 1≤i#include#includeusing namespace std;int p[1010];void swap(int &a,int &b){int temp=a;a= 阅读全文
posted @ 2013-09-26 17:34 forevermemory 阅读(215) 评论(0) 推荐(0) 编辑
摘要: DescriptionA single-player game is played on a rectangular board divided in R rows and C columns. There is a single uppercase letter (A-Z) written in every position in the board. Before the begging of the game there is a figure in the upper-left corner of the board (first row, first column). In ever 阅读全文
posted @ 2013-09-26 11:19 forevermemory 阅读(286) 评论(0) 推荐(0) 编辑
摘要: DescriptionYou are given a bunch of wooden sticks. Each endpoint of each stick is colored with some color. Is it possible to align the sticks in a straight line such that the colors of the endpoints that touch are of the same color?InputInput is a sequence of lines, each line contains two words, sep 阅读全文
posted @ 2013-09-25 15:33 forevermemory 阅读(299) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionOverpower often go to the playground with classmates. They play and chat on the playground. One day, there are a lot of stars in the sky. Suddenly, one of Overpower’s classmates ask him: “How many acute triangles whose inner angles are less than 90 degrees (regarding stars as poin 阅读全文
posted @ 2013-09-24 21:06 forevermemory 阅读(233) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionBob enjoys playing computer games, especially strategic games, but sometimes he cannot find the solution fast enough and then he is very sad. Now he has the following problem. He must defend a medieval city, the roads of which form a tree. He has to put the minimum number of soldi 阅读全文
posted @ 2013-09-18 21:32 forevermemory 阅读(236) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 19 下一页