自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Darge.

while(1)

  • 博客(42)
  • 收藏
  • 关注

原创 Markdown使用(Typora)

Markdown使用(Typora)文章目录Markdown使用(Typora)目录设置标题倾斜、加粗、下划线、高亮上标、下标无序列表、有序列表、任务列表行内代码、代码块、行内公式表格引用、超链接、分割线目录[TOC] + 回车设置标题# + 1~6 或 ctrl + 1~6(ctrl+或ctrl-调整标题)正文为 0倾斜、加粗、下划线、高亮倾斜:*XXX* 或 ctrl+i加粗:**XXX** 或 ctrl+b下划线:<u>XXX</u> 或 ctrl+u

2021-12-31 15:06:25 305

原创 vim常用操作

vim常用指令插入模式按「i」切换进入插入模式,从光标当前位置开始输入文件按「a」进入插入模式后,是从目前光标所在位置的下一个位置开始输入文字按「o」进入插入模式后,是插入新的一行,从行首开始输入文字从插入模式切换为命令行模式按「ESC」键移动光标vim可以直接用键盘上的光标来上下左右移动正规的vim是用小写英文字母h 左移一格j 下移一格k 上移一格l 右移一格空格 向右退格 向左回车 移动到下一行首减号 移动到上一行首ctrl + b 屏幕往“后”移动一页

2021-10-20 15:18:38 365

原创 最短路SPFA—0 or 1(HDU - 4370)

题目链接:>_>题目:0 or 1Given a nn matrix C ij (1<=i,j<=n),We want to find a nn matrix X ij (1<=i,j<=n),which is 0 or 1.Besides,X ij meets the following conditions:1.X 12+X 13+…X 1n=12...

2020-01-17 13:37:50 160

原创 最短路dijkstra—The Shortest Path in Nya Graph(HDU - 4725)

题目链接:>_>题目:The Shortest Path in Nya GraphThis is a very easy problem, your task is just calculate el camino mas corto en un grafico, and just solo hay que cambiar un poco el algoritmo. If you ...

2020-01-16 18:33:18 181

原创 最短路SPFA—Extended Traffic(LightOJ - 1074)

题目链接:>_>题目:Extended TrafficDhaka city is getting crowded and noisy day by day. Certain roads always remain blocked in congestion. In order to convince people avoid shortest routes, and hence t...

2020-01-15 19:38:03 168

原创 最短路dijktra—Tram(POJ-1847)

题目链接:>_>题目:TramTram network in Zagreb consists of a number of intersections and rails connecting some of them. In every intersection there is a switch pointing to the one of the rails going ou...

2020-01-15 19:35:08 130

原创 最短路dijkstra—昂贵的聘礼(POJ-1062)

题目链接:>_>题目:昂贵的聘礼年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:"嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的水晶球,那么只要5000金币就行了。“探险家就跑到大祭司那里,向他要求皮袄或水晶球...

2020-01-15 19:32:39 418

原创 最短路dijkstra—Subway(POJ-2502)

题目链接:>_>题目:SubwayYou have just moved from a quiet Waterloo neighbourhood to a big, noisy city. Instead of getting to ride your bike to school every day, you now get to walk and take the subway...

2020-01-15 19:26:34 267

原创 最短路SPFA—Candies(POJ - 3159)

题目链接:>_>题目:CandiesDuring the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large bag of candies and had flymous...

2020-01-15 19:24:21 161

原创 最短路dijkstra—Invitation Cards(POJ-1511)

题目链接:>_>题目:Invitation CardsIn the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They want to propagate theater and, m...

2020-01-15 19:22:04 155

原创 最短路SPFA—Arbitrage(POJ-2240)

题目链接:>_>题目:ArbitrageArbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of the same currency. For example, suppose that...

2020-01-15 19:18:48 138

原创 最短路floyde—Cow Contest(POJ - 3660)

题目链接:>_>题目:Cow ContestN (1 ≤ N ≤ 100) cows, conveniently numbered 1…N, are participating in a programming contest. As we all know, some cows code better than others. Each cow has a certain con...

2020-01-15 19:15:02 102

原创 最短路dijkstra—MPI Maelstrom(POJ - 1502)

题目链接:>_>题目:MPI MaelstromBIT has recently taken delivery of their new supercomputer, a 32 processor Apollo Odyssey distributed shared memory machine with a hierarchical communication subsystem....

2020-01-14 16:06:21 138

原创 最短路SPFA—Wormholes(POJ - 3259)

