上一页 1 2 3 4 5 6 7 ··· 11 下一页
摘要: 题目链接:https://vjudge.net/problem/UVA-10765 题目大意:一个无向图中,求去掉每个点后的连通分量的数量。 题解: 这题实际上是求割顶,记录一下割顶的子孙当中反向边不在它之上的连通分量数量,最后加上图初始的连通分量数量。 代码: 阅读全文
posted @ 2017-04-15 20:45 Robin! 阅读(241) 评论(0) 推荐(0) 编辑
摘要: 给你一个长度为N的数组,一个长为K的滑动的窗体从最左移至最右端,你只能见到窗口的K个数,每次窗体向右移动一位,如下表: 你的任务是找出窗口在各位置时的max value,min value. 单调队列的入门题,单调队列我的理解有对时间和大小都单调,只会在队列两端进行操作(队尾前移看大小,队头后移看时 阅读全文
posted @ 2017-04-15 19:45 Robin! 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 点双连通分量模板(Tarjan算法) 1 #include<bits/stdc++.h> 2 using namespace std; 3 #define M(a, b) memset(a, b, sizeof(a)) 4 #define INF 0x3f3f3f3f 5 const int N = 阅读全文
posted @ 2017-04-13 21:44 Robin! 阅读(226) 评论(0) 推荐(0) 编辑
摘要: Description 小明是一个非常浪漫的画家,他喜欢画各种奇奇怪怪的画,虽然没人理解他画的究竟是什么东西。 有一天,他突发奇想,对于一根木条,他每次从木条中选取一个区间[l,r]进行染色,经过多次染色后,他想知道在[a,b]区间中有几个未被染色的子区间? 可惜小明虽然画画非常厉害,但是并不擅长解 阅读全文
posted @ 2017-04-09 15:37 Robin! 阅读(231) 评论(0) 推荐(0) 编辑
摘要: Description You are given a bunch of wooden sticks. Each endpoint of each stick is colored with some color. Is it possible to align the sticks in a st 阅读全文
posted @ 2017-04-07 21:51 Robin! 阅读(137) 评论(0) 推荐(0) 编辑
摘要: Description A supermarket in Tehran is open 24 hours a day every day and needs a number of cashiers to fit its need. The supermarket manager has hired 阅读全文
posted @ 2017-04-07 18:05 Robin! 阅读(189) 评论(0) 推荐(0) 编辑
摘要: Description Once, in one kingdom, there was a queen and that queen was expecting a baby. The queen prayed: ``If my child was a son and if only he was 阅读全文
posted @ 2017-04-06 22:19 Robin! 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 1.HDU-1542 Atlantis Problem Description There are several ancient Greek texts that contain descriptions of the fabled island Atlantis. Some of these t 阅读全文
posted @ 2017-04-02 23:04 Robin! 阅读(364) 评论(0) 推荐(0) 编辑
摘要: Description 在经济全球化浪潮的影响下,习惯于漫步在清晨的乡间小路的邮递员Blue Mary也开始骑着摩托车传递邮件了。 不过,她经常回忆起以前在乡间漫步的情景。昔日,乡下有依次编号为1..n的n个小村庄,某些村庄之间有一些双 向的土路。从每个村庄都恰好有一条路径到达村庄1(即比特堡)。并 阅读全文
posted @ 2017-04-01 19:00 Robin! 阅读(213) 评论(0) 推荐(0) 编辑
摘要: A.调酒师 很水的一道题,算出每个参数的最小值就行,手速选手被碾压的开始QAQ。 1 #include<bits/stdc++.h> 2 using namespace std; 3 4 int main() { 5 //freopen("in.txt", "r", stdin); 6 int T; 阅读全文
posted @ 2017-03-27 22:59 Robin! 阅读(452) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 11 下一页