http://acm.hust.edu.cn/vjudge/contest/view.action?cid=27938#problem/E 题目大意:Given, n, count the number of solutions to the equation x+2y+2z=n, where x,y,z,n are non negative integers. 解题思路:只对一个枚举由此推算出另外两个的种类,千万不要都枚举!!! #include<iostream> #include<…
Description   Your new company is building a robot that can hold small lightweight objects. The robot will have the intelligence to determine if an object is light enough to hold. It does this by taking pictures of the object from the 6 cardinal dire…
Description   Programming contests became so popular in the year 2397 that the governor of New Earck -- the largest human-inhabited planet of the galaxy -- opened a special Alley of Contestant Memories (ACM) at the local graveyard. The ACM encircles…
Description Last September, Hangzhou raised the taxi fares. The original flag-down fare in Hangzhou was 10 yuan, plusing 2 yuan per kilometer after the first 3km and 3 yuan per kilometer after 10km. The waiting fee was 2 yuan per five minutes. Passen…
游戏规则: 有一堆个数为n的石子,游戏双方轮流取石子,满足: 1)先手不能在第一次把所有的石子取完: 2)之后每次可以取的石子数介于1到对手刚取的石子数的2倍之间(包含1和对手刚取的石子数的2倍). 约定取走最后一个石子的人为赢家,求必败态. 问题分析: 这个和之前的Wythoff’s Game 和取石子游戏 有一个很大的不同点,就是游戏规则的动态化.之前的规则中,每次可以取的石子的策略集合是基本固定的,但是这次有规则2:一方每次可以取的石子数依赖于对手刚才取的石子数. 这个游戏叫做Fibona…
大菲波数 Problem Description Fibonacci数列,定义如下:f(1)=f(2)=1f(n)=f(n-1)+f(n-2) n>=3.计算第n项Fibonacci数值.   Input 输入第一行为一个整数N,接下来N行为整数Pi(1<=Pi<=1000).   Output 输出为N行,每行为对应的f(Pi).   Sample Input 5 1 2 3 4 5   Sample Output 1 1 2 3 5   import java.math.BigInt…
比赛链接: http://www.bnuoj.com/v3/contest_show.php?cid=4159 题目来源: lrj训练指南---几何算法 Flag ID Title   A Board Wrapping   B Airport   C The Great Divide   D Squares   E Most Distant Point from the Sea   F Triathlon   G Jungle Outpost   H Monster Trap   I Find…
题目链接:http://lightoj.com/volume_showproblem.php?problem=1306 You have to find the number of solutions of the following equation: Ax + By + C = Where A, B, C, x, y are integers and x1 ≤ x ≤ x2 and y1 ≤ y ≤ y2. Input Input starts with an integer T (≤ ),…
[lightoj P1306] Solutions to an Equation You have to find the number of solutions of the following equation: Ax + By + C = 0 Where A, B, C, x, y are integers and x1 ≤ x ≤ x2 and y1 ≤ y ≤ y2. Input Input starts with an integer T (≤ 10000), denoting th…
B. Little Dima and Equation time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Little Dima misbehaved during a math lesson a lot and the nasty teacher Mr. Pickles gave him the following proble…