POJ 2590】的更多相关文章

http://poj.org/problem?id=2590 http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1871 题目大意: 给两个点a,b,要求从a移动到b,每次移动步数要比前面的一步大或者等于或者小1.求最小的步数.(起始和终点必须步数为1) 思路: 直接对称着来做. 比如: 1->7的话 可以 1 2 2 1 1->9 1 2 3 2 1 50 1 2 3 4 5 6 7 6 5 4 3 2 1 1 两个OJ…
#include<iostream> #include<algorithm> #define MAXN 1000000 using namespace std; unsigned a[MAXN]; int main() { //freopen("acm.acm","r",stdin); int i; ; ; int x; int y; a[] = ; ; i < MAXN; ++ i) { a[i] = a[i-] + num; ++…
Steps Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 7872   Accepted: 3612 Description One steps through integer points of the straight line. The length of a step must be nonnegative and can be by one bigger than, equal to, or by one sm…
Online Judge系统      Online Judge系统(简称OJ)是一个在线的判题系统.用户可以在线提交给定问题的多种程序(如C.C++.Pascal.Java)源代码,系统对源代码进行编译和执行,并通过预先设计的测试数据来检验程序源代码的正确性. 一个用户提交的程序在Online Judge系统下执行时将受到比较严格的限制,包括运行时间限制.内存使用限制和安全限制等.用户程序执行的结果将被Online Judge系统捕捉并保存,然后再转交给一个裁判程序.该裁判程序或者比较用户程序…
Halloween treats Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 7644   Accepted: 2798   Special Judge Description Every year there is the same problem at Halloween: Each neighbour is only willing to give a certain total number of sweets…
Find a multiple Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 7192   Accepted: 3138   Special Judge Description The input contains N natural (i.e. positive integer) numbers ( N <= 10000 ). Each of that numbers is not greater than 15000…
The Pilots Brothers' refrigerator Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 22286   Accepted: 8603   Special Judge Description The game “The Pilots Brothers: following the stripy elephant” has a quest where a player needs to open a…
Flip Game Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 37427   Accepted: 16288 Description Flip 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 the…
Corn Fields Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 9806   Accepted: 5185 Description Farmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some yumm…
Sum of Consecutive Prime Numbers Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 20050   Accepted: 10989 Description Some positive integers can be represented by a sum of one or more consecutive prime numbers. How many such representatio…