自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

OlaMins

图论&数据结构

  • 博客(212)
  • 收藏
  • 关注

原创 Educational Codeforces Round 102 (Rated for Div. 2) D(思维&线段树)

You are given a program that consists ofnninstructions. Initially a single variablexxis assigned to00. Afterwards, the instructions are of two types:increasexxby11; decreasexxby11.You are givenmmqueries of the following format:queryl...

2021-01-22 12:33:35 237

原创 Codeforces 1462F. The Treasure of The Segments (贪心&树状数组)

F. The Treasure of The Segmentstime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarp foundnnsegments on the street. A segment with the indexiiis described by two integerslilia...

2020-12-18 17:07:46 327 1

原创 2020牛客暑期多校训练营(第八场)A.All-Star Game (时间分治线段树)

时间限制:C/C++ 5秒,其他语言10秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述In Apollo's country, basketball is the most popular sport. There are n basketball players and m basketball fans. Bastketball players are numbered from 1 to n. Basketball fans

2020-12-07 22:57:51 250

原创 Educational Codeforces Round 54 (Rated for Div. 2) E. Vasya and a Tree (树上差分)

E. Vasya and a Treetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasya has a tree consisting ofnnvertices with root in vertex11. At first all vertices has00written on it.Letd...

2020-12-02 21:53:21 141

原创 Codeforces 1095 F. Make It Connected (MST)

F. Make It Connectedtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an undirected graph consisting ofnnvertices. A number is written on each vertex; the number on verte..

2020-11-27 11:14:42 162

原创 Codeforces Round #686 (Div. 3) A~F

A. Special Permutationtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given one integernn(n>1n>1).Recall that a permutation of lengthnnis an array consisting ofnnd...

2020-11-26 11:23:13 360

原创 Manthan, Codefest 18 (rated, Div. 1 + Div. 2) E. Trips

E. Tripstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere arennpersons who initially don't know each other. On each morning, two of them, who were not friends before, become frie..

2020-11-22 12:32:54 233

原创 2020CCPC-绵阳站-Joy of Handcraft (线段树&因子拆分)

Little Horse always does some handcrafts, which is full of joy. This time, he builds a circuit that can turn on and off the bulbs periodically.There arenbulbs in the circuit, thei-th of which has a periodt​i​​and a luminancex​i​​. Formally, thei-t...

2020-11-01 21:09:21 1275

原创 Codeforces Round #673 (Div. 2) F. Graph and Queries (并查集启发式合并&撤销)

F. Graph and Queriestime limit per test1.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an undirected graph consisting ofnnvertices andmmedges. Initially there is a single integer writ...

2020-09-29 22:38:55 251 1

原创 2020牛客多校第二场H-Happy Triangle (动态开点线段树&SET)

时间限制:C/C++ 2秒,其他语言4秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述Given a multiset MS{MS}MS and q{q}q operations. MS{MS}MS is empty initailly, and operations are in three types, which are as follows:1. insert an element x{x}x into MS{MS}...

2020-09-24 17:06:49 123

原创 Codeforces Round #228 (Div. 1) B. Fox and Minimal path (构造&最短路)

B. Fox and Minimal pathtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFox Ciel wants to write a task for a programming contest. The task is: "You are given a simple undirected graph wi

2020-09-08 10:04:52 147

原创 牛客练习赛68 C-牛牛的无向图 (MST&边贡献)

