- 博客(10)
- 收藏
- 关注
原创 POJ3258 什么东西过河?? 贪心+二分, 贪心的证明????
蒙是蒙对了搞不懂贪心怎么证明我猜的-------------------------------------------------------用左端点的控制范围,然后一直选最左边的来缩短该点的左侧控制范围!但是不明白最后end点怎么考虑。可能是考虑end点的左控制范围???????或者end被删除和值钱点被删除是等效的?/?不懂了
2017-08-19 22:50:31 191
原创 POJ 3735 矩阵快速幂
Training little catsTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 14555 Accepted: 3602DescriptionFacer's pet cat just gave birth to a brood of little
2017-08-19 22:16:03 132
转载 poj 3273 二分枚举
转http://www.cnblogs.com/wolf-yasen/p/6557729.htmlpoj 3273 二分枚举题意:给出一个有n个数据的数组,将其分为连续的m份,找到一种分法,是的m份中最大一份总和最小参考博客:http://blog.csdn.net/qq_22902423/article/details/50601451题解:一种方案中最大的那
2017-08-19 17:45:27 201
原创 POJ3734 比矩阵快速幂简单的方法
using Eigen Value用矩阵特殊值矩阵 2 1 0 的特征向量为 (1,2,1) (-1, 0, 1), 对应的特征值为4, 2;2 2 20 1 2#includeconst int divisor=10007;int n, now;int get_mod(int x, int y){ int mod=y, ans=1; for (int i=
2017-08-16 23:15:43 165
原创 同余与模算术 与 poj1995
let a=(k1n+c), b=(k2n+c), ( k1na*b=k1k2n^2 + dk1n + ck2n + cdab mod n = cd mod n = (a mod n) (b mod n) mod n 2.1 同余性质1: 对任意整数b ab≡bc (mod m) -----------(1) 证
2017-08-16 11:25:27 308
原创 poj1470的输入
Closest Common AncestorsTime Limit: 2000MS Memory Limit: 10000KTotal Submissions: 20607 Accepted: 6550DescriptionWrite a program that takes as input a rooted tree and a list of pairs of vertices. Fo
2017-08-14 22:42:18 151
转载 POJ1330 倍增
//http://www.cnblogs.com/zhouzhendong/p/7255907.html#include #include #include #include #include #include using namespace std;const int N=10000+5;vector son[N];int T,n,depth[N],fa[N][17],i
2017-08-14 21:02:20 205
原创 POJ3461
kmp;next数组意义, next[i]表示, 匹配到key[i]失败时,i将回退到next[i]来与主串比较。#include#includeint count;char p[10005],s[1000005];//开小会WA? int next[1000005];int lens, lenp;void getnext(){int i
2017-08-10 22:59:02 323
原创 POJ1577 树的遍历
注意建树方法, 不能像线段树一样用i#include#include#define MAXN 26using namespace std;struct Tree{char v;int lch, rch;//这个很重要, 不能像完全二叉树一样建树了, 极端情况有2^25的节点编号 void init(){ lch=rch=0; }}tree[MAXN];
2017-08-10 10:25:20 308
原创 poj1177 Picture 离散 注意排序
参考 http://www.cnblogs.com/kuangbin/archive/2013/04/10/3013437.html但他是错的30 0 1 20 2 1 41 1 2 31230 1 2 22 1 4 21 0 3 112如上这两组数据/*POJ 1177矩形周长并,求轮廓周长这题可以不离散化做的,我做的是离散化以后的
2017-08-05 11:10:53 184
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人