![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
时夜
此人很懒,真的很懒。
展开
-
俺的线段树模板(区间更新+单点更新+结构体)
板子 #include <iostream> #include <algorithm> #include <stdio.h> #define mx 100005 typedef long long ll; using namespace std; typedef struct node { ll l,r; ll data; }nodee; nod...原创 2019-10-24 10:15:31 · 195 阅读 · 0 评论 -
Dungeon Master(BFS)多层迷宫
Dungeon Master Problem Description You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. It takes one m...原创 2019-04-24 23:37:43 · 1000 阅读 · 0 评论 -
bfs+路径保存 poj3984
bfs+路径保存 #include<iostream> #include <queue> #include <cstring> using namespace std; typedef struct nodee { int x; int y; int step; }node; int sz[2][4] = {0,1,0,-1,1,0,-1...原创 2019-05-17 23:27:30 · 1230 阅读 · 0 评论 -
POJ2236 Wireless Network 并查集
Wireless Network 题目链接:http://poj.org/problem?id=2236 这道题是一个简单的并查集,唯一不同的是,一开始所有点都是不可用的,要进行一个操作才能将点维修好,还有一个就是查询,基本没啥改变,就是一个并查集板子题吧。 另外要提到的就是路径压缩的问题,虽然这道题并没有这个要求,但在其他的题目上可能会需要压缩路径来节约许多查找的时间 如下: int find...原创 2019-08-10 18:07:58 · 747 阅读 · 1 评论 -
牛客假日团队赛11-H-过河卒
链接:https://ac.nowcoder.com/acm/contest/1077/H 来源:牛客网 题目描述 如图,A 点有一个过河卒,需要走到目标 B 点。卒行走规则:可以向下、或者向右。同时在棋盘上的任一点有一个对方的马(如上图的C点),该马所在的点和所有跳跃一步可达的点称为对方马的控制点。例如上图 C 点上的马可以控制 9 个点(图中的P1,P2 … P8 和 C)。卒不能通过对方马的...原创 2019-08-22 15:05:16 · 189 阅读 · 0 评论 -
初出茅庐(半步筑基)-简单优先队列
题目描述 现在秦天通过入口关卡,同时也有其他人通过,下来是一个组队副本,现在有n个人通过入口关卡 第i个修士的战力为v[i],队伍的战力是队伍内所有修士的战力之和。 但是这些修士有特殊的要求:如果选了第i个修士,这个修士希望队伍的人数不超过s[i]。(如果不选第i个修士,就没有这个限制。) 秦天是这次带队师兄,现在要组一只队伍,他想知道最大的战力是多少 输入 第一行包含一个正整数n(1≤n≤10...原创 2019-09-05 10:56:50 · 232 阅读 · 0 评论