![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
图论
silzero
这个作者很懒,什么都没留下…
展开
-
2019-02-24-Graph Coloring-POJ1419-图着色问题-最大独立集-最大团问题
POJ-1419-Graph ColoringProblem DescriptionYou are to write a program that tries to find an optimal coloring for a given graph. Colors are applied to the nodes of the graph and the only available ...原创 2019-02-24 22:06:49 · 635 阅读 · 0 评论 -
2019-02-24-Channel Allocation-POJ1129-图着色问题-四色问题-dfs
POJ-1129-Channel AllocationProblem DescriptionWhen a radio station is broadcasting over a very large area, repeaters are used to retransmit the signal so that every receiver has a strong signal. ...原创 2019-02-24 23:10:31 · 548 阅读 · 0 评论 -
2019-02-25-The Stable Marriage Problem-POJ3487-稳定婚姻算法
POJ-3487-The Stable Marriage ProblemProblem DescriptionThe stable marriage problem consists of matching members of two different sets according to the member’s preferences for the other set’s mem...原创 2019-02-25 22:41:59 · 338 阅读 · 0 评论 -
模板-Gale_Shapley稳定婚姻算法
struct Gale_Shapley{ static const int N=60; int n; int fg; int woman[N][N]; //第i个girl对编号j的boy的好感排位 int man[N][N]; //第i个boy第j喜欢的girl int man_match[N],woman_match[N]; //已匹配的男...原创 2019-02-25 22:50:06 · 263 阅读 · 0 评论 -
2019-02-26-University Entrace Examination -ZOJ1023-稳定婚姻算法(变式)
ZOJ-1023-University Entrace ExaminationProblem DescriptionThere is a fierce competition among high-school graduates in Iran to pass the centralized nationwide university entrance examination. Min...原创 2019-02-26 22:49:54 · 318 阅读 · 1 评论 -
2019-02-26-过山车-HDU2063-二分图匹配-匈牙利算法
HDU-2063-过山车Problem DescriptionRPG girls今天和大家一起去游乐场玩,终于可以坐上梦寐以求的过山车了。可是,过山车的每一排只有两个座位,而且还有条不成文的规矩,就是每个女生必须找个个男生做partner和她同坐。但是,每个女孩都有各自的想法,举个例子把,Rabbit只愿意和XHD或PQK做partner,Grass只愿意和linle或LL做partne...原创 2019-02-26 23:22:28 · 207 阅读 · 0 评论 -
模板-BFS
//例:HDU1253#include<bits/stdc++.h>using namespace std;int mm[51][51][51]; //地图bool vis[51][51][51]; //记录数组int dx[6]={1,-1,0,0,0,0};int dy[6]={0,0,1,-1,0,0};int dz[6]={0,0...原创 2019-03-04 08:28:33 · 200 阅读 · 0 评论 -
模板-最短路FLoyd
void floyd(){ for(int k=0;k<n;k++){//遍历中间节点 for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ if(mp[i][j]>mp[i][k]+mp[k][j]){ //如果i->k->j比i->j...原创 2019-03-04 08:34:34 · 582 阅读 · 0 评论 -
模板-拓扑排序
struct TopologicalSort{ const int N=60; //邻接表储存图 vector<int> v[N]; //记录答案序列 vector<int>ans; //记录点i的入度 int in[N]; bool tuopu(int n){ //使用优先队列(优先队列是大顶堆)* priority_queue<i...原创 2019-04-11 19:09:03 · 120 阅读 · 0 评论