码迷,mamicode.com
首页 >  
搜索关键字:poj 2287 贪心    ( 27395个结果
POJ 1021 人品题
报告见代码。。 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 const int MAX=105; 8 int dir[4][2]={1,0,-1,0,0,1,0,-1}; 9...
分类:其他好文   时间:2014-06-09 23:04:01    阅读次数:261
poj 3026
挺直接的一个题 哎 想复杂了题意:把n*m矩阵中的字母最小生成树求它的边权值之和 只有字母可以分叉 多了一个提取点的过程思路:prime 算法的简单应用#include#include#includeusing namespace std;char map[55][55];int node[55][...
分类:其他好文   时间:2014-06-09 21:29:26    阅读次数:276
poj 1469 COURSES
DescriptionConsider a group of N students and P courses. Each student visits zero, one or more than one courses. Your task is to determine whether it ...
分类:其他好文   时间:2014-06-09 15:36:50    阅读次数:239
poj 1095 Trees Made to Order
http://poj.org/problem?id=1095先求出n个节点数的二叉树的形态有多少种。卡特兰数f[n]=f[n-1]*(4*n-2)/(n+1);再递归求。 1 #include 2 #include 3 #include 4 #define ll long long 5 #de...
分类:其他好文   时间:2014-06-09 15:14:11    阅读次数:167
树的最小支配集,最小点覆盖,最大独立集两种算法
1.基本概念对图G=,最小支配集:从V中取尽量少的点组成一个集合,使得V中剩余的点都与取出来的点有边相连最小点覆盖:从V中取尽量少的点组成一个集合,使得E中所有边都与取出来的点相连最大独立集:从V中取尽量多的点组成一个集合,使得这些点之间没有边相连2.贪心法求树的最小支配集,最小点覆盖,最大独立集模...
分类:其他好文   时间:2014-06-09 14:56:02    阅读次数:215
poj2109
#include #include double n,p;int t; int main(){ while(~scanf("%lf%lf",&n,&p)) { t=int (pow(p,1/n) + 0.5); printf("%d\n",t); } return ...
分类:其他好文   时间:2014-06-09 13:54:21    阅读次数:209
POJ 1175
1 //本来写了个和1021相同的HASH,但没过,于是,抱着侥幸的心理,把它变成距离的四次方, 2 //我就呵呵了。。。 3 //这个题,完全靠概率。当然了,如果是把图翻转来比较,也是可以的。但好像很麻烦。。 4 5 #include 6 #include 7 #inclu...
分类:其他好文   时间:2014-06-09 00:21:45    阅读次数:292
poj 2239 Selecting Courses (二分匹配)
Selecting CoursesTime Limit:1000MSMemory Limit:65536KTotal Submissions:8316Accepted:3687DescriptionIt is well known that it is not easy to select cour...
分类:其他好文   时间:2014-06-08 21:24:48    阅读次数:260
POJ 1573 Robot Motion.
Description A robot has been programmed to follow the instructions in its path. Instructions for the next direction the robot is to move are laid down in a grid. The possible instructions are  ...
分类:其他好文   时间:2014-06-08 04:38:32    阅读次数:386
Crixalis's Equipment
Crixalis's Equipment Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 32768/32768K (Java/Other) Total Submission(s) : 34   Accepted Submission(s) : 14 Font: Times New Roman | Verdana | Georgi...
分类:其他好文   时间:2014-06-08 04:37:14    阅读次数:263
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!