
树的直径,重心
UCAS王小二
不念过去,不畏未来...
展开
-
hdu 2631 Roads in the North【树的直径+前向星存图】
Roads in the NorthTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 2933 Accepted: 1442DescriptionBuilding and maintaining roads among communities in th原创 2017-08-04 09:43:50 · 339 阅读 · 0 评论 -
LightOJ - 1094 Farthest Nodes in a Tree【bfs+前向星||vector存图】
点击打开题目 1094 - Farthest Nodes in a Tree PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB Given a tree (a connected graph with no cycles), you have to find the farthe原创 2017-08-03 21:51:21 · 332 阅读 · 0 评论 -
1094 - Farthest Nodes in a Tree【前向星+bfs】
点击打开题目1094 - Farthest Nodes in a Tree PDF (English)StatisticsForumTime Limit: 2 second(s)Memory Limit: 32 MBGiven a tree (a connected graph原创 2017-08-04 20:20:16 · 254 阅读 · 0 评论 -
poj 1383 Labyrinth【bfs+队列】
LabyrinthTime Limit: 2000MS Memory Limit: 32768KTotal Submissions: 4184 Accepted: 1564DescriptionThe northern part of the Pyramid contains a very large and原创 2017-08-04 12:26:15 · 335 阅读 · 0 评论 -
POJ - 3107 Godfather【树形dp+树的重心】
GodfatherTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 7728 Accepted: 2741DescriptionLast years Chicago was full of gangster fights and strang原创 2017-11-10 15:53:27 · 349 阅读 · 0 评论 -
HDU 4612 Warm up【双连通缩点(BCC去重边)+染色建新图+树的直径】
Problem Description N planets are connected by M bidirectional channels that allow instant transportation. It’s always possible to travel between any two planets through these channels. If we ca...原创 2018-02-24 15:30:06 · 233 阅读 · 0 评论 -
牛客OI赛制测试赛
A:切题太少,不知道性质,本想拿着矩阵快速幂板子套着大数改改。。。 #include <bits/stdc++.h>using namespace std;string s;int main(){ cin >> s; if((s[s.length() - 1] - '0') & 1) printf("-1\n"); els原创 2018-08-30 11:08:00 · 517 阅读 · 0 评论