码迷,mamicode.com
首页 >  
搜索关键字:algorithm    ( 11758个结果)
1072 Gas Station (30point(s)) 需要二刷 *多源最短路径问题
基本思想: 迪杰斯特拉得翻版,循环求各个节点,最后求最小结果; 关键点: 注意题目要求; #include<iostream> #include<vector> #include<string> #include<algorithm> using namespace std; const int m ...
分类:其他好文   时间:2020-03-26 19:59:10    阅读次数:72
1005 继续(3n+1)猜想
题目: 参考日神的 链接如下:https://blog.csdn.net/richenyunqi/article/details/79491648 代码如下: #include<cstdio> #include<algorithm> #include<iostream> #include<vecto ...
分类:其他好文   时间:2020-03-26 01:12:31    阅读次数:68
北京理工大学复试上机--2012
1、输入十个正整数数字从小到大排序 输入:1 2 5 7 9 10 45 67 24 26 输出:1,2,5,7,9,10,24,26,45,67 #include <iostream> #include <vector> #include <algorithm> using namespace s ...
分类:其他好文   时间:2020-03-26 00:59:55    阅读次数:99
G - Shuffle'm Up POJ - 3087
A common pastime for poker players at a poker table is to shuffle stacks of chips. Shuffling chips is performed by starting with two stacks of poker c ...
分类:其他好文   时间:2020-03-25 01:13:56    阅读次数:53
强连通分量tarjan
``` #include//强连通分量tarjan #include #include #include #include using namespace std; #define maxn 400010 #define INF 1e18 int low[maxn],dfn[maxn],sta[ma... ...
分类:其他好文   时间:2020-03-25 00:58:08    阅读次数:53
NC13230 合并回文子串(区间dp)
从数据范围不难推出可以用f[][][][],表示由两个字符串来表示的最长大小 并且因为是回文串,所以我们要向头尾加字符,来变大,因为这个是回文子串,也就是连续的一段。 #include<iostream> #include<cstdio> #include<algorithm> #include<s ...
分类:其他好文   时间:2020-03-24 23:10:51    阅读次数:69
2019ICPC徐州区域赛 Kill the tree
https://nanti.jisuanke.com/t/42552 以上是交题网站计蒜客 本题要求找到所有子树的所有重心 性质1 : 两棵树合并,新树的重心在两旧树重心连线上 性质2 :子树的重心一定在重儿子上 性质3 :树上所有点到重心的距离的和最小 当siz[root] - siz[x] > ...
分类:其他好文   时间:2020-03-24 19:11:54    阅读次数:177
Benelux Algorithm Programming Contest 2019 (2020-3-21)
B. Breaking Branches 解题思路: 看了半天才看懂什么意思QWQ,就判断一下奇数还是偶数就行了。 AC代码: #include<math.h> #include<stdio.h> #include<algorithm> #include<iostream> #include <st ...
分类:其他好文   时间:2020-03-24 18:35:47    阅读次数:88
2020.3.21 Benelux Algorithm Programming Contest 2019 解题报告
B-Breaking Branches 大意就是两个人掰树枝子玩,是个典型的博弈题,判断能不能被2整除就可以了 #include<cstdio> using namespace std; int main(){ long long int n,m,t; scanf("%lld",&n); if(n% ...
分类:其他好文   时间:2020-03-23 09:57:36    阅读次数:107
模板: 字符串模式匹配 Knuth–Morris–Pratt Algorithm
Knuth–Morris–Pratt Algorithm KMP字符串模式匹配算法 "模板题" Brief Introduction To be updated Algorithm To be updated Template Code ...
分类:其他好文   时间:2020-03-23 09:25:37    阅读次数:48
共11758条   上一页 1 ... 64 65 66 67 68 ... 1176 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!