09 2015 档案
摘要:2.解题思路:本题利用欧拉回路存在条件解决。可以将所有的单词看做边,26个字母看做端点,那么本题其实就是问是否存在一条路径,可以到达所有出现过的字符端点。由于本题还要求了两个单词拼在一起的条件是前一个单词的右端点和本单词的左端点一样。所以这是一个有向图。根据结论:有向图的底图(忽略边的方向后的图)必...
阅读全文
摘要:DescriptionDrazil created a following problem about putting 1 × 2 tiles into an n × m grid:"There is a grid with some cells that are empty and some ce...
阅读全文
摘要:给一个n个点m条边(2 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 #include 14 #in...
阅读全文
摘要:时间限制:1000ms单点时限:1000ms内存限制:256MB描述This is the logo of PKUACM 2016. More specifically, the logo is generated as follows:1. Put four points A0(0,0), B0(...
阅读全文
摘要:DescriptionAfter a day trip with his friend Dick, Harry noticed a strange pattern of tiny holes in the door of his SUV. The local American Tire store ...
阅读全文
摘要:Problem DescriptionMr. West bought a new car! So he is travelling around the city.One day he comes to a vertical corner. The street he is currently in...
阅读全文
摘要:Problem DescriptionIn the Dark forest, there is a Fairy kingdom where all the spirits will go together and Celebrate the harvest every year. But there...
阅读全文
摘要:Problem DescriptionMarica is very angry with Mirko because he found a new girlfriend and she seeks revenge.Since she doesn't live in the same city, sh...
阅读全文
摘要:Problem Description杭州有N个景区,景区之间有一些双向的路来连接,现在8600想找一条旅游路线,这个路线从A点出发并且最后回到A点,假设经过的路线为V1,V2,....VK,V1,那么必须满足K>2,就是说至除了出发点以外至少要经过2个其他不同的景区,而且不能重复经过同一个景区。现...
阅读全文
摘要:Problem DescriptionClarke is a patient with multiple personality disorder. One day, Clarke split into two personality a and b, they are playing a game...
阅读全文
摘要:Problem DescriptionClarke is a patient with multiple personality disorder. One day, Clarke turned into a student and read a book.Suddenly, a difficult...
阅读全文
摘要:Problem DescriptionClarke is a patient with multiple personality disorder. One day, Clarke turned into a game player of minecraft. On that day, Clarke...
阅读全文
摘要:Problem DescriptionRompire is a robot kingdom and a lot of robots live there peacefully. But one day, the king of Rompire was captured by human beings...
阅读全文
摘要:Problem DescriptionI used to think I could be anything, but now I know that I couldn't do anything. So I started traveling.The nation looks like a con...
阅读全文
摘要:Problem DescriptionA thief is running away!We can consider the city where he locates as an undirected graph in which nodes stand for crosses and edges...
阅读全文
摘要:DescriptionThere are N cities in a country, and there is one and only one simple path between each pair of cities. A merchant has chosen some paths an...
阅读全文
摘要:DescriptionThe cows have run out of hay, a horrible event that must be remedied immediately. Bessie intends to visit the other farms to survey their h...
阅读全文
摘要:DescriptionBessie has been hired to build a cheap internet network among Farmer John's N (2 3 #include 4 #include 5 #include 6 #include 7 #include 8 ...
阅读全文
摘要:DescriptionFarmer John's cows refused to run in his marathon since he chose a path much too long for their leisurely lifestyle. He therefore wants to ...
阅读全文
摘要:DescriptionFarmer John's farm has N barns, and there are some cows that live in each barn. The cows like to drop around, so John wants to build some r...
阅读全文
摘要:DescriptionRatish is a young man who always dreams of being a hero. One day his friend Luffy was caught by Pirate Arlong. Ratish set off at once to Ar...
阅读全文
摘要:Problem DescriptionWith the 60th anniversary celebration of Nanjing University of Science and Technology coming soon, the university sets n tourist sp...
阅读全文
摘要:Problem DescriptionThis year is the 60th anniversary of NJUST, and to make the celebration more colorful, Tom200 is going to invite distinguished alum...
阅读全文
摘要:DescriptionKatu Puzzle is presented as a directed graph G(V, E) with each edge e(a, b) labeled by a boolean operator op (one of AND, OR, XOR) and an i...
阅读全文
摘要:DescriptionEvery year there is the same problem at Halloween: Each neighbour is only willing to give a certain total number of sweets on that day, no ...
阅读全文
摘要:DescriptionThe input contains N natural (i.e. positive integer) numbers ( N 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #incl...
阅读全文
摘要:超经典:1. 为了世界的和平,为了女生的安全,我拼命做题,做题,做题!2. A ac a day, keeps the doctor away!3. from good to great!4. 用最短的时间,刷最多的题!5. 给我一滴泪,我就看到了你全部的海洋!6. GO--GO---GO GOOD...
阅读全文
摘要:DescriptionFlip game is played on a rectangular 4x4 field with two-sided pieces placed on each of its 16 squares. One side of each piece is white and ...
阅读全文
摘要:DescriptionSquares and rectangles fascinated the famous Dutch painter Piet Mondriaan. One night, after producing the drawings in his 'toilet series' (...
阅读全文
摘要:Recently, researchers on Mars have discovered N powerful atoms. All of them are different. These atoms have some properties. When two of these atoms c...
阅读全文
摘要:Description两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某个...
阅读全文
摘要:DescriptionA Compiler Mystery: We are given a C-language style for loop of type for (variable = A; variable != B; variable += C) statement;I.e., a lo...
阅读全文
摘要:扩展欧几里德算法基本算法:对于不完全为 0 的非负整数 a,b,gcd(a,b)表示 a,b 的最大公约数,必然存在整数对 x,y ,使得 gcd(a,b)=ax+by。证明:设 a>b。 1,显然当 b=0,gcd(a,b)=...
阅读全文
摘要:DescriptionThe Pizazz Pizzeria prides itself in delivering pizzas to its customers as fast as possible. Unfortunately, due to cutbacks, they can affor...
阅读全文
摘要:Description司令部的将军们打算在N*M的网格地图上部署他们的炮兵部队。一个N*M的地图由N行M列组成,地图的每一格可能是山地(用"H" 表示),也可能是平原(用"P"表示),如下图。在每一格平原地形上最多可以布置一支炮兵部队(山地上不能够部署炮兵部队);一支炮兵部队在地图上的攻击范围如图中...
阅读全文
摘要:DescriptionA network of m roads connects N cities (numbered from 1 to N). There may be more than one road connecting one city with another. Some of th...
阅读全文
摘要:Problem DescriptionJack likes to travel around the world, but he doesn’t like to wait. Now, he is traveling in the Undirected Kingdom. There are n cit...
阅读全文
摘要:Problem DescriptionXiao Ming is a citizen who's good at playing,he has lot's of gold cones which have square undersides,let's call them pyramids.Anyon...
阅读全文
摘要:Problem DescriptionDue to the curse made by the devil,Xiao Ming is stranded on a mountain and can hardly escape.This mountain is pretty strange that i...
阅读全文
摘要:Problem DescriptionTerrorists put some mines in a crowded square recently. The police evacuate all people in time before any mine explodes. Now the po...
阅读全文
摘要:Problem Description我们有一个数列A1,A2...An,你现在要求修改数量最少的元素,使得这个数列严格递增。其中无论是修改前还是修改后,每个元素都必须是整数。请输出最少需要修改多少个元素。Input第一行输入一个T(1≤T≤10),表示有多少组数据每一组数据:第一行输入一个N(1≤...
阅读全文
摘要:Problem Description给定序列A={A1,A2,...,An}, 要求改变序列A中的某些元素,形成一个严格单调的序列B(严格单调的定义为:Bi 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 us...
阅读全文
摘要:Problem DescriptionFive hundred years later, the number of dragon balls will increase unexpectedly, so it's too difficult for Monkey King(WuKong) to g...
阅读全文
摘要:DescriptionBessie is such a hard-working cow. In fact, she is so focused on maximizing her productivity that she decides to schedule her next N (1 ≤ N...
阅读全文
摘要:Problem DescriptionIn an n∗m maze, the right-bottom corner is the exit (position (n,m) is the exit). In every position of this maze, there is either a...
阅读全文
摘要:Problem DescriptionOO has got a array A of size n ,defined a function f(l,r) represent the number of i (li) satisfy ai mod aj=0,now OO want to know∑i=...
阅读全文
摘要:Problem DescriptionMZL loves xor very much.Now he gets an array A.The length of A is n.He wants to know the xor of all (Ai+Aj)(1≤i,j≤n)The xor of an a...
阅读全文
摘要:Problem DescriptionFor 2 non-negative integers x and y, f(x, y) is defined as the number of different bits in the binary format of x and y. For exampl...
阅读全文
摘要:Problem DescriptionToday is the 1st anniversary of BestCoder. Soda, the contest manager, gets a string s of length n. He wants to find three nonoverla...
阅读全文
摘要:Problem DescriptionToday, Soda has learned a sequence whose n-th (n≥1) item is 3n(n−1)+1. Now he wants to know if an integer m can be represented as t...
阅读全文
摘要:Problem DescriptionRecently, Dave is boring, so he often walks around. He finds that some places are too crowded, for example, the ground. He couldn't...
阅读全文
摘要:DescriptionDao was a simple two-player board game designed by Jeff Pickering and Ben van Buskirk at 1999. A variation of it, called S-Dao, is a one-pl...
阅读全文
摘要:Problem DescriptionIgnatius再次被魔王抓走了(搞不懂他咋这么讨魔王喜欢)……这次魔王汲取了上次的教训,把Ignatius关在一个n*m的地牢里,并在地牢的某些地方安装了带锁的门,钥匙藏在地牢另外的某些地方。刚开始Ignatius被关在(sx,sy)的位置,离开地牢的门在(e...
阅读全文
摘要:Problem DescriptionThe Czech Technical University is rather old — you already know that it celebrates 300 years of its existence in 2007. Some of the ...
阅读全文
摘要:DescriptionIvan is fond of collecting. Unlike other people who collect post stamps, coins or other material stuff, he collects software bugs. When Iva...
阅读全文
摘要:Problem DescriptionYou live in a village but work in another village. You decided to follow the straight path between your house (A) and the working p...
阅读全文
摘要:Problem DescriptionAkemi Homura is a Mahou Shoujo (Puella Magi/Magical Girl).Homura wants to help her friend Madoka save the world. But because of the...
阅读全文
摘要:Problem DescriptionSakura has a very magical tool to paint walls. One day, kAc asked Sakura to paint a wall that looks like an M×N matrix. The wall ha...
阅读全文
摘要:Problem DescriptionIn your childhood, do you crazy for collecting the beautiful cards in the snacks? They said that, for example, if you collect all t...
阅读全文
摘要:Problem DescriptionHzz loves aeroplane chess very much. The chess map contains N+1 grids labeled from 0 to N. Hzz starts at grid 0. For each step he t...
阅读全文
摘要:Problem DescriptionEveryone knows Matt enjoys playing games very much. Now, he is playing such a game. There are N rooms, each with one door. There ar...
阅读全文
摘要:DescriptionOnce upon a time Matt went to a small town. The town was so small and narrow that he can regard the town as a pivot. There were some skyscr...
阅读全文
摘要:题目描述DescriptionZ小镇是一个景色宜人的地方,吸引来自各地的观光客来此旅游观光。Z小镇附近共有N(1 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 #define inf 1...
阅读全文
摘要:Problem DescriptionWe send a light from one point on a mirror material circle,it reflects N times and return the original point firstly.Your task is c...
阅读全文
摘要:Problem DescriptionDetermine whether a sequence is a Geometric progression or not.In mathematics, a **geometric progression**, also known as a **geome...
阅读全文
摘要:Problem DescriptionThere are many people's name and birth in a list.Your task is to print the name from young to old.(There is no pair of two has the ...
阅读全文
摘要:Problem DescriptionThere is a sequence ofnpositive integers. Fancycoder is addicted to learn their product, but this product may be extremely huge! Ho...
阅读全文
摘要:DescriptionIt is a little known fact that cows love apples. Farmer John has two apple trees (which are conveniently numbered 1 and 2) in his field, ea...
阅读全文
摘要:DescriptionFarmer John commanded his cows to search for different sets of numbers that sum to a given number. The cows use only numbers that are an in...
阅读全文
摘要:DescriptionThe New Year garland consists of N lamps attached to a common wire that hangs down on the ends to which outermost lamps are affixed. The wi...
阅读全文
摘要:DescriptionFarmer John wants to set up a telephone line at his farm. Unfortunately, the phone company is uncooperative, so he needs to pay for some of...
阅读全文
摘要:DescriptionBessie hears that an extraordinary meteor shower is coming; reports say that these meteors will crash into earth and destroy anything they ...
阅读全文
摘要:DescriptionThe N (2 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 #define N 100006 9 int n,m; 10 int tot; 1...
阅读全文
摘要:DescriptionGiven a N × N matrix A, whose element in the i-th row and j-th column Aij is an number that equals i2 + 100000 × i + j2 - 100000 × j + i × ...
阅读全文
摘要:DescriptionGiven N numbers, X1, X2, ... , XN, let us calculate the difference of every pair of numbers: ∣Xi - Xj∣ (1 ≤ i < j ≤ N). We can get C(N,2) d...
阅读全文
摘要:DescriptionFarmer John's N (1 =w1-s2,即w2+s2>=w1+s1,所以和最大的就该老实的在下面呆着= =! 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using name...
阅读全文
摘要:DescriptionDemy has n jewels. Each of her jewels has some value vi and weight wi.Since her husband John got broke after recent financial crises, Demy ...
阅读全文
摘要:DescriptionIn a certain course, you take n tests. If you get ai out of bi questions correct on test i, your cumulative average is defined to be ..Gi...
阅读全文
摘要:Description"Fat and docile, big and dumb, they look so stupid, they aren't much fun..." - Cows with Guns by Dana Lyons The cows want to prove to the p...
阅读全文
摘要:DescriptionIt is very hard to wash and especially to dry clothes in winter. But Jane is a very smart girl. She is not afraid of this boring process. J...
阅读全文
摘要:DescriptionFarmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and re...
阅读全文
摘要:DescriptionFarmer John has built a new long barn, with N (2 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 #define N...
阅读全文
摘要:DescriptionEvery year the cows hold an event featuring a peculiar version of hopscotch that involves carefully jumping from rock to rock in a river. T...
阅读全文
摘要:DescriptionThe cows are going to space! They plan to achieve orbit by building a sort of space elevator: a giant tower of blocks. They have K (1 =0表示取...
阅读全文
摘要:DescriptionA straight dirt road connects two fields on FJ's farm, but it changes elevation more than FJ would like. His cows do not mind climbing up o...
阅读全文
摘要:Problem DescriptionJohn are playing with blocks. There are N blocks (1 2 #include 3 #include 4 using namespace std; 5 #define N 30006 6 int fa[N]; 7 ...
阅读全文
摘要:DescriptionStarting with x and repeatedly multiplying by x, we can compute x31 with thirty multiplications:x2 = x × x, x3 = x2 × x, x4 = x3 × x, …, x3...
阅读全文
摘要:DescriptionPeople in Silverland use coins.They have coins of value A1,A2,A3...An Silverland dollar.One day Tony opened his money-box and found there w...
阅读全文
摘要:DescriptionThe cows don't use actual bowling balls when they go bowling. They each take a number (in the range 0..99), though, and line up in a standa...
阅读全文
摘要:Description"Let it Bead" company is located upstairs at 700 Cannery Row in Monterey, CA. As you can deduce from the company name, their business is be...
阅读全文
摘要:DescriptionBeads of red, blue or green colors are connected together into a circular necklace of n beads ( n 2 #include 3 #include 4 #include 5 #incl...
阅读全文