随笔分类 - 图论
摘要:E. Plan of Lectures Ivan is a programming teacher. During the academic year, he plans to give 𝑛 lectures on 𝑛 different topics. Each topic should be
阅读全文
摘要:E. Prefix Enlightenment time limit per test3 seconds memory limit per test256 megabytes There are n lamps on a line, numbered from 1 to n. Each one ha
阅读全文
摘要:D. Catowice City In the Catowice city next weekend the cat contest will be held. However, the jury members and the contestants haven't been selected y
阅读全文
摘要:E. Connected Components? You are given an undirected graph consisting of n vertices and edges. Instead of giving you the edges that exist in the graph
阅读全文
摘要:C. Sum Balance Ujan has a lot of numbers in his boxes. He likes order and balance, so he decided to reorder the numbers. There are 𝑘 boxes numbered f
阅读全文
摘要:D. 0 1 MST Ujan has a lot of useless stuff in his drawers, a considerable part of which are his math notebooks: it is time to sort them out. This time
阅读全文
摘要:Fibonacci Tree 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=4786 Description Coach Pang is interested in Fibonacci numbers while Uncle Yang wants h
阅读全文
摘要:A Buying A House 题意:给你n个房间,妹子住在第m个房间,你有k块钱,你想买一个离妹子最近的房间。其中相邻的房间之间距离为10,a[i]=0表示已经被别人买了。 题解:扫一遍更新答案即可。 include using namespace std; const int maxn = 1
阅读全文
摘要:B. Legacy 题目连接: http://codeforces.com/contest/786/problem/B Description Rick and his co workers have made a new radioactive formula and a lot of bad g
阅读全文
摘要:Anastasia and pebbles 题意:你有两种框,每个框可以最多装k重量的物品,但是你每个框不能装不一样的物品。现在地面上有n个物品,问你最少多少次,可以把这n个物品全部装回去。 题解:其实就是问你得用多少次框,然后把多少次除以2就好了。每次装k的物品装回去就好了。 代码: includ
阅读全文
摘要:E. Tree Folding 题目连接: http://codeforces.com/contest/765/problem/E Description Vanya wants to minimize a tree. He can perform the following operation m
阅读全文
摘要:C Cleaning 题目连接: http://agc010.contest.atcoder.jp/tasks/agc010_c Description There is a tree with N vertices, numbered 1 through N. The i th of the N−
阅读全文
摘要:4337: BJOI2015 树的同构 题目连接: http://www.lydsy.com/JudgeOnline/problem.php?id=4337 Description 树是一种很常见的数据结构。 我们把N个点,N 1条边的连通无向图称为树。 若将某个点作为根,从根开始遍历,则其它的点都
阅读全文
摘要:B. Drazil and Tiles 题目连接: http://codeforces.com/contest/516/problem/B Description Drazil created a following problem about putting 1 × 2 tiles into an
阅读全文
摘要:Xtreme9.0 Communities 题目连接: https://www.hackerrank.com/contests/ieeextreme challenges/challenges/communities Description Social media networks and the
阅读全文
摘要:F. st Spanning Tree 题目连接: http://codeforces.com/contest/723/problem/F Description You are given an undirected connected graph consisting of n vertices
阅读全文
摘要:E. One Way Reform 题目连接: http://codeforces.com/contest/723/problem/E Description There are n cities and m two way roads in Berland, each road connects
阅读全文
摘要:3245: 最快路线 题目连接: http://www.lydsy.com/JudgeOnline/problem.php?id=3245 Description 精明的小R每每开车出行总是喜欢走最快路线,而不是最短路线.很明显,每条道路的限速是小R需要考虑的关键问题.不过有一些限速标志丢失了,于是
阅读全文
摘要:Problem D. Distance 题目连接: http://codeforces.com/gym/100714 Description In a large city a cellular network operator is holding a competition for subscr
阅读全文
摘要:Body Building 题目连接: https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=4919 Description Bowo is fe
阅读全文