一.Description As part of an arithmetic competency program, your students will be given randomly generated lists of from 2 to 15 unique positive integers and asked to determine how many items in each list are twice some other item in the same list. Yo…
Going Home Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 15944 Accepted: 8167 Description On a grid map there are n little men and n houses. In each unit time, every little man can move one unit step, either horizontally, or vertical…
Balanced Lineup Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 42929 Accepted: 20184 Case Time Limit: 2000MS Description For the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer Joh…
Counterfeit Dollar Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 35774 Accepted: 11390 Description Sally Jones has a dozen Voyageur silver dollars. However, only eleven of the coins are true silver dollars; one coin is counterfeit ev…
Ants Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 10722 Accepted: 4752 Description An army of ants walk on a horizontal pole of length l cm, each with a constant speed of 1 cm/s. When a walking ant reaches an end of the pole, it imm…
Rounders Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7697 Accepted: 4984 Description For a given number, if greater than ten, round it to the nearest ten, then (if that result is greater than 100) take the result and round it to th…
读懂题意就简单了 #include<stdio.h> #define inf 999999999 #define N 310 int f[N]; int map[N][N]; int main() { int n,m,i,j,k,a,b,max,ans; while(scanf("%d%d",&n,&m)!=EOF) { for(i=1;i<=n;i++) for(j=1;j<=n;j++) map[i][j]=inf; while(m--) {…
Description For the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with some of the cows. To keep things simple, he will take a contiguous rang…
http://poj.org/problem?id=3264 题目大意: 给定N个数,还有Q个询问,求每个询问中给定的区间[a,b]中最大值和最小值之差. 思路: 依旧是线段树水题~ #include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int MAXN=50000+10; const int MAXM=MAXN<<2; const int INF=…