UVa10025 ? 1 ? 2 ? ... ? n = k problem The problem Given the following formula, one can set operators '+' or '-' instead of each '?', in order to obtain a given k? 1 ? 2 ? ... ? n = k For example: to obtain k = 12 , the expression to be used will be:…
B. Tell Your World time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Connect the countless points with lines, till we reach the faraway yonder. There are n points on a coordinate plane, the i…
题目链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2722 题目描述: Our school is planning to hold a new exciting computer programming contest. During each round of the contest, the competitors will be paired, and compete head-to-head. The…
Head-to-Head Match Time Limit: 2 Seconds Memory Limit: 65536 KB Our school is planning to hold a new exciting computer programming contest. During each round of the contest, the competitors will be paired, and compete head-to-head. The loser wil…
题目链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2818 题目描述: Given positive integers B and N, find an integer A such that AN is as close as possible to B. (The result A is an approximation to the Nth root of B.) Note that AN may be l…
思维:思维就是将大的矩形放在小矩形里面,让大矩形的宽和长尽量靠近. 很容易得到 (a+b)% i = 0 的话, 保证了大矩形的形成,同时里面表示了两种情况:1, a % i =0, b % i=0; 2, (a%i + b % i) % i =0 当然,第一种情况是第二种的特殊情况,但是,我还是想把它写出来, 同时, 这个 i 必须大于 a和 b共同的 第一个 因子(不必是共同因子,第一的顺序是只从大到小的顺序中第一次大于等于)至于,为什么自己可以画画图,就很明白了.当然,要证明的话,直…