摘要:
https://blog.csdn.net/weixin_43272781/article/details/83515067 https://blog.csdn.net/weixin_43272781/article/details/83418431 阅读全文
posted @ 2019-01-17 17:15
DWVictor
阅读(205)
评论(0)
推荐(0)
摘要:
想了解更多:click here... HERE.. 一、最短路径 ①在非网图中,最短路径是指两顶点之间经历的边数最少的路径。 AE:1 ADE:2 ADCE:3 ABCE:3 ②在网图中,最短路径是指两顶点之间经历的边上权值之和最短的路径。 AE:100 ADE:90 ADCE:60 ABCE:7 阅读全文
posted @ 2019-01-17 17:13
DWVictor
阅读(2779)
评论(0)
推荐(1)
摘要:
不用说这两位都是冷门算法……毕竟O(n^3)的时间复杂度算法在算法竞赛里基本算是被淘汰了……而且也没有在这个算法上继续衍生出其他的算法… 有兴趣的话:click here.. 话说学离散的时候曾经有个把warshall算法简化到1/2时间的想法……不过懒得去翻了,现在想想本来这两个不用矩阵而用位运算 阅读全文
posted @ 2019-01-17 17:11
DWVictor
阅读(2595)
评论(0)
推荐(0)
摘要:
一、圆周率π计算 二、数学公式 π = 2 + 1/3 * (2 + 2/5 * (2 + 3/7 * (2 + ... (2 + k/2k+1 * (2 + ... ))...))) 三、分析 要想计算出无限精度的PI,我们需要上述的迭代公式运行无数次,并且其中每个分数也是完全精确的,这在计算机中 阅读全文
posted @ 2019-01-17 17:09
DWVictor
阅读(4994)
评论(0)
推荐(0)
摘要:
【解题思路】 给一张神图,推理写的灰常明白了,关键是构造共轭函数,这一点实在是要有数学知识的理论基础,推出了递推式,接下来就是矩阵的快速幂了。 神图: 给个大神的链接:构造类斐波那契数列的矩阵快速幂 /* * Problem: HDU No.4565 * Running time: 62MS * C 阅读全文
posted @ 2019-01-17 17:06
DWVictor
阅读(302)
评论(0)
推荐(0)
摘要:
题目:HDU4565 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=4565 题意: 求 f(x) = ceil( (a +sqrt(b))^n ) 我们设An = (a +sqrt(b))^n , Bn =(a - sqrt(b))^n; Cn = 阅读全文
posted @ 2019-01-17 17:03
DWVictor
阅读(795)
评论(0)
推荐(0)
摘要:
题目描述 Description 给你6个数,m, a, c, x0, n, g Xn+1 = ( aXn + c ) mod m,求Xn m, a, c, x0, n, g<=10^18 输入描述 Input Description 一行六个数 m, a, c, x0, n, g 输出描述 Out 阅读全文
posted @ 2019-01-17 17:02
DWVictor
阅读(594)
评论(0)
推荐(0)
摘要:
gcd欧几里德算法 求取最大公约数gcd(a,b) 这个不用多说了 extgcd拓展欧几里德算法 用于求解 ax+by=gcd(a,b)的解 这个要多说一下 ax+by=c,(a,b,c都是常数) 这就是一个直线方程嘛!(x,y)就是一条直线的轨迹 但是呢 我们在计算机中经常要求一些离散的东西,也就 阅读全文
posted @ 2019-01-17 17:01
DWVictor
阅读(790)
评论(0)
推荐(0)
摘要:
题目如下:A straight is a poker hand containing five cards of sequential rank, not necessarily to be the same suit. For example, a hand containing 7 club, 阅读全文
posted @ 2019-01-17 17:00
DWVictor
阅读(476)
评论(0)
推荐(0)
摘要:
摔手机 摔手机 动态规划 在蓝桥杯的时候遇到一次 当时没有做对 看了题解也没明白 如今再次遇到这个类似的题目 于是拿出来补补吧摔手机题目如下:星球的居民脾气不太好,但好在他们生气的时候唯一的异常举动是:摔手机。各大厂商也就纷纷推出各种耐摔型手机。x星球的质监局规定了手机必须经过耐摔测试,并且评定出一 阅读全文
posted @ 2019-01-17 17:00
DWVictor
阅读(1649)
评论(4)
推荐(0)
摘要:
费了好大劲写完的 用线段树维护的 nlogn的做法再看了一下 大神们写的 nlogn 额差的好远我写的又多又慢 大神们写的又少又快时间 空间 代码量 哪个都赶不上大佬们的代码 //这是大神们的 #include<stdio.h> #include<string.h> #include<iostrea 阅读全文
posted @ 2019-01-17 16:59
DWVictor
阅读(409)
评论(0)
推荐(0)
摘要:
输入挂 比一般的输入挂还快一些 但这个输入挂使用了之后就不能再使用其它的输入函数了 typedef long long LL; namespace IStream { const int L = 1 '9'); c = get_char()); if (c == EOF) return EOF; if (c == '-') { sgn = -1; ... 阅读全文
posted @ 2019-01-17 16:59
DWVictor
阅读(182)
评论(0)
推荐(0)
摘要:
const int POW = 18; void dfs(int u,int fa){ d[u]=d[fa]+1; p[u][0]=fa; for(int i=1;i d[b] ) a ^= b, b ^= a, a ^= b; if( d[a] = 0; i-- ) if( p[a][i] != p[b][i] ) a = p[a][i] , b = p[b][i]; a... 阅读全文
posted @ 2019-01-17 16:58
DWVictor
阅读(192)
评论(0)
推荐(0)
摘要:
#include #include #include using namespace std; struct node{ int v[26],p; void init(){memset(v,0,sizeof(v));p=0;} }t[1001000]; char str[15],mm[15]; int cnt; void update(int &rt,int k,int c){... 阅读全文
posted @ 2019-01-17 16:57
DWVictor
阅读(280)
评论(0)
推荐(0)
摘要:
参与考古挖掘的小明得到了一份藏宝图,藏宝图上标出了 nn 个深埋在地下的宝藏屋, 也给出了这 nn 个宝藏屋之间可供开发的mm 条道路和它们的长度。 小明决心亲自前往挖掘所有宝藏屋中的宝藏。但是,每个宝藏屋距离地面都很远, 也就是说,从地面打通一条到某个宝藏屋的道路是很困难的,而开发宝藏屋之间的道路 阅读全文
posted @ 2019-01-17 16:56
DWVictor
阅读(727)
评论(0)
推荐(0)
摘要:
#include #include #include #include #include using namespace std; const int maxn = 1e6+7; char str[maxn]; int sa[maxn],tp[maxn],rak[maxn],tax[maxn],a[maxn],M,N; // sa代表着 排名第i小的下标是什么 // rak 代表 下标为i... 阅读全文
posted @ 2019-01-17 16:56
DWVictor
阅读(211)
评论(0)
推荐(0)
摘要:
//splay模版 #include #include #include #include #include #include using namespace std; #define MAX 500100 int root=0,N,tot=0; inline int read() { register int x=0,t=1; register char ch=... 阅读全文
posted @ 2019-01-17 16:56
DWVictor
阅读(214)
评论(0)
推荐(0)
摘要:
今天被拓展二进制搞了 可怜我还做题时 还说这题一定不是数位dp直接被打脸了 #1331 : 扩展二进制数 #1331 : 扩展二进制数 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 我们都知道二进制数的每一位可以是0或1。有一天小Hi突发奇想:如果允许使用数字2会发生 阅读全文
posted @ 2019-01-17 16:55
DWVictor
阅读(568)
评论(0)
推荐(0)
摘要:
题目描述 永无乡包含 nn 座岛,编号从 11 到 nn ,每座岛都有自己的独一无二的重要度,按照重要度可以将这 nn 座岛排名,名次用 11 到 nn 来表示。某些岛之间由巨大的桥连接,通过桥可以从一个岛到达另一个岛。如果从岛 aa 出发经过若干座(含 00 座)桥可以 到达岛 bb ,则称岛 a 阅读全文
posted @ 2019-01-17 16:54
DWVictor
阅读(301)
评论(0)
推荐(0)
摘要:
ZOJ Problem Set - 4053 CouleurTime Limit: 6 Seconds Memory Limit: 131072 KB DreamGrid has an array of integers. On this array he can perform the follo 阅读全文
posted @ 2019-01-17 16:53
DWVictor
阅读(392)
评论(0)
推荐(0)

浙公网安备 33010602011771号