Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
L3-014 周游世界 (30 分)
题目 题目链接 题解 DFS 采用的数据结构 vector 索引为起点 值为 终点 起点公司编号 当然你也可以保存终点公司编号 但是代码中的语句就需要改一下了 dfs 传入四个信息 当前节点 遇到的节点数 换乘数 当前节点所在公司的编号 由
PTA
图论
DFS
PAT考试
算法
[Nowcoder / POJ2728] 最优比率生成树
Nowcoder链接 POJ链接 题目描述 David the Great has just become the king of a desert country To win the respect of his people he d
图论
算法
[UVA1364
评测地址 网址1 网址2 题目描述 题意 给出n位骑士 然后有m个关系 每个关系以格式 a b a b a b给出 表达骑士 a a
图论
图论
tarjan
点双联通分离
图的连通性
【01规划】POJ 3621 Sightseeing Cows
POJ 3621 Sightseeing Cows 题意 给定一张 n 个点 m 条边的有向图 每个点都有一个权值 f i 每条边都有一个权值 t i 求图中的一个环 使 环上各点的权值之和 除以 环上各边的权值之和 最大 输出这个最大值
数学
图论
图论
算法
[leetcode] 2039. 网络空闲的时刻
题目链接 题意 给定一张n个点不含重边的无向图 点的编号从0开始到n 1 两点之间如果有连边 可以认为耗时为1秒 1 gt n 1的点都需要向0号点发送消息 从第0秒开始 在0号收到消息之后 会回复消息 从第一秒开始 如果1 gt n 1号
图论
LeetCode
DFS BFS
广度优先
[洛谷] [NOIP2018 提高组] 旅行 加强版 - 基环树
题目链接 https www luogu com cn problem P5049 题目描述 小 Y 是一个爱好旅行的 OIer 她来到 X 国 打算将各个城市都玩一遍 小Y了解到 X国的 n 个城市之间有 m 条双向道路 每条双向道路连接
图论
算法
概率论
[洛谷 P3376] 网络最大流
题目链接 题目描述 如题 给出一个网络图 以及其源点和汇点 求出其网络最大流 输入格式 第一行包含四个正整数 n n n m m m s
图论
算法
[Nowcoder
题目描述 There s a new art installation in town and it inspires you to play a childish game The art installation consists of
图论
DFS BFS
算法
L3-005 垃圾箱分布 (30 分)
题目 题目链接 题解 对每个垃圾箱进行一次队列优化的Dijskra 每算出一个垃圾箱到其余各个居民点的最短距离后 计算这些距离中的最大距离 最短距离 如果最大距离大于要求的距离则直接忽略这个位置放垃圾桶的情况 否则 如果最短距离小于已经记录
图论
PTA
PAT考试
算法
c
HDU-2063过山车
题目链接 http acm hdu edu cn showproblem php pid 2063 解题思路 匈牙利算法 二分图模板 代码 include
图论
图论
算法
c
[Atcoder ABC222] F - Expensive Expense
Time Limit 4 sec Memory Limit 1024 MB Score 500 points Problem Statement The Kingdom of AtCoder is composed of N N N tow
图论
数据结构
数据结构
图论
算法
SPFA 算法模板
SPFA 代替 Dijkstra 计算最短路 题目 题目链接 题解 SPFA 一般时间复杂度为 O m O m O m 最坏情况下为 O
基础算法模板
图论
图论
算法
c
APAC 2013 部分题解
目录 A The Alphabet Sticker C Increasing Shortest Path D Cup of Cowards E Balloons Colors F NASSA s Robot G The Stones Gam
动态规划
图论
思维
图论
[Nowcoder] Agamemnon‘s Odyssey
链接 Agamemnon the great king of Mycenae was assembling his troops in Aulis to sail to the shores of Troy when he had a vi
图论
c
算法
[UPC] 2021秋组队17
目录 A Quality Adjusted Life Year B Gwen s Gift C Forest for the Trees D H Index E Driving Lanes F Treasure Spotting G Nei
图论
c语言
Group Project-思维
链接 来源 牛客网 题目描述 The big day has fifinally arrived today you are going to form groups of two in which you will do the end
思维
图论
L3-018 森森美图 (30 分)
题目 题目链接 题解 BFS 先看看样例咋出来的吧 判断某个坐标属于起点终点连线的哪一侧的时候 我们采用是将点代入起点终点的两点式中根据正负值判断 两次bfs更新起点到终点的 距离 bfs每次扩展一个点 用起点到该点的 距离 更新其八个方向
图论
BFS
PTA
c
算法
Tree with Maximum Cost---CF1092F 树上DP
F Tree with Maximum Cost time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstand
图论
动态规划
[P3074
题目描述 Farmer John s N cows 1 lt N lt 10 000 are conveniently numbered 1 N Each cow i takes T i units of time to milk Unfo
图论
算法
[HDU 4738] Caocao‘s Bridges
Problem Description Caocao was defeated by Zhuge Liang and Zhou Yu in the battle of Chibi But he wouldn t give up Caocao
图论
STL和技巧题
算法
1
2
»