ICode9

精准搜索请尝试: 精确搜索
  • 【luogu P8063】Shortest paths(图论)2022-07-18 15:34:12

    Shortest paths 题目链接:luogu P8063 题目大意 给你一个无向图,然后给你最短路的路径,然后对于最短路上的每条边问你把它删掉之后图的最短路是多少,如果没有路径就输出 -1。 思路 (看旁边老哥开的题,麻了把自己搞不会了) (还得看我们的 wyc 大神) 考虑怎么弄,那感性的思想家就是最短路没了

  • # $\text{The K-th Shortest Path - }A^*$2022-07-06 20:04:38

    \(k\) 短路模板。 应该是有另解的... \(\text{Luogu P2680}\) \(\large\to\text{Link}\leftarrow\) 放个代码: #include <bits/stdc++.h> #define pii pair <int, int> #define Mp make_pair #define xi first #define yi second #define LL long long #define rg regi

  • Difference between MST and DIJKSTRA2022-06-22 00:04:58

    MST -- Minumum Spinning Tree https://www.geeksforgeeks.org/kruskals-minimum-spanning-tree-algorithm-greedy-algo-2/?ref=leftbar-rightbar 简化一个图, 在保证所有节点连接的前提下,最小化连接代价。 What is a Spanning Tree? A Spanning tree is a subset to a connected

  • leetcode 934. Shortest Bridge 最短的桥(中等)2022-06-07 23:32:49

    一、题目大意 标签: 搜索 https://leetcode.cn/problems/shortest-bridge 在给定的二维二进制数组 A 中,存在两座岛。(岛是由四面相连的 1 形成的一个最大组。) 现在,我们可以将 0 变为 1,以使两座岛连接起来,变成一座岛。 返回必须翻转的 0 的最小数目。(可以保证答案至少是 1 。)

  • Neo4j Fundamentals-Graph Structure2022-05-04 11:04:22

    Neo4j Fundamentals Graph Thinking The Seven Bridges Graph Elements Graph Structure Graphs Are Everywhere Property Graphs What is a Property Graph? Native Graph Advantage Non-graph Databases to Graph Your First Graph The Movie Graph Your

  • 【floyed求最小环】【鸽巢原理】D. Shortest Cycle2022-03-10 08:31:06

    【floyed求最小环】【鸽巢原理】D. Shortest Cycle D. Shortest Cycle 给定n个数,若存在两个数,它们相与的结果不为0,则在它们之间连上一条线,求在这些操作后最小环的大小。 观察一下,每一个数字是小于等于1e18的,也就是每一个数字在二进制下最多只需要60位就能表达清楚。 同时若某一个

  • D8:Shortest Path(最短路径)2022-01-24 23:04:41

    原题:OpenJudge - 07:Shortest Path 翻译: 描述:有一个有 N 个点的图。给定点之间每条边的长度。求从 S 到 E 的最短路径; 输入:第一行:三个正整数N、S、E (N不超过100,S和E不超过N);            接下来的 N 行:第 i 行包含 N 个非负整数,表示从第 i 个点到任意点的边长; 输出:一

  • 英文翻译72022-01-23 22:33:11

    OpenJudge - 07:Shortest Path 描述 There is a graph with N nodes. Given the length of each edge between the nodes. Find the shortest path from S to E. 输入 First line: three positive integer number N (N <= 100), S (S <= N), E(E <= N). Next N lines: th

  • Go language implementation: Dijkstra, Floyd, Yen's k-shortest paths Algorithm2021-12-09 17:32:45

    https://github.com/KeepTheBeats/routing-algorithms Go language implementation: - shortest paths through dfs - shortest paths through Dijkstra - use Disjoint Set to check whether a network is connected - shortest paths through Floyd - k-shortest paths thr

  • CF1051F The Shortest Statement 题解2021-11-11 18:05:09

    题目链接 给定一个树,在树上加k条边,求全源最短路。(\(n \le 10^5 \space, k \le 20\)) 显然利用树的性质,考虑如何处理加的20条边即可。可以枚举所有经过的非树边,对每个非树边的端点依次更新答案,再结合树上路径长度即可。 最小生成树+lca+dij即可解决的一道紫题... 写的时候要注意不

  • [cf1599G]Shortest path2021-10-23 09:33:55

    题意:给n个点,其中n-1个共线,指定一个起点,每次可从一个点沿直线移动至另一个点,点可重复访问,问访问过所有点至少一次的最短路径。 首先我们肯定要找出不共线的那个点。按x坐标将n个点排序,计算出所有相邻两点的斜率,只要点数大于等于四,那么和其它不同的两个斜率之间的点就是不共线的点

  • Shortest Cycle(floyd求最小环路+抽屉原理)2021-10-16 22:06:48

    题目链接Problem - 1205B - Codeforces Shortest Cycle 给定 n n n个数,数据范围为 [ 0 ,

  • 次短路2021-10-03 23:02:06

    题目链接 poj3255 Roadblocks Time Limit: 2000MS Memory Limit: 65536K Description Bessie has moved to a small farm and sometimes enjoys returning to visit one of her best friends. She does not want to get to her old home too quickly, because she likes the scen

  • CF742 (Div. 2) B2021-09-06 11:33:38

    MEXor Mixup(源地址自⇔CF742B) Problem Alice gave Bob two integers \(a\) and \(b\) ( \(a>0\) and \(b≥0\) ). Being a curious boy, Bob wrote down an array of non-negative integers with \(MEX\) value of all elements equal to \(a\) and \(XOR\) val

  • 多目标蚁群算法路径规划(2.5)-----从数据设计到毕业论文系列--番外篇2021-05-30 12:01:00

    多目标蚁群算法路径规划(2.5)------番外篇 系列前言(一定要看) 本系列为总结本人近一年多关于启发式算法解决路径规划的相关内容。主要从以下几个主题内容进行系列写作1.常见的数据获取方式与处理过程、,2、算法的基础流程,3.常见算法改进,4.多目标排序、5.基于应用场景的改进、6.其

  • D. Shortest and Longest LIS2021-04-12 21:59:18

    https://codeforces.com/problemset/problem/1304/D Gildong recently learned how to find the longest increasing subsequence (LIS) in O(nlogn)O(nlog⁡n) time for a sequence of length nn. He wants to test himself if he can implement it correctly, but he could

  • 【源码】校园导航系统(迪杰斯特拉)2021-04-10 09:29:50

    文章目录 题目介绍功能源码效果展示联系我 题目介绍 代码量:380 题目介绍: 知识点:图,三维数组等数据结构。采用迪杰斯特拉算法求最短路径、最短时间 功能 源码效果展示 部分源码及效果展示 我们可以加入中间点来查询路径的最快时间和最短路径 void show4(int i,int j,

  • CF1051F The Shortest Statement2021-02-12 22:02:18

    题面传送门 zyq扒原题不要脸! 题目要我们求图上任意两点间最短路。 这个显然很难解决。 于是我们可以观察一下数据范围。 然后就可以发现一个奇怪的事情,最多只是生成树上加\(21\)条边。 考虑先随便搞出一棵生成树。然后对于这\(21\)条边强制走,剩下的生成树上lca即可。 然而,这道题z

  • POJ2001 Shortest Prefixes2021-01-20 20:33:04

    描述 传送门:我是传送门 A prefix of a string is a substring starting at the beginning of the given string. The prefixes of “carbon” are: “c”, “ca”, “car”, “carb”, “carbo”, and “carbon”. Note that the empty string is not considered a prefix in thi

  • 合肥市出行地铁路径规划——基于Dijkstra算法2020-12-23 17:57:42

    合肥市出行地铁路径规划——基于Dijkstra算法 1. 引言 2. 导入相应的模块 3. 申请高德地图的API 4. 获取合肥地铁数据 5. 计算合肥各地铁站点之间的距离 6.寻找最近的地铁站 7. 运用Dijkstra算法进行路径规划 8. 封装打包 9. 是骡子是马拉出来遛遛 引言 本此博文的完成是数

  • 运小筹(2020-11-9): Shortest Path Problem及其对偶问题的一些探讨(附Python调用Gurobi实现) README2020-12-15 17:29:08

    运小筹(2020-11-09): Shortest Path Problem及其对偶问题的一些探讨(附Python调用Gurobi实现) 文章目录 运小筹(2020-11-09): Shortest Path Problem及其对偶问题的一些探讨(附Python调用Gurobi实现)Shortest Path Problem及其对偶问题的一些探讨(附Python调用Gurobi实现)I

  • Shortest Prefixes2020-12-02 21:32:59

    Aimee 很简单的字典树 不知道为什么,写了struct就会TLE #include<iostream> #include<cstring> #include<cstdio> #include<cstring> using namespace std; struct tr{ int vis; string str; int ne[31]; }tree[100001]; int Aimee=1; int x; int Ai; char ss[1101]

  • LeetCode #243. Shortest Word Distance2020-12-01 11:05:14

    题目 243. Shortest Word Distance 解题方法 设置三个变量word1的当前索引 word1ind = -len(words)、word2的当前索引 word2ind = len(words)、最小距离distance = len(words),遍历数组,当遇到word1或word2时更新其当前索引,并更新distance = min(distance, abs(word1ind - word2ind

  • Dijkstra2020-09-03 19:32:02

    #include "Dijkstra.h" #include <vector> #include <list> #include <cmath> Dijkstra::Dijkstra(int vertexCount) { this->v = vertexCount; this->adj = new vector<int>[v]; } list<int> Dijkstra::search(int

  • CF1051F The Shortest Statement2020-08-18 09:33:13

    题意简述 题目链接   给定一张n个点m条边的无向图,满足m-n<=20,然后进行q次操作,每次给定两个点,询问两点间最短路。   数据范围:1<=n,m,q<=105。 算法概述   只看题面显然是个裸的全源最短路,但是再看数据范围……显然不是全源最短路。   所以这时候就需要发挥我们的聪明才

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有