题目链接:>_>题目:WormholesWhile exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to its ...

2020-01-14 16:01:44 109

原创 最短路spfa—Currency Exchange(poj-1860)

题目链接:>_>题目:Currency ExchangeSeveral currency exchange points are working in our city. Let us suppose that each point specializes in two particular currencies and performs exchange operations o...

2020-01-14 15:58:40 246

原创 最短路dijikstra—Silver Cow Party(POJ - 3268)

题目链接:>_>题目:Silver Cow PartyOne cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1…N is going to attend the big cow party to be held at farm #X (1 ≤ X ≤ N). A total of M (1 ≤ M ≤ 1...

2020-01-14 15:54:54 92

原创 最短路dijkstra—Heavy Transportation(poj 1797)

题目链接:>_>题目:Heavy TransportationBackgroundHugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether there ...

2020-01-13 15:27:55 104

原创 最短路floyde—Frogger(poj2253)

题目链接:>_>题目:FroggerFreddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but since the water is dirty...

2020-01-13 14:03:07 128

原创 2019 多校第二场 HDU 6600

题目链接:>_>题目:Just Skip The ProblemY_UME has just found a number x in his right pocket. The number is a non-negative integer ranging from 0 to 2n−1 inclusively. You want to know the exact value ...

2019-10-30 20:22:23 117

原创 快读快写模板

模板代码#include<bits/stdc++.h>using namespace std;inline int read(){ int X = 0, F = 1; char C = getchar(); while (C < '0' || C>'9'){ if (C == '-'){ F = -1; } C = getchar(); }...

2019-10-30 19:31:07 705 5

原创 ST表模板

输入格式第一行包含两个整数 N, M ,分别表示数列的长度和询问的个数。第二行包含 N 个整数,依次表示数列的第 i 项。接下来 M行,每行包含两个整数l,r,表示查询的区间为 [i,r]。输出格式输出包含 M行,每行一个整数,依次表示每一次询问的结果。#include<bits/stdc++.h>using namespace std;int a[100005];i...

2019-10-23 21:02:25 738

原创 2019牛客国庆day2 K-2018

题目:题目大意:输入a,b,c,d,在a ~ b, c ~ d中选两个数,使两数相乘是2018的倍数,输出情况数。代码:#include<bits/stdc++.h>using namespace std;int main() { long long a, b, c, d; while (~scanf("%lld %lld %lld %lld", &amp...

2019-10-04 10:22:34 118

原创 HDU-3986 最短路(SPFA+记录路径)

题目链接:>_>题目:Harry Potter and the Final BattleThe final battle is coming. Now Harry Potter is located at city 1, and Voldemort is located at city n. To make the world peace as soon as possible, ...

2019-09-26 20:28:40 173

原创 spfa+链式前向星(模板)

解决问题单源最短路,负环图代码模板#include<bits/stdc++.h>using namespace std;const long long inf = 0x3f3f3f3f;const int maxn = 10005;const int maxm = 500005;int n, m, s, cnt = 0;int dis[maxn], vis[maxn]...

2019-09-17 19:13:27 100

原创 POJ 2387 dijkstra+链式前向星+优先队列优化(模板)

题目链接:>_>题目:Til the Cows Come HomeBessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie nee...

2019-09-16 19:58:35 181

原创 HDU 1245 最短路(floyd)

题目链接:>_>Saving James BondThis time let us consider the situation in the movie “Live and Let Die” in which James Bond, the world’s most famous spy, was captured by a group of drug dealers. He w...

2019-09-11 21:21:41 163

原创 VS C4996 解决方法

新手在使用VS的过程中会出现这样的错误error C4996: ‘scanf’: This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.解决...

2019-08-29 22:36:18 357

原创 权值线段树

权值线段树什么是权值线段树权值线段树有什么用权值线段树的构建与查询什么是权值线段树权值线段树是线段树的一种,但是它与线段树不同;线段树的每个结点是用来维护一段区间的最大值或总和;而权值线段树的每个结点储存的一段区间有多少个数;权值线段树有什么用权值线段树主要用来查询区间第k大或者第k小的值;权值线段树的构建与查询现在有一个数组x[10]={1,5,3,2,4,8,3,2,1,1}...

2019-08-28 09:52:09 637 1

原创 POJ 2104(主席树)

主席树板子题目链接:>_>题意:询问区间第k大的值代码:#include<stdio.h>#include<iostream>#include<algorithm>#include<vector>using namespace std;const int MAXN = 1e5 + 10;int n, m, cnt,...

