算法
文章平均质量分 80
ll1243295518
看来
展开
-
啊哈算法
桶排序 #include <bits/stdc++.h> using namespace std; int num[]={0,4,5,9,14,2,18,6,7,8,4,16,1,19,11,17,2,15,10,9,17,5,6,3,20,0,12,4,16,13,8};//下标0~30 ,范围0~20 int bucket[21];//0~20的桶子 int main()...原创 2019-01-11 23:37:27 · 826 阅读 · 0 评论 -
POJ - 1703 Find them, Catch them(种类并查集)
Find them, Catch them Time Limit: 1000MS Memory Limit: 10000KB 64bit IO Format: %I64d & %I64u Submit Status Description The police office in Tadu City decides to say ends to the chaos, as laun...原创 2019-03-10 12:27:28 · 275 阅读 · 0 评论 -
图论算法 floyd,dijkstra,队列优化dijkstra,bellman_ford,队列优化bellman_ford(spfa)克鲁斯卡尔
队列优化dijkstra模板(poj3268) 题目大意:给出n点m边和一个点x,求所有点到x再返回的最短距离的最大值。 思路:先用dijkstra算法求出x到所有点的最短距离,再对除x的所有点用一次dijkstra,得到此点到x点距离最小值,再相加求最大值。 其实用floyd算法似乎更简单,但是 1.此题点有1000个,floyd算法超时 2.此题边有100000个,用邻接矩阵存储,超内存。 ...原创 2019-03-17 20:36:59 · 225 阅读 · 0 评论