08 2019 档案
摘要:题目描述: Maxim and Array time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Recently Maxim has
阅读全文
摘要:题目描述: Playlist time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You have a playlist consi
阅读全文
摘要:题目描述: Kilani and the Game time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Kilani is play
阅读全文
摘要:题目描述: High Load time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output Arkady needs your help a
阅读全文
摘要:题目描述: 题目背景 这是一道模板题 题目描述 由小学知识可知,n个点$(x_i,y_i)$可以唯一地确定一个多项式 现在,给定n个点,请你确定这个多项式,并将k代入求值 求出的值对998244353取模 输入格式 第一行两个正整数n,k,含义如题 接下来nnn行,每行两个正整数x_i,y_i,含义
阅读全文
摘要:题目描述: The Sum of the k th Powers time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output There a
阅读全文
摘要:题目描述: The Brand New Function time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Polycarpus
阅读全文
摘要:题目描述: Sagheer and Nubian Market time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output On his t
阅读全文
摘要:题目描述: Soldier and Number Game time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output Two soldie
阅读全文
摘要:Manacher算法求最长回文字串 算法思路 按照惯例((・◇・)?),这里只是对算法的一些大体思路做一个描述,因为找到了相当好理解的博客可以参考(算法细节见 参考文章 )。 一般而言,我们的判断回文算法的思想是从一个点开始向两边拓展直到无法拓展为止,这个时候就得到了回文串的长度,但这个算法的时间复
阅读全文
摘要:题目描述: Kyoya and Colored Balls time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Kyoya Ooto
阅读全文
摘要:题目描述: C. Producing Snow time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Alice likes snow
阅读全文
摘要:题目描述: Ice Skating time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Bajtek is learning to
阅读全文
摘要:题目描述: Prime Gift time limit per test 3.5 seconds memory limit per test 256 megabytes input standard input output standard output Opposite to Grisha's
阅读全文
摘要:题目描述: Password time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Asterix, Obelix and their
阅读全文
摘要:题目描述: Bad Luck Island time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The Bad Luck Islan
阅读全文
摘要:题目描述: Match Points time limit per test 2 seconds memory limit per test 256 mega bytes input standard input output standard output You are given a set
阅读全文
摘要:求逆元的四种算法 拓展欧几里得算法求逆元 "上一篇博客中" 已经讲过拓展欧几里得算法,并且讲解了求逆元的原理。这里只列出代码 在要求逆元的数与p互质时使用 代码 c++ //费马小定理 long long q_pow(long long a,long long b,long long p) { lo
阅读全文
摘要:拓展欧几里得算法 先来看看一个重要的基本定理 裴蜀定理 对于整数a,b,他们关于x,y的线性不定方程$ax+by=d$,设$gcd(a,b)=g$,则可证明$g|d$,换句话说,就是 g是a,b的最小线性组合 。 证明: 设$ax+by=d$,$g=gcd(a,b)$,设$ax+by$的最小值为s,
阅读全文
摘要:题目描述: 题目描述 如题,给出一个网络图,以及其源点和汇点,求出其网络最大流。 输入格式 第一行包含四个正整数N、M、S、T,分别表示点的个数、有向边的个数、源点序号、汇点序号。 接下来M行每行包含三个正整数ui、vi、wi,表示第i条有向边从ui出发,到达vi,边权为wi(即该边最大流量为wi)
阅读全文
摘要:KM(Kuhn Munkres)算法求带权二分图的最佳匹配 相关概念 这个算法个人觉得一开始时有点难以理解它的一些概念,特别是新定义出来的,因为不知道是干嘛用的。但是,在了解了算法的执行过程和原理后,这些概念的意义和背后的作用就渐渐的显示出来了。因此,先暂时把相关概念列出来,看看,有个大概印象就好,
阅读全文
摘要:二分图匹配 相关概念 无向二分图$G(U\bigcup V,E)$ :U是一个顶点集合,V是另一个顶点集合,对于一个集合内的点无边直接相连,而对于不同集合的点可以连边,即$(u,v)\in E$。 匹配 :两两不含公共端点的边的集合M称为匹配(就是两个集合之间连的边,只不过不同边的端点不能重合) 最
阅读全文
摘要:KMP算法模板 原理 见参考文章 模板 c++ include include define max_n 100005 using namespace std; char s[max_n] = {'a','a','b','a','a','a','b','c'}; char p[max_n] = {'
阅读全文
摘要:题目描述: Ciel the Commander time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Now Fox Ciel bec
阅读全文
摘要:点分治模板 点分治: 这里统一地,只讲一下主要思想,各种细节留给 参考文章 。 点分治的主要是处理树上的路径问题,如果用暴力做法求解会有很高的时间复杂度$O(n^2) O(n^3)$的样子。而如果使用点分治,就可以将复杂度降为$O(nlog_2n)$。主要思路是将一棵树分解成若干子树,在分解成子树的
阅读全文
摘要:题目描述: Vessels time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output There is a system of n ves
阅读全文
摘要:题目描述: Maximum Value time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given a seque
阅读全文
摘要:题目描述: Little Elephant and Interval time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The L
阅读全文
摘要:题目描述: Farmer John has installed a new system of N−1N 1N−1 pipes to transport milk between the NNN stalls in his barn (2≤N≤50,0002 \leq N \leq 50,0002≤
阅读全文
摘要:题目描述: Alyona and a tree time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Alyona has a tre
阅读全文
摘要:倍增法求lca(最近公共祖先) 基本上每篇博客都会有参考文章,一是弥补不足,二是这本身也是我学习过程中找到的觉得好的资料 思路: 大致上算法的思路是这样发展来的。 想到求两个结点的最小公共祖先,我们可以先把两个的深度提到同一水平,在一步一步往上跳,直到两个结点有了一个公共祖先,依照算法流程,这就是l
阅读全文
摘要:题目描述: Jzzhu and Cities time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Jzzhu is the pres
阅读全文
摘要:题目描述: Mouse Hunt time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Medicine faculty of Ber
阅读全文
摘要:Tarjan算法分解强连通分量 算法思路: 算法通过dfs遍历整个连通分量,并在遍历过程中给每个点打上两个记号:一个是时间戳,即首次访问到节点i的时刻,另一个是节点u的某一个祖先被访问的最早时刻。 时间戳用DFN数组存储,最早祖先用low数组来存,每次dfs遍历到一个节点u,即让这两个记号等于当前时
阅读全文
摘要:题目描述: Game on Tree time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Momiji has got a roote
阅读全文
摘要:链式前向星 在之前先来看一下边集数组。 边集数组是图的表示法的一种,前向星是边集数组的一种,链式前向星是前向星的一种。 前向星 前向星是把边的起点从小到大排序,起点一样按同样的规则排终点。所以前向星使用之前要$O(nlog_2n)$排序一下。 使用两个数组,一个head,head[i]记录以i为起点
阅读全文
摘要:题目描述: Malek Dance Club time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output As a tradition, ev
阅读全文
摘要:题目描述: Bus Number time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output This night wasn't easy o
阅读全文
摘要:题目描述: Inna and Nine time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Inna loves digit 9 ve
阅读全文
摘要:题目描述: You are given an array consisting of n monotonic renumeration as an array b consisting of $n$integers such that all of the following conditions
阅读全文
摘要:题目描述: Little Pony and Expected Maximum time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Tw
阅读全文
摘要:题目描述: D. Intercity Travelling time limit per test 1.5 seconds memory limit per test 256 megabytes input standard input output standard output Leha is
阅读全文
摘要:初学网络流 这个主题以前没接触过,觉得有点抽象,算法有点不太清楚,看了一些博客,下面,对这些博客做些总结。 引入: 具体参考这篇博客的背景知识讲解部分(具体到代码之前),首先对网络流有了一个初步的印象 https://blog.csdn.net/wzw1376124061/article/detai
阅读全文

浙公网安备 33010602011771号