题集
break_dream
正在懵逼中
展开
-
Labyrinth(2020 CCPC 威海 B)
文章目录原题链接题目大意思路代码原题链接题目大意走迷宫,一个n*m的图,有k个地方毁坏(称为黑洞),有q次询问:问(x1,y1)到(x2,y2)的最小移动次数思路显然,暴力跑q边bfs不行!然后就看见42个黑洞点。想着用这42个黑洞点。以这42个黑洞点跑bfs就可以了!但是,下面这个图怎么处理呢?(蓝色部分为黑洞)答案:特判呗!以u,v作为对顶点的矩形内是否有黑洞,如果没有直接就是曼哈顿距离,否则就以黑洞点跑bfs注意:在走路的时候不能经过黑洞,所以以黑洞周围的四个点为准跑bfs。然后就原创 2022-02-10 22:19:32 · 103 阅读 · 0 评论 -
图论题集(更新中)
1、全面战争 51Nod - 2891题目大意:有N个点,M条边,一张图,K1个点为源点,K2个点为终点。求:从任意一个源点到任意终点的最短路。半句题解:合并一个总源点原题链接https://www.51nod.com/Challenge/Problem.html#problemId=2891...原创 2022-01-05 23:40:47 · 414 阅读 · 0 评论 -
Adventurer‘s Guild(CF)
一种解法:纯粹的01背包#include<iostream>#include<cstring>#include<algorithm>using namespace std;typedef long long ll;const int N = 1e3 + 7;ll dp[305][305];int n, H, S;ll h[N], s[N], w[N];int main(){ cin >> n >> H >.原创 2021-09-18 20:24:04 · 148 阅读 · 0 评论 -
5倍经验值
原题链接:https://www.luogu.com.cn/training/212#problems原创 2021-08-25 19:07:19 · 47 阅读 · 0 评论 -
最长公共子序列
原题链接:https://www.luogu.com.cn/problem/P1439原创 2021-08-25 19:02:48 · 45 阅读 · 0 评论 -
滑雪DP问题
原题链接:https://www.luogu.com.cn/problem/P1434原创 2021-08-25 18:59:14 · 103 阅读 · 0 评论 -
排水问题!
Drainage machinesDescriptionCity R has flood every year. Now given a chorography of a place, consisted of n sections. Each section is described by height hiand its seeper’s horizontal height H. Thus, we need to put some drainage machines in proper sectio原创 2021-08-24 07:57:24 · 107 阅读 · 0 评论 -
电话号问题
Phone ListDescriptionGiven a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. Let’s say the phone catalogue listed these numbers:Emergency 911Alice 97 625 999Bob 91 12 54 26In the case, it’s n原创 2021-08-22 23:22:21 · 212 阅读 · 0 评论 -
贪吃的松鼠
贪吃的松鼠Description冬天到了,n只松鼠决定一起采集一波坚果过冬,可是在松鼠老大清点的时候,发现少了一些食物,于是召开松鼠大会,知道是有一只小松鼠偷吃了一部分食物!可是他们只知道每一个松鼠运了m个,但是某一个只松鼠运了k个,请找出这个松鼠!(本题时限3s限制内存256M)Input输入有多组数据,每组第一行包含三个数n,m,k(n<=100000,1<m<=9,k<m)。然后输入m*(n-1)+k个数,第i个数表示运送第i个坚果的松鼠编号,编号范围在2^30以内。原创 2021-08-22 23:16:20 · 236 阅读 · 0 评论