摘要:
Problem DescriptionFor a given positive integer n, please find the smallest positive integer x that we can find an integer y such that y^2 = n +x^2.InputThe first line is an integer T, which is the the number of cases.Then T line followed each containing an integer n (1<=n <= 10^9).OutputFor e 阅读全文
摘要:
DescriptionYou have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.InputInput consists of up to 100,000 dictionary entries, followed by a blank line, followed by a message 阅读全文
摘要:
PairsTime Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 329 Accepted Submission(s): 159Problem DescriptionGiven n positive integers, is it possible to divide them into pairs so that the sum of each pair is the same?InputThe input contains several tes 阅读全文
摘要:
Problem DescriptionThese are N cities in Spring country. Between each pair of cities there may be one transportation track or none. Now there is some cargo that should be delivered from one city to another. The transportation fee consists of two parts: The cost of the transportation on the path betw 阅读全文
摘要:
AlgorithmThe Floyed algorithm is an algorithm for efficiently and simultaneously finding the shortest paths betweeen every pair of vertices in a weighted and potentially directed graph.Consider a graph G with vertices V,each numbered 1 through N. Further consider a function shortestPath(i,j,k) that 阅读全文
摘要:
Webpage link address http://acm.hdu.edu.cn/showproblem.php?pid=2115I personally think this is good problem for training string processing.And i learned much from the problem by solving this problem;well,the idea of the problem is clear,so i just say someting we should pay attentioned to;First,if you 阅读全文