Poj 1552 Doubles(水题)】的更多相关文章

一.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…
POJ.1552 Doubles(水) 题意分析 暴力 代码总览 #include <cstdio> #include <stdio.h> #define nmax 100 using namespace std; int a[nmax]; int n; int main() { //freopen("in.txt","r",stdin); while(true){ int t; scanf("%d",&t); i…
以下是poj百道水题,新手可以考虑从这里刷起 搜索1002 Fire Net1004 Anagrams by Stack1005 Jugs1008 Gnome Tetravex1091 Knight Moves1101 Gamblers1204 Additive equations 1221 Risk1230 Legendary Pokemon1249 Pushing Boxes 1364 Machine Schedule1368 BOAT1406 Jungle Roads1411 Annive…
题意:找到一段数字里最大值和最小值的差 水题 #include<cstdio> #include<iostream> #include<algorithm> #include<cstring> #include<cmath> #include<queue> using namespace std; ; const int INF=0x3f3f3f3f; int n,m,t; ; ],dpMIN[MAXN][]; int mm[MAXN…
题目: 题意:题意:给出几个正数(2~15个),然后就是求有这些数字的2倍有没有和原先的正数相同的,求出有几个,没有就是0. 分析:水题.用数组解决,开一个数组存正数,另开一个数组用来存这些数的2倍,接着就搜索,然后注意一下结束的时候怎么处理就行. c普通方法: #include <iostream> #include<cstdio> #include<cstring> #include<cstdlib> #include<stack> #inc…
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…
题目 http://poj.org/problem?id=1837 题意 单组数据,有一根杠杆,有R个钩子,其位置hi为整数且属于[-15,15],有C个重物,其质量wi为整数且属于[1,25],重物与重物之间,钩子与钩子之间彼此不同.忽略杠杆及重心的影响,有多少种方式使得全部重物都挂上钩子(某些钩子可能挂若干个重物)后杠杆平衡? 思路 由于状态比较小,即使n的五次方也足以承受,而且任意时刻杠杆的状态在[-15 * 25 * 20, 15 * 25 * 20]之间,所以可以直接穷举状态. 感想…
大概题意就是求\(1 \le i,j \le n\)的\(gcd(i,j) = 1\)的个数+2(对于0的特判) 正解应该是欧拉函数或者高逼格的莫比乌斯反演 但数据实在太水直接打表算了 /*H E A D*/ bool GCD[1002][1002]; inline int gcd(int a,int b){return b?gcd(b,a%b):a;} int main(){ rep(i,1,1000) rep(j,1,1000) GCD[i][j]=bool(gcd(i,j)==1); in…
题目链接 卡了一下精度和内存. #include <cstdio> #include <cstring> #include <string> #include <cmath> #include <iostream> #include <algorithm> using namespace std; #define eps 1e-8 #define N 1000001 #define LL __int64 ] = {-,,,-,,,-,…
#include <stdio.h> #include <stdlib.h> ]; int cmp(const void *a, const void *b) { return *(int*)a - *(int*)b; } int main() { int n,i,j,result; ) { i = result = ; nums[i] = n; ++i; while(scanf("%d",&n) && n) { nums[i] = n;…