码迷,mamicode.com
首页 >  
搜索关键字:poj 2007 scrambled p    ( 20315个结果
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
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 3270 Cow Sorting(置换群)
题目链接题意 : N头牛,每个牛的坏脾气都有一个值,每个值都不相同,把这个值按照从小到大排序,如果两个值交换,那么会花掉这两个值之和的时间,让你花最少的时间将每个值从小到大排好序,求最小的总时间。思路 : 这个在黑书上有写,就是置换群,248页有写。写的挺详细的。每个状态都可以分为若干个循环的乘积。...
分类:其他好文   时间:2014-06-09 13:41:20    阅读次数:253
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 3349 hash的运用
哈希函数思想在查找中是非常重要的一个思想。在数据结构中我们学习的都只是一些简单的函数 比如: 相加取余 相乘取余 相除取余 。。。。 哈希函数在查找中可以在O(1)时间中查找到数据的位置。 哈希函数的关键在于函数的选取 , 然而不管选择怎么样的函数 , 一般都会存在冲突 , 但是如果函数选取得得当,那么冲突就会减小。 poj 3349是一题简单的hash题 我们选取的...
分类:其他好文   时间:2014-06-08 04:43:01    阅读次数:241
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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!