![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
图论
Zerotogether
TungWah High School
展开
-
UVA 929 Number Maze 优先队列-BFS
模板题,带有优先队列的BFS#include <iostream>#include <queue>#include <cstring>using namespace std;int const MAXN=1000;struct Node{ int x,y; long long d; Node():x(),y(),d(){} Node(int x,int y,int d):x(x),y(y),d(d){} bool operator<(con.原创 2021-01-22 08:36:09 · 184 阅读 · 0 评论 -
UVA 10608 - Friends
模板题,求最大的连通分量的成员数量。#include <iostream>#include <vector>#include <cstring>using namespace std;const int MAXN=30002;bool visited[MAXN];vector<int> g[MAXN];int T,N,M,cnt=0;void dfs(int v){ visited[v]=true; cnt++; for(int..原创 2021-01-21 15:37:00 · 174 阅读 · 0 评论 -
UVA 336 - A Node Too Far
题目描述To avoid the potential problem of network messages (packets) looping around forever inside a network,each message includes a Time To Live (TTL) field. This field contains the number of nodes (stations,computers, etc.) that can retransmit the message原创 2021-01-21 10:54:13 · 224 阅读 · 0 评论