上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 59 下一页
摘要: /*矩阵快速幂: 第n个人如果是m,有f(n-1)种合法结果 第n个人如果是f,对于第n-1和n-2个人有四种ff,fm,mf,mm其中合法的只有fm和mm 对于ffm第n-3个人只能是m那么有f(n-4)种 对于fmm那么对于第n... 阅读全文
posted @ 2014-09-23 15:12 HYDhyd 阅读(127) 评论(0) 推荐(0) 编辑
摘要: /*题意:给n个电脑,求一个点到这n个电脑的距离和最小。模拟退火法:和poj1379的方法类似因为坐标范围是0-10000不妨把它看成是10000*10000的正方形来做*/#include#include#include#include#define inf 10000000000000using... 阅读全文
posted @ 2014-09-23 10:44 HYDhyd 阅读(144) 评论(0) 推荐(0) 编辑
摘要: /*模拟退火法: 找到一些随机点,从这些点出发,随机的方向坐标向外搜索; 最后找到这些随机点的最大值; 坑://if(xx>-eps&&xx-eps&&yy#include#include#include#define pi acos(-1.0)#define N 1100#define i... 阅读全文
posted @ 2014-09-22 17:41 HYDhyd 阅读(160) 评论(0) 推荐(0) 编辑
摘要: /*模拟实例:331 10 552 10 3361 3 2 11 4 2 11 5 211 6 211 7 2 15 20 81 2 3 4 51 20 850 20 82423345445*/#include#include#define N 2100000int a[N];int num;in... 阅读全文
posted @ 2014-09-22 12:20 HYDhyd 阅读(161) 评论(0) 推荐(0) 编辑
摘要: HDU 5035 Delivery 题解题解数学概率期望表示今年刚学概率论//https://www.zybuluo.com/rihkddd/note/34286题目大意:Matt一个发快递,快递点有N个职员,职员处理一个客户的时间服从指数分布:f(t)=λe−λt,其中的参数λ为职员的效率,现在给... 阅读全文
posted @ 2014-09-22 11:31 HYDhyd 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 转载:http://blog.csdn.net/wdcjdtc/article/details/39318847之前各种犯傻 推了好久这个东西。。后来灵关一闪 就搞定了。。矩阵的题目,就是构造矩阵比较难想!题意:给出一个矩阵的第一列和第一行(下标从0开始),(0,0)位置为0,第一行为,233,23... 阅读全文
posted @ 2014-09-19 19:36 HYDhyd 阅读(117) 评论(0) 推荐(0) 编辑
摘要: /*状态转移方程:dp[i][j]=Max(dp[i][j],dp[i-1][k]+sum[i][j]);*/#include#include#define N 16int ma[N][N];int num[N];char s[150];int lower[15];//储存二级制int dp[N... 阅读全文
posted @ 2014-09-19 16:58 HYDhyd 阅读(106) 评论(0) 推荐(0) 编辑
摘要: /*步数最小的不一定是时间最少的常规的bfs只能求出步数最少的。而在这题中一个点可以多次走,所以必须记录最优的那个值*/#include#include#includeusing namespace std;#define inf 0x3fffffff#define N 300char s[N]... 阅读全文
posted @ 2014-09-19 11:27 HYDhyd 阅读(149) 评论(0) 推荐(0) 编辑
摘要: /*现将相同的合并计数。再枚举判断是否符合当cou==n*n是符合就退出*/#include#include#define N 900int en[N][4],num[N],real[N][4],len,n,ok;void pp(int a[4],int b[4])//赋值{ a[0]=b... 阅读全文
posted @ 2014-09-18 13:43 HYDhyd 阅读(130) 评论(0) 推荐(0) 编辑
摘要: hdu 5017 http://blog.csdn.net/mypsq/article/details/39340601#include #include #include #include using namespace std;const int D[8][2] = {{0, 1}, {0,... 阅读全文
posted @ 2014-09-17 20:42 HYDhyd 阅读(114) 评论(0) 推荐(0) 编辑
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 59 下一页