算法
文章平均质量分 74
VanciorH
untitled
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
LeetCode Algorithm #7 Reverse Integer
LeetCode Algorithm #7 Reverse Integer 解题原创 2017-09-09 15:35:41 · 392 阅读 · 0 评论 -
POJ 2513、Trie树、并查集以及欧拉路径
这道题做的时候,干的最sb的事就是断点打印的东西没删干净,结果导致一开始怎么交怎么WA,后来怎么交怎么AC。不过仍然有很困惑的地方,就是在优快云 blog中,他的Trie树第二维只有15,但是能过,就很奇怪,而且将其改到应该是正确的26,却Runtime Error。 主要是三个方面,Trie树、并查集和欧拉回路/路径。并查集用于检查是否为连通图,不是必须的,但是可以减少2/3的运行时间,用D...原创 2018-08-17 18:10:10 · 377 阅读 · 0 评论 -
HDU5311、欧拉路径、Hierholzer算法以及其应用
HDU5311、欧拉路径、Hierholzer算法以及其应用 本题可以转换为欧拉路径/欧拉回路做,转换可以有两种方法,求解欧拉路径/欧拉回路也有两种方法。 一种转换方式来自bilibili(题号为1003),通过成对连接所有度数为奇数的点,使其成为一个欧拉图,求得欧拉回路之后,将其中添加的边裁去即可。一种转换方式来自cnblog,每次连接到只剩一对度数为奇数的点,从这两点中求得欧拉路径,当然其...原创 2018-08-09 22:08:32 · 6662 阅读 · 0 评论 -
POJ 1860 3253 1035 2388 3349
图算法 最短路径算法 1860 18-07-30 经优快云 blog的点拨,知道了这道题其实是求正环,只有存在正环,才能让资金不断得增长。我感觉正环可以分为两种(该正环的要求是其中不包含有正环),一种是不经过原有货币,一种是经过原有货币。第一种比如例题中,正环为2323232323…,另一种则比如123123123123…这样兑换。 正环存在的判断方法之一是存在某点作为松弛操作的...原创 2018-07-31 14:43:26 · 272 阅读 · 0 评论 -
POJ 3299 1753 1328 3295 1068
POJ reference 水题 3299 18-06-07 声明变量要放在while里面,不然会有上一次循环的残留 %.1f可以自动做round #include <iostream> #include <string> #include <sstream> #include <cmath> #includ原创 2018-07-13 20:20:59 · 252 阅读 · 0 评论 -
Leetcode Algorithm #28 Implement strStr()
Leetcode Algorithm #28 Implement strStr() 题目内容 Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Example 1: Input...原创 2018-04-21 18:53:55 · 247 阅读 · 0 评论 -
Leetcode Algorithm #53 Maximum Subarray
Leetcode Algorithm #53 Maximum Subarray 题目内容 Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. Example: ...原创 2018-05-01 20:04:06 · 284 阅读 · 0 评论 -
LeetCode Algorithm #9 Palindrome Number
LeetCode Algorithm #9 Palindrome Number 解题原创 2017-09-22 16:40:54 · 359 阅读 · 0 评论 -
LeetCode Algorithm #14 Longest Common Prefix
LeetCode Algorithm #14 Longest Common Prefix 解题原创 2017-09-28 20:03:39 · 351 阅读 · 0 评论 -
LeetCode Algorithm #13 Roman to Integer
LeetCode Algorithm #13 Roman to Integer 解题原创 2017-09-26 18:46:46 · 357 阅读 · 0 评论 -
LeetCode Algorithms #1 Two Sum
LeetCode Algorithms #1 Two Sum 解题原创 2017-08-30 11:11:07 · 388 阅读 · 0 评论 -
POJ 2488 3278
简单搜索 深度优先搜索 2488 18-08-23 这道题如果没有看到深搜的分类,可能思路这么清晰,并且知道是深搜之后也是愣了一下才想到。 主要在于如何将一个走棋的问题转换为一个图,由于走马对于走的方向是由强制性规定的,所以可以将每一个格子看作无向图中的一个顶点,如果两个格子之间符合“日”字走法,则这两个顶点之间有一条边,于是是否能遍历所有格子则变成了是否能够不回头的走完所有点,后...原创 2018-08-25 23:56:32 · 329 阅读 · 0 评论
分享