2019-08-27 16:25:00 135 1

原创 位运算

&规定两对应位都为1则为1,否则为0|规定两对应位其中有1则为1,否则0^规定两对应位相同则为0,不同为1~规定两对应位按位求补<<将二进制数按指定左移几位,移掉的省略,右边缺失的位,用0补齐>>将二进制数按指定右移几位,移掉的省略,左边缺失的位,(该数是正数)用0补齐,(该数是负数)用1补齐>>>将二进制数按指定...

2019-08-27 16:20:01 73 1

原创 01字典树模板

01字典树主要用于解决求异或最值的问题开头初始化(全程一遍),再insert(x);传每个点,建树。typedef long long LL;#define MAXN 100005int tol; //节点个数 LL val[32 * MAXN]; //点的值 int ch[32 * MAXN][2]; //边的值 void init(){ //初始化 tol = 1; ch...

2019-08-27 16:17:41 104 1

原创 线段树模板

//线段树模板#include<bits/stdc++.h>using namespace std;#define MAXN 100005int ans=0; //用于单点查询输出答案int x; //单点查询的点 int y; //单点查询修改的值 int c; ...

2019-08-26 15:41:13 89 1

原创 树状数组基础

树状数组定义优缺点树状数组的结构定义百度百科:传送优缺点优点:写起来方便缺点:功能少,不能解决复杂的区间问题树状数组的结构

2019-08-26 15:38:15 106 1

原创 CodeForces - 900B(模拟除法)

题意:给你一个分数a/b,和一个目标数c,将a/b转化为小数,看小数点后第几位为目标数,如果没有,输出-1,a, b, c (1 ≤ a < b ≤ 10^5, 0 ≤ c ≤ 9)思路:模拟除法,使用map记录被除数,如果后面出现记录过的被除数,输出-1。代码:#include<stdio.h>#include<algorithm>#include&l...

2019-07-25 09:08:15 126

原创 HDU-2846(Trie)

题目大意:n个商品,m个字符串查询,对每个查询输出含有查询串为子串的商品个数解题思路:字典树,但是来自同一个串的后缀的相同前缀只能统计一次题目链接:>_<A C 代码:#include<stdio.h>#include<iostream>#include<string.h>using namespace std;const int N...

2019-07-23 14:33:44 114

原创 唯一分解定理

一个数一定可以分解成n=p1 ^ a1*p2 ^ a2……pn ^ an数是由合数和质数构成,合数又可以分解成质数和合数,最后递归下去就会变成质数的乘积。36的因子有1,2,3,4,6,9,12,18,36共9个,36=4 * 9(或者6 * 6)=2 * 2 * 3 * 3=2^ 2 * 3 ^ 2根据唯一分解定理(1+2)*(1+2)=9求n的因子个数(1+a1) * (1+a2...

2019-07-19 16:32:09 121

原创 零基础后缀数组

后缀数组后缀数组的定义详讲后缀数组倍增算法基数排序倍增算法过程后缀数组的应用最长公共前缀单个字符串的相关问题重复子串子串个数回文子串连续重复子串两个字符串的相关问题多个字符串的相关问题写的很好的后缀数组论文功能快捷键合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants创建一个自定义列表...

2019-07-18 13:15:29 191 1

原创 坐标离散化讲解

离散化,就是把无限空间中有限的个体映射到有限的空间中去,以此提高算法的时空效率。简单来讲就是把分布大,数量少的数据进行集中化处理。坐标离散化的思想理解起来很简单大致有三部分:1.排序使用sort函数排序2.去重使用unique()unique的作用是“去掉”容器中相邻元素的重复元素(不一定要求数组有序),它会把重复的元素添加到容器末尾(所以数组大小并没有改变),而返回值是去重之后的...

2019-07-16 16:34:01 2294 4

转载 计算几何超详细讲解

看这位大佬的: 地址

2019-07-14 10:39:03 279

原创 彻底搞懂马拉车(Manacher)

Manacher算法,又叫“马拉车”,它可以在时间复杂度和空间复杂度都是O(n)的情况下,求出一个字符串的最长回文串长度。回文串的基本解法       以每一个点为中心对称点,每次保留最长回文子串的长度,最后得到的就是最长回文子串的长度,但是这样的时间复杂度为O(n^2),并且奇偶回文串是不一样的,比如“aba”的对称中心为...

2019-07-03 20:28:57 20195 7

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除