POJ题解
何以陌生
这个作者很懒,什么都没留下…
展开
-
POJ 1004 Financial Management
#include int main() { double n,m=0; int i; for(i=0;i<12;i++) { scanf("%lf",&n); m+=n; } printf("$%.2lf\n",m/12); return 0; }原创 2013-09-18 00:00:31 · 786 阅读 · 0 评论 -
POJ 1003 Hangover
# include int main() { int i; float a,sum; while(scanf("%f",&a)!=EOF&&a!=0.00) { sum=0; for(i=2;;i++) { sum+=1.0/i; if(sum>=a) { printf("%d card(s)\n",i-1); b原创 2013-09-17 23:45:26 · 891 阅读 · 0 评论 -
POJ 1659 Frogs' Neighborhood (生成树问题)
题目链接:http://poj.org/problem?id=1659 题意:根据序列构造图(图论基础题) #include #include #include using namespace std; const int M=20; struct node { int degree; int num; bool operator < (const no原创 2013-09-18 00:09:44 · 1123 阅读 · 0 评论 -
POJ 1000 A+B Problem
# include int main() { int a,b; scanf("%d %d",&a, &b); printf("%d\n",a+b); return 0; }原创 2013-09-17 23:43:44 · 3155 阅读 · 0 评论 -
POJ 1611 The Suspects (并查集)
题目链接:http://poj.org/problem?id=1611 函数:void Empty()、int Find(int x)、void Union(int r1,int r2) 这三个函数,要背熟。 # include using namespace std; int n, m, i, j; int father[30005], num[30005]; void make原创 2013-09-18 00:00:00 · 852 阅读 · 0 评论 -
POJ题目分类
初期: OJ上的一些水题(可用来练手和增加自信) poj3299,poj2159,poj2739,poj1083,poj2262,poj1503,poj3006,poj2255,poj3094 一、基本算法: (1)枚举:poj1753,poj2965 (2)贪心:poj1328,poj2109,poj2586 (3)递归和分治法 (4)递推 (5)构造法:poj3295转载 2013-09-21 13:44:07 · 806 阅读 · 0 评论