- 博客(9)
- 收藏
- 关注
原创 hdu-1596-find the safest road
很裸的一个Floyd算法实现最短路径问题点此看原题Problem Description XX星球有很多城市,每个城市之间有一条或多条飞行通道,但是并不是所有的路都是很安全的,每一条路有一个安全系数s,s是在 0 和 1 间的实数(包括0,1),一条从u 到 v 的通道P 的安全度为Safe(P) = s(e1)*s(e2)…*s(ek) e1,e2,ek是P 上的边 ,现在8600 想出去旅游
2016-08-14 20:26:38 275
原创 poj-3233-Matrix Power Series
矩阵快速幂点此查看原题链接Description Given a n × n matrix A and a positive integer k, find the sum S=A+A2+A3+…+Ak.S = A + A^2 + A^3 + … + A^k. Input The input contains exactly one test case. The first line of
2016-08-04 19:24:26 221
原创 hdu-2289-Cup
经典二分 点击打开链接看原题 Problem Description The WHU ACM Team has a big cup, with which every member drinks water. Now, we know the volume of the water in the cup, can you tell us it height? The rad
2016-08-02 20:14:48 240
原创 hdu-1969-Pie
二分题 Problem Description My birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my friends are coming
2016-08-02 20:01:34 239
原创 hdu-2141-Can you find it?
二分经典题 Problem Description Give you three sequences of numbers A, B, C, then we give you a number X. Now you need to calculate if you can find the three numbers Ai, Bj, Ck, which satisfy the formu
2016-08-02 19:54:55 327 2
原创 hdu-2199-Can you solve this equation?
这道题算得上是最简单的二分了,但是有很大的坑,所以超时的时候让我哭笑不得 点击打开链接看原题 Problem Description Now,given the equation 8*x^4 + 7*x^3 + 2*x^2 + 3*x + 6 == Y,can you find its solution between 0 and 100; Now please try your lucky.
2016-08-02 19:27:46 227
原创 尺取法还是蚯蚓法
尺取法,顾名思义,像尺子一样,一块一块的截取。是不是感觉从字面很难理解?我们直接看例题:poj-3061 题目翻译: 给定长度为N的数列整数a0,a1,a2,a3 ….. an-1以及整数S。求出综合不小于S的连续子序列的长度的最小值。如果解不存在,则输出0。 限制条件: 10
2016-08-02 10:00:51 487
原创 二分+三分模板
二分适用于 单调函数(单调增或单调减)。 基本思想 { 1, 2, 4, 5, 7, 9, 13,25, 37 } 给定9个数,由小到大排列,从这9个数中找出某一个确切的数(比如4) 伪代码 int binary_sreach(int a[], int left, int right, int x) { left = 0, right = n - 1; /左闭右开
2016-08-01 20:44:14 369
原创 矩阵快速幂取模
矩阵快速幂=矩阵乘法+快速幂矩阵乘法 伪代码实现Mat operator*(Mat a,Mat b) { Mat c; for i:0 --> len for j:0-->len c.mat[i][j] = 0; for k:0-->len
2016-08-01 14:50:46 1719
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人