-----------------图论
文章平均质量分 65
dxyinme
这个作者很懒,什么都没留下…
展开
-
[HDU6081]度度熊的王国战略
Time Limit: 40000/20000 MS (Java/Others)Memory Limit: 32768/132768 K (Java/Others)Problem Description度度熊国王率领着喵哈哈族的勇士,准备进攻哗啦啦族。哗啦啦族是一个强悍的民族,里面有充满智慧的谋士,拥有无穷力量的战士。所以这一场战争,将会十分艰难。为了更好的进攻哗啦啦族,度度熊决定首先...原创 2019-10-18 00:31:04 · 290 阅读 · 0 评论 -
[hdu6290]奢侈的旅行
Time Limit: 14000/7000 MS (Java/Others)Memory Limit: 512000/512000 K (Java/Others)Problem Description高玩小Q不仅喜欢玩寻宝游戏,还喜欢一款升级养成类游戏。在这个游戏的世界地图中一共有n个城镇,编号依次为1到n。这些城镇之间有m条单向道路,第iii 条单项道路包含四个参数ui,vi,ai,b...原创 2019-10-12 22:17:27 · 193 阅读 · 0 评论 -
[hdu3118]Arbiter
Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 131072/131072 K (Java/Others)Problem DescriptionArbiter is a kind of starship in the StarCraft science-fiction series. The Arbiter-class starship...原创 2019-07-09 18:36:29 · 191 阅读 · 0 评论 -
[codeforces1092F]Tree with Maximum Cost
You are given a tree consisting exactly of nnn vertices. Tree is a connected undirected graph with n−1n−1n−1 edges. Each vertex vvv of this tree has a value ava_vav assigned to it.Let dist(x,y)dist(...原创 2018-12-25 23:52:29 · 166 阅读 · 0 评论 -
[HDU2853]Assignment
Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Problem DescriptionLast year a terrible earthquake attacked Sichuan province. About 300,000300,000300,000 PLA soldiers...原创 2019-01-20 14:38:37 · 195 阅读 · 0 评论 -
[BZOJ3732]Network
Time Limit: 10 SecMemory Limit: 128 MBDescription给你NNN个点的无向图 (1&lt;=N&lt;=15,000)(1 &lt;= N &lt;= 15,000)(1<=N<=15,000),记为:1…N1…N1…N。图中有MMM条边 (1&lt;=M&lt;=30,000)(1 &...原创 2019-02-02 10:57:54 · 183 阅读 · 0 评论 -
[BZOJ1163][Baltic2008]Mafia
Time Limit: 10 SecMemory Limit: 162 MBDescription匪徒准备从一个车站转移毒品到另一个车站,警方准备进行布控. 对于每个车站进行布控都需要一定的代价,现在警方希望使用最小的代价控制一些车站,使得去掉这些车站后,匪徒无法从原定的初始点到达目标点Input第一行输入N,M代表车站的总个数,及有多少条双向边连接它们.2&lt;=n&...原创 2019-01-29 20:36:48 · 149 阅读 · 0 评论 -
[codeforces1118F1]Tree Cutting (Easy Version)
time limit per test : 2 secondsmemory limit per test : 256 megabytesYou are given an undirected tree of nnn vertices.Some vertices are colored blue, some are colored red and some are uncolored. It ...原创 2019-02-20 17:53:15 · 267 阅读 · 0 评论 -
[HDU3899]JLUCPC
Time Limit: 15000/5000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Problem DescriptionDr. Skywind and Dr. Walkoncloud are planning to hold the annual JLU Collegiate Programming Contest...原创 2019-03-03 22:07:56 · 198 阅读 · 1 评论 -
[codeforces1081D]Maximum Distance
time limit per test :1 secondmemory limit per test : 256 megabytesChouti was tired of the tedious homework, so he opened up an old programming problem he created years ago.You are given a connected...原创 2018-12-18 20:31:09 · 559 阅读 · 0 评论 -
[HDU3966]Aragorn's Story
Time Limit: 10000/3000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Problem DescriptionOur protagonist is the handsome human prince Aragorn comes from The Lord of the Rings. One day Ara...原创 2018-12-01 09:31:26 · 392 阅读 · 0 评论 -
[BZOJ2763][JLOI2011]飞行路线
Time Limit: 10 SecMemory Limit: 128 MBDescriptionAlice和Bob现在要乘飞机旅行,他们选择了一家相对便宜的航空公司。该航空公司一共在n个城市设有业务,设这些城市分别标记为000到n−1n-1n−1,一共有mmm种航线,每种航线连接两个城市,并且航线有一定的价格。Alice和Bob现在要从一个城市沿着航线到达另一个城市,途中可以进行转机。航空...原创 2018-11-30 16:31:25 · 107 阅读 · 0 评论 -
[BZOJ3251]树上三角形
Time Limit: 10 SecMemory Limit: 128 MBDescription给定一大小为nnn的有点权树,每次询问一对点(u,v)(u,v)(u,v),问是否能在uuu到vvv的简单路径上取三个点权,以这三个权值为边长构成一个三角形。同时还支持单点修改。Input第一行两个整数n、qn、qn、q表示树的点数和操作数第二行nnn个整数表示nnn个点的点权以下n−1...原创 2018-11-02 20:35:33 · 191 阅读 · 0 评论 -
[BZOJ2208][Jsoi2010]连通数
Time Limit: 20 SecMemory Limit: 512 MBDescriptionInput输入数据第一行是图顶点的数量,一个正整数N。 接下来N行,每行N个字符。第i行第j列的1表示顶点i到j有边,0则表示无边。Output输出一行一个整数,表示该图的连通数。Sample Input3 010 001 100 Sample Output9HINT...原创 2018-10-26 22:29:53 · 185 阅读 · 0 评论 -
[BZOJ1103][POI2007]大都市meg
Time Limit: 10 SecMemory Limit: 162 MBDescription在经济全球化浪潮的影响下,习惯于漫步在清晨的乡间小路的邮递员Blue Mary也开始骑着摩托车传递邮件了。不过,她经常回忆起以前在乡间漫步的情景。昔日,乡下有依次编号为1…n的n个小村庄,某些村庄之间有一些双向的土路。从每个村庄都恰好有一条路径到达村庄1(即比特堡)。并且,对于每个村庄,它到比特...原创 2018-10-26 19:30:33 · 127 阅读 · 0 评论 -
[codeforces][gym101873]2017-2018 ACM-ICPC German Collegiate Programming Contest (GCPC 2017)
队内训练 6题:CDFGIKC. 有n(n<=1000)n(n<=1000)n(nm(m<=1000)m(m<=1000)m(mT(T<=1000)T(T<=1000)T(Tiii个游乐场的游乐设施耗时tititi,花费pipipi的钱,(1<=ti,pi<=106)(1<=ti,pi<=106)(1X(X<=1000)X(...原创 2018-09-07 12:48:02 · 881 阅读 · 0 评论 -
[HDU6331]Problem M. Walking Plan
Time Limit: 5000/2500 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Problem Description There are n intersections in Bytetown, connected with m one way streets. Little Q likes sport ...原创 2018-09-12 15:05:39 · 223 阅读 · 0 评论 -
[codeforces][gym101059C]Gangsters
time limit per test:5.0 s memory limit per test:64 MBYou live in a graph G, with N vertices and M edges. P of these vertices have gangsters living on them. You owe each gangster some money, given b...原创 2018-08-29 22:12:52 · 215 阅读 · 0 评论 -
[HDU3887]Counting Offspring
Time Limit: 15000/5000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Problem DescriptionYou are given a tree, it’s root is ppp, and the node is numbered from 111 to nnn. Now define f(i)f...原创 2019-03-09 15:08:29 · 134 阅读 · 0 评论 -
[codeforces741C] Arpa’s overnight party and Mehrdad’s silent entering
time limit per test : 1 secondmemory limit per test : 256 megabytesNote that girls in Arpa’s land are really attractive.Arpa loves overnight parties. In the middle of one of these parties Mehrdad s...原创 2019-05-09 14:36:07 · 222 阅读 · 0 评论 -
[codeforces1095F]Make It Connected
time limit per test : 2 secondsmemory limit per test : 256 megabytesYou are given an undirected graph consisting of nnn vertices. A number is written on each vertex; the number on vertex iii is aia_...原创 2019-06-08 10:59:35 · 286 阅读 · 0 评论 -
[gym101620G] Gambling Guide
Time limit: 3 sMemory limit: 512 MiBA railroad network in a nearby country consists of nnn cities numbered 111 through nnn , and mmm two-wayrailroad tracks each connecting two different cities. Tic...原创 2019-10-05 19:44:10 · 335 阅读 · 0 评论 -
[codeforces938D]Buy a Ticket
time limit per test : 2 secondsmemory limit per test : 256 megabytesMusicians of a popular band “Flayer” have announced that they are going to “make their exit” with a world tour. Of course, they wi...原创 2019-09-12 17:20:00 · 245 阅读 · 0 评论 -
[codeforces1214D]Treasure Island
time limit per test : 1 secondmemory limit per test : 512 megabytes分数:1800 但是感觉确实有难度()All of us love treasures, right? That’s why young Vasya is heading for a Treasure Island.Treasure Island may b...原创 2019-09-08 11:37:09 · 422 阅读 · 3 评论 -
[codeforces1217D]Coloring Edges
time limit per test : 1 secondmemory limit per test : 256 megabytes分数:2000You are given a directed graph with nnn vertices and mmm directed edges without self-loops or multiple edges.Let’s denote ...原创 2019-09-08 00:37:55 · 232 阅读 · 0 评论 -
[gym102012C]Rikka with Consistency
time limit per test : 8.0 smemory limit per test : 1024 MBOn the way to the Moscow, Rikka knows someone will replace her. Who is the guy? A devil to get in touch with her dark side, or an angel to r...原创 2019-09-05 20:30:28 · 7303 阅读 · 2 评论 -
[codeforces1196F]K-th Path
time limit per test : 2.5 secondsmemory limit per test : 256 megabytesYou are given a connected undirected weighted graph consisting of nnn vertices and mmm edges.You need to print the kkk-th small...原创 2019-08-29 20:35:44 · 200 阅读 · 0 评论 -
[codeforces1205B]Shortest Cycle
time limit per test : 1 secondmemory limit per test : 256 megabytesYou are given nnn integer numbers a1,a2,…,ana_1,a_2,…,a_na1,a2,…,an. Consider graph on nnn nodes, in which nodes i,j(ii, j (ii,j...原创 2019-08-21 11:20:37 · 254 阅读 · 0 评论 -
[hdu6567]Cotree
Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 262144/262144 K (Java/Others)分数:2500Problem DescriptionAvin has two trees which are not connected. He asks you to add an edge between them to ma...原创 2019-08-11 10:52:14 · 183 阅读 · 0 评论 -
[codeforces19E]Fairy
time limit per test : 1.5 secondsmemory limit per test : 256 megabytes分数:2800Once upon a time there lived a good fairy A. One day a fine young man B came to her and asked to predict his future. The...原创 2019-08-02 13:12:14 · 472 阅读 · 0 评论 -
[codeforces 1141G]Privatization of Roads in Treeland
time limit per test : 2 secondsmemory limit per test : 256 megabytes分数:2500Treeland consists of nnn cities and n−1n−1n−1 roads. Each road is bidirectional and connects two distinct cities. From any...原创 2019-07-22 19:51:05 · 133 阅读 · 0 评论 -
[codeforces796D]Police Stations
time limit per test : 2 secondsmemory limit per test : 256 megabytes分数:2100Inzane finally found Zane with a lot of money to spare, so they together decided to establish a country of their own.Ruli...原创 2019-08-02 16:13:58 · 166 阅读 · 0 评论 -
[hdu6611]K Subsequence
Problem DescriptionMaster QWsin is dating with Sindar. And now they are in a restaurant, the restaurant has n dishes in order. For each dish, it has a delicious value ai. However, they can only order...原创 2019-07-29 23:29:11 · 179 阅读 · 0 评论 -
[codeforces 508D]Tanya and Password
time limit per test : 2 secondsmemory limit per test : 256 megabytesWhile dad was at work, a little girl Tanya decided to play with dad’s password to his secret database. Dad’s password is a string ...原创 2019-07-17 14:24:32 · 220 阅读 · 0 评论 -
[codeforces920E]Connected Components?
time limit per test : 2 secondsmemory limit per test : 256 megabytes分数:2100You are given an undirected graph consisting of nnn vertices and edges. Instead of giving you the edges that exist in the ...原创 2019-07-23 20:46:38 · 151 阅读 · 0 评论 -
[AtCoder Grand Contest 035]
A. XOR Circle题意:给定n(n<=105)n(n<=10^5)n(n<=105)个数字a[1]a[1]a[1]~a[n]a[n]a[n],询问是否能够将其重排成一个首位相接的环形数组,使得每个a[i](1<=i<=n)a[i](1<=i<=n)a[i](1<=i<=n)等于与其相邻...原创 2019-07-15 23:25:39 · 243 阅读 · 0 评论 -
[codeforces917B]MADMAX
time limit per test : 1 secondmemory limit per test : 256 megabytesAs we all know, Max is the best video game player among her friends. Her friends were so jealous of hers, that they created an actu...原创 2019-07-10 10:39:32 · 374 阅读 · 0 评论 -
[HIT暑假集训]二分图
今天这场要总结一下。A.[NOI2009]变换序列题目描述: 输入: 输出: 题解: 题意既然已知了所有的D(i,Ti),设其为Di,那么对于每个i,Ti的情况有两种: ①Ti=(i+Di)%n ②Ti=(i-Di+n)%n 那么从i向这两种情况连边,做一个二分图匹配就好了,如果匹配数小于n的话则不成立,输出No Answer,否则一定有解。为了使得解的字典序...原创 2018-08-14 21:23:36 · 143 阅读 · 0 评论 -
[HIT 2018 暑期集训 precontest1]
题目来源: 2017 JUST Programming Contest 4.0 CF:http://codeforces.com/gym/101532 vjudge: https://vjudge.net/contest/238023#overviewA. 给一个序列{an},beauty(l,r)=a[l] &amp;amp; a[l+1] &amp;amp; a[l+2] &amp;amp; … &amp;amp..原创 2018-07-14 19:56:19 · 170 阅读 · 0 评论 -
[codeforces 982C]
C. Cut ‘em all! time limit per test : 1 second memory limit per test : 256 megabytesYou’re given a tree with nnn vertices. Your task is to determine the maximum possible number of edges that can ...原创 2018-06-08 22:18:53 · 285 阅读 · 0 评论