时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述牛牛有一张 n 个点,m 条边的无向图,每条边有一个边权 wiw_iwi​我们定义一条路径的权值是这个路径包含的边的权值的最大值。定义 d(u,v) 表示在无向图中点 u 能到达点 v 的所有路径中权值最小的路径的权值现在牛牛给你 q 次询问,每次询问给出一个 L ,询问 ∑i=1n∑j=i+1n[d(i,j)≤L]\sum_{i...

2020-08-28 22:00:10 343

原创 Codeforces Beta Round #77 (Div. 1 Only) C. Volleyball (二维最短路&贪心)

C. Volleyballtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPetya loves volleyball very much. One day he was running late for a volleyball match. Petya hasn't bought his own car yet,

2020-08-19 15:52:51 135

原创 Codeforces Round #660 (Div. 2) A~D

A. Captain Flint and Crew Recruitmenttime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputDespite his bad reputation, Captain Flint is a friendly person (at least, friendly to animals). Now

2020-08-05 20:46:20 289

原创 Educational Codeforces Round 36 (Rated for Div. 2) E. Physical Education Lessons (动态开点线段树)

E. Physical Education Lessonstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThis year Alex has finished school, and now he is a first-year student of Berland State University. For him

2020-08-03 09:06:28 185

原创 HDU6604 Blow up the city (灭绝树)

Blow up the cityTime Limit: 5000/5000 MS (Java/Others)Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 892Accepted Submission(s): 477Problem DescriptionCountry A and B are at war. Country A needs to organize transport teams ...

2020-07-31 21:45:33 183

原创 The 2019 ICPC Asia Shanghai Regional Contest(重现赛) M-Blood Pressure Game(费用流&算贡献)

链接:https://ac.nowcoder.com/acm/contest/4370/M来源:牛客网题目描述1Gugulu, a JBer, who was an ACMer one year ago, comes to Shanghai University taking part in the International Collegiate Programming Contest again. However, every time when Gugulu came to Shangh.

2020-07-27 11:01:51 588

原创 珂朵莉喊你一声大佬(Tarjan&拓扑序&卡常)

链接:https://ac.nowcoder.com/acm/problem/14524来源:牛客网时间限制:C/C++ 2秒,其他语言4秒空间限制:C/C++ 131072K,其他语言262144K64bit IO Format: %lld题目描述有n种大佬,第i种大佬有ai个珂朵莉想让最少个数的一种大佬的个数最多你可以创造m个任意种类的大佬,并且可以把一些大佬变成另一些大佬x -> y意味着可以把任意个x类型的大佬变成y类型的大佬一个大佬可以被转换多次对于每个y,最.

2020-07-25 21:47:29 873

原创 2020杭电多校第一场 HDU6756 Finding a MEX (分块&树状数组)

Finding a MEXTime Limit: 6000/3000 MS (Java/Others)Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 1257Accepted Submission(s): 218Problem DescriptionGiven an undirected graph G=(V,E). All vertices are numbered from 1 to N. ...

2020-07-22 16:40:35 670

原创 ICPC Asia Taipei-Hsinchu Regional 2019 Rush Hour Puzzle (矩阵哈希 + BFS)

Problem DescriptionRush Houris a puzzle game invented by Nob Yoshigahara in the19701970s. It is now being manufactured byThinkFun. The board is a6 \times 66×6grid with grooves in the tiles to a...

2020-07-18 22:41:26 784

原创 The 2019 ICPC Asia Shanghai Regional Contest F.A Simple Problem On A Tree (线段树&树链剖分)

题目描述We have met so many problems on the tree, so today we will have a simple problem on a tree.You are given a tree (an acyclic undirected connected graph) with N\mathbf{N}N nodes. The tree nodes are numbered from 1\mathbf{1}1 to N\mathbf{N}N. Each n...

2020-07-05 16:22:03 227

原创 洛谷P4315 月下“毛景树” (树链剖分&线段树)

题目描述毛毛虫经过及时的变形,最终逃过的一劫,离开了菜妈的菜园。 毛毛虫经过千山万水,历尽千辛万苦,最后来到了小小的绍兴一中的校园里。爬啊爬~爬啊爬毛毛虫爬到了一颗小小的“毛景树”下面,发现树上长着他最爱吃的毛毛果~ “毛景树”上有N个节点和N-1条树枝,但节点上是没有毛毛果的,毛毛果都是长在树枝上的。但是这棵“毛景树”有着神奇的魔力,他能改变树枝上毛毛果的个数: Change k w:将第k条树枝上毛毛果的个数改变为w个。 Cover u v w:将节点u与节点v之间的树枝上毛毛果

2020-07-01 17:02:28 224

原创 Codeforces Round #200 (Div. 1) D. Water Tree (树链剖分)

D. Water Treetime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMad scientist Mike has constructed a rooted tree, which consists ofnvertices. Each vertex is a reservoir which can be eit..

2020-07-01 09:21:09 158

原创 吉林大学ACM集训队选拔赛(重现赛)I-Firework (最短路)

链接:https://ac.nowcoder.com/acm/contest/5944/I来源:牛客网题目描述Alice and Bob get a strange firework accidentally, and they never know how to play it, so they come to you for help.The firework consists of n nodes and n-1 fuses connecting pairs of nodes. The.

2020-06-30 15:11:27 294

原创 Codeforces Round #364 (Div. 2) F. Break Up(tarjan+暴力)

F. Break Uptime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAgain, there are hard times in Berland! Many towns have such tensions that even civil war is possible.There arentowns in ..

2020-06-27 10:06:54 207

原创 Codeforces Round #649 (Div.2) D (LCA找简单环)

D. Ehab's Last Corollarytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputGiven a connected undirected graph withnnvertices and an integerkk, you have to either:either find an indepe...

2020-06-14 22:43:25 309

原创 HDU5521 2015ACM/ICPC亚洲区沈阳站 Meeting (最短路&建虚拟点)

Meeting Time Limit: 12000/6000 MS (Java/Others)Memory Limit: 262144/262144 K (Java/Others) Total Submission(s): 7487Accepted Submission(s): 2264 Problem Description Bessie and her friend Elsie decide to have a meeting. However...

2020-06-09 09:54:52 205

原创 Codeforces Round #221 (Div. 1) D Tree and Queries(树上启发式合并 + 树状数组)

D. Tree and Queriestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou have a rooted tree consisting ofnvertices. Each vertex of the tree has some color. We will assume that the tree ..

2020-06-06 08:57:32 230

原创 Codeforces Round #615 (Div. 3) A, B, C, D, F

A. Collecting Coinstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarp has three sisters: Alice, Barbara, and Cerene. They'...

2020-04-23 20:24:59 311

原创 Codeforces Round #130 (Div. 2) E 树上倍增 + 两次二分

E. Blood Cousinstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarpus got hold of a family relationship tree. The tree desc...

2020-04-23 14:23:37 189

原创 洛谷P3377 左偏树的并堆写法(启发式合并)

题目描述如题,一开始有nn个小根堆,每个堆包含且仅包含一个数。接下来需要支持两种操作: 1 x y:将第xx个数和第yy个数所在的小根堆合并(若第xx或第yy个数已经被删除或第xx和第yy个数在用一个堆内,则无视此操作)。 2 x:输出第xx个数所在的堆最小数,并将这个最小数删除(若有多个最小数,优先删除先输入的;若第xx个数已经被删除,则输...

2020-04-21 16:02:11 250

原创 Codeforces Round #588 (Div. 2) A ~ D

A. Dawid and Bags of Candiestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard ...

2020-04-20 16:17:13 246

原创 Codeforces Ozon Tech Challenge 2020 (Div1 + Div2) A ~ D

A. Kuroni and the Giftstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutput...

2020-03-09 16:56:51 2147

原创 Codeforces Round #625 (Div. 2) A ~ D

A. Contest for Robotstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstanda...

2020-03-04 20:26:13 422

原创 Codeforces Round #620 (Div. 2) (A ~ E)

A. Two Rabbitstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutput...

2020-02-18 17:04:48 514 1

原创 Educational Codeforces Round 82 (Rated for Div. 2) A ~ D

A. Erasing Zeroestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutput...

2020-02-14 18:20:43 401

原创 Codeforces Round #617 (Div. 3) (A ~ F)

A. Array with Odd Sumtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard o...

2020-02-09 16:40:53 567

原创 # 2020牛客寒假算法基础集训营2 相关知识点和例题

本次训练涉及到的内容有 枚举,贪心,DP,数论,思维,数据结构,哈希枚举: 概念:https://blog.csdn.net/CWD950926/article/details/79924048关于枚举没什么讲解,他主要是针对于情况较少或者较容易表示的题目,并且罗列出所有的情况不会导致超时,关键的部分就是能够考虑周全,...

2020-02-06 22:04:34 1461

原创 Codeforces Round #447 (Div. 2) E (tarjan + dp)

Ralph is going to collect mushrooms in the Mushroom Forest.There aremdirected paths connectingntrees in the Mushroom Forest. On each path grow some mushrooms. When Ralph passes a path, he collec...

2020-02-03 11:33:59 381

原创 #Codeforces Round #442 (Div. 2) E (线段树)

E. Danil and a Part-time Jobtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputDanil decided to earn some money, so he had found a ...

2020-01-29 17:16:47 229

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除