- 博客(17)
- 收藏
- 关注
原创 Fluorescent UVALive - 7063 (状压dp+三次方分解)
FluorescentTime Limit: 3000/3000 MS (Java/Others) Memory Limit: 512000/512000 K (Java/Others)Total Submission(s): 937 Accepted Submission(s): 477 Problem DescriptionMatt, a famous advent...
2018-09-26 23:03:14 189
原创 Black And White HDU - 5113 (dfs+剪枝)
In mathematics, the four color theorem, or the four color map theorem, states that, given any separation of a plane into contiguous regions, producing a figure called a map, no more than four colors a...
2018-09-26 22:01:48 292
原创 Common Subexpression Elimination UVA - 12219 (表达式树)
Common Subexpression Elimination UVA - 12219 题目大意:给出一段表达式,并让其中的重复部分用序号来代替思路:首先针对表达式构建出表达式树,对于出现过了的子树用map储存,再在打印时用一个vis数组来记录这个序号的子树是否打印过了,如果已经打印过了,那么就打印其序号。AC代码:#include<cstdio>#...
2018-09-25 21:59:04 252
原创 Slim Span UVA - 1395 (并查集)
Slim Span UVA - 1395 题目大意:给出m条边,问使n个节点连成一幅连通图的最大边减去最小边的最小值思路:对边按照边权排序,求出在边权从小到大的边序列中连续的可以使点连成图的边的最大值与最小值之差。再求暴力对比。AC代码:#include<algorithm>#include<cstdio>#include<i...
2018-09-25 21:53:17 122
原创 Play on Words UVA - 10129 (欧拉路径)
Play on Words UVA - 10129 题意:给出一些单词,问能否让首尾字母相同的字符串相连,最后形成一个串。思路:不难看出,这是一个欧拉道路问题。简单介绍一下欧拉道路:在欧拉道路中,除了起点和终点,所有的点的入度和出度都相等。(如所有的点的入度都等于出度,那么就形成欧拉回路)并且整幅图是联通的,那么这就形成了欧拉回路、道路。是否联通,我们通常通过并查集判断...
2018-09-25 21:44:12 270
原创 Legacy CodeForces - 787D (线段树优化建图+最短路)
Legacy CodeForces - 787D Rick and his co-workers have made a new radioactive formula and a lot of bad guys are after them. So Rick wants to give his legacy to Morty before bad guys catch them.Th...
2018-09-22 20:37:51 1120
原创 How Many to Be Happy? Gym - 101667E
How Many to Be Happy? Gym - 101667E 题目大意:给出一个无向图,令使得一条边e成为这个图的最小生成树的一条树边需要删去的最少的边的数量为H(e),问H(e)地总和是多少思路:对于一幅图我们构造最小生成树地时候总是先选较小的边再选择较大的边,且一个点数确定的图(假设为m)其边数也是确定的m-1,想要e进入这幅图的最小生成树就要让所有边权小于e...
2018-09-19 23:25:00 492
原创 网络流解决k次区间覆盖问题
前两题焦作赛区的网络预选赛上,出现了一个k次覆盖区间问题。当时第一想法是线段树优化建图,但是也不会这个,所以当时就放过去了。赛后补题的时候发现这题可以通过网络流直接建模解决。首先我们来看一个例题Intervals POJ - 3680 You are given N weighted open intervals. The ith interval covers (ai, bi) ...
2018-09-17 19:38:36 1586
原创 ACM-ICPC 2018 徐州赛区网络预赛 B.BE, GE or NE(博弈论+暴力搜索)
In a world where ordinary people cannot reach, a boy named "Koutarou" and a girl named "Sena" are playing a video game. The game system of this video game is quite unique: in the process of playing th...
2018-09-11 11:03:40 198
原创 ACM-ICPC 2018 徐州赛区网络预赛 J.Maze Designer(最大生成树+lca)
After the long vacation, the maze designer master has to do his job. A tour company gives him a map which is a rectangle. The map consists of N \times MN×M little squares. That is to say, the height o...
2018-09-10 17:20:08 203
原创 ACM-ICPC 2018 徐州赛区网络预赛 A. Hard to prepare(递推)
A. Hard to prepare 题库链接 262144KAfter Incident, a feast is usually held in Hakurei Shrine. This time Reimu asked Kokoro to deliver a Nogaku show during the feast. To enjoy the show, every audience ...
2018-09-10 09:10:32 309
原创 ACM-ICPC 2018 沈阳赛区网络预赛 K-Supreme Number
Supreme Number 题库链接A prime number (or a prime) is a natural number greater than 11 that cannot be formed by multiplying two smaller natural numbers.Now lets define a number NN as the supreme ...
2018-09-09 10:11:59 255
原创 ACM-ICPC 2018 沈阳赛区网络预赛 F题 Fantastic Graph
F. Fantastic Graph 题库链接"Oh, There is a bipartite graph.""Make it Fantastic."X wants to check whether a bipartite graph is a fantastic graph. He has two fantastic numbers, and he wants to let all ...
2018-09-09 00:35:40 526
原创 1037D - Valid BFS?(思维+bfs)
D. Valid BFS?time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe BFS algorithm is defined as follows.Consider an undirected gr...
2018-09-04 09:15:43 470
原创 1037B - Reach Median(模拟)
1037B - Reach Mediantime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array aa of nn integers and an integer ss. I...
2018-09-03 20:45:32 235
原创 1037A - Packets(二进制想法)
1037A - PacketsA. Packetstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou have nn coins, each of the same value of 11.Dist...
2018-09-03 19:15:29 261
原创 ACM-ICPC 2018 南京赛区网络预赛 J题Sum
A square-free integer is an integer which is indivisible by any square number except 11. For example, 6 = 2 \cdot 36=2⋅3 is square-free, but 12 = 2^2 \cdot 312=22⋅3 is not, because 2^222 is a square n...
2018-09-01 19:39:11 977 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人