
Codeforces
文章平均质量分 87
题解
olamins_
退役acmer
展开
-
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 · 310 阅读 · 0 评论 -
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 · 191 阅读 · 0 评论 -
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 · 228 阅读 · 0 评论 -
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 · 471 阅读 · 0 评论 -
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 · 293 阅读 · 0 评论 -
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 · 312 阅读 · 1 评论 -
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 · 197 阅读 · 0 评论 -
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 · 174 阅读 · 0 评论 -
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 · 361 阅读 · 0 评论 -
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 · 219 阅读 · 0 评论 -
#2018-2019 ACM-ICPC, Asia Jiaozuo Regional Contest (F - BFS)
F. Honeycombtime limit per test4.0 smemory limit per test1024 MBinputstandard inputoutputstandard outputA honeycomb is a mass wax cells built by honey bees, which can be described as...原创 2019-10-07 20:28:11 · 277 阅读 · 0 评论 -
#2018-2019 ACM-ICPC, Asia Jiaozuo Regional Contest (I.Distance)
I. Distancetime limit per test6.0 smemory limit per test1024 MBinputstandard inputoutputstandard outputThere are nn points on a horizontal line, labelled with 11 through nn from left...原创 2019-10-07 20:40:08 · 281 阅读 · 0 评论 -
#2019-2020 ICPC, Asia Jakarta Regional Contest G题(线段树)
G. Performance Reviewtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputRandall is a software engineer at a company withNNemploye...原创 2019-11-02 12:18:15 · 673 阅读 · 0 评论 -
#2018 German Collegiate Programming Contest (GCPC 18) M (MST + LCA + 倍增)
题目大意 :有一个 N * M 的矩阵, 每个值代表该点的山有多高, Q次询问, 每次询问两点之间的路径中, 经过的最大值的最小值是多少(可以向上下左右四个方向走)思路 :首先1e5次询问肯定不能直接暴力写,不难想到建立MST, 那么树上的路径即为最短的路径, 两个点的路径唯一, 在求LCA的过程中就可以求出路径当中点权的最值问题了, 通过倍增可以让最值维护优化, 但是要注意,...原创 2019-11-16 00:35:24 · 901 阅读 · 0 评论 -
#2018 German Collegiate Programming Contest (GCPC 18) A (建图 + LCA)
题目大意 :有一个由 "_", “|”, “ ”构成的图,任意两个格子之间的路径是唯一的, 现在有Q个点, 编号分别为1 到 Q, 输出从1 - > 2 + 2 - > 3…… 到 Q的路径之和, 不可以跳过思路 :建图见代码备注, 建完图后就是LCA裸题, 注意开long long, 否则1000 * 1000 * 10000 会炸intAccepted ...原创 2019-11-18 20:27:09 · 448 阅读 · 0 评论 -
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 · 249 阅读 · 0 评论 -
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 · 249 阅读 · 0 评论 -
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 · 376 阅读 · 0 评论 -
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 · 282 阅读 · 0 评论 -
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 · 371 阅读 · 0 评论 -
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 · 246 阅读 · 0 评论 -
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 · 308 阅读 · 0 评论 -
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 · 2245 阅读 · 0 评论 -
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 · 469 阅读 · 0 评论 -
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 · 597 阅读 · 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 · 455 阅读 · 0 评论 -
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 · 669 阅读 · 0 评论 -
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 · 498 阅读 · 0 评论 -
#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 · 265 阅读 · 0 评论 -
#Codeforces Round #425 (Div. 2) D LCA + 树上路径交
D. Misha, Grisha and Undergroundtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMisha and Grisha are funny boys, so they like to...原创 2020-01-17 18:38:06 · 652 阅读 · 0 评论 -
#Codeforces Round #603 (Div. 2) E (线段树)
E. Editortime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe development of a text editor is a hard problem. You need to implemen...原创 2019-12-02 01:39:28 · 436 阅读 · 0 评论 -
Codeforces Round #600 (Div. 2) D (贪心)
D. Harmonious Graphtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou're given an undirected graph withnnnodes andmmedges. N...原创 2019-11-19 13:50:01 · 500 阅读 · 1 评论 -
#codeforces div2 597 D.Shichikuji and Power Grid (建立源点 + MST)
D. Shichikuji and Power Gridtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputShichikuji is the new resident deity of the South Bl...原创 2019-11-11 17:53:20 · 435 阅读 · 0 评论 -
#Codeforces Round #583 D. Treasure Island (BFS 或 最小割)
D. Treasure Island time limit per test 1 second memory limit per test 512 megabytes input standard input output standard output All of us love treasures, right? That's why young...原创 2019-09-08 21:14:15 · 297 阅读 · 0 评论