
思维
龍木
若人生为棋,我愿为卒,漫漫征途,谁曾见我后退半步
展开
-
D. XOR-gun
https://codeforces.ml/contest/1457/problem/DArkady owns anon-decreasingarraya1,a2,…,ana1,a2,…,an. You are jealous of its beauty and want to destroy this property. You have a so-calledXOR-gunthat you can use one or more times.In one step you can se...原创 2020-11-29 18:36:22 · 469 阅读 · 1 评论 -
C. Knapsack
https://codeforces.ml/contest/1447/problem/CYou have a knapsack with the capacity ofWW. There are alsonnitems, theii-th one has weightwiwi.You want to put some of these items into the knapsack in such a way that their total weightCCis at least h...原创 2020-11-16 18:35:16 · 324 阅读 · 0 评论 -
D. Minimal Height Tree
https://codeforces.ml/contest/1437/problem/DMonocarp had a tree which consisted ofnnvertices and was rooted at vertex11. He decided to study BFS (Breadth-first search), so he ran BFS on his tree, starting from the root. BFS can be described by the fol...原创 2020-11-06 14:41:55 · 250 阅读 · 0 评论 -
C. Division
https://codeforces.ml/contest/1445/problem/COleg's favorite subjects are History and Math, and his favorite branch of mathematics is division.To improve his division skills, Oleg came up withttpairs of integerspipiandqiqiand for each pair decided...原创 2020-11-05 16:45:17 · 296 阅读 · 0 评论 -
C. Rotation Matching
链接:https://codeforces.ml/contest/1365/problem/CAfter the mysterious disappearance of Ashish, his two favourite disciples Ishika and Hriday, were each left with one half of a secret message. These messages can each be represented by a permutation of size.原创 2020-07-09 19:45:39 · 182 阅读 · 0 评论 -
D. Orac and Medians
链接:https://codeforces.ml/contest/1350/problem/DSlime has a sequence of positive integersa1,a2,…,ana1,a2,…,an.In one operation Orac can choose an arbitrary subsegment[l…r][l…r]of this sequence and replace all valuesal,al+1,…,aral,al+1,…,arto the va...原创 2020-05-21 16:27:43 · 274 阅读 · 0 评论 -
D. Anti-Sudoku
链接:https://codeforces.ml/contest/1335/problem/DYou are given a correct solution of the sudoku puzzle. If you don't know what is the sudoku, you can read about ithere.The picture showing the corre...原创 2020-04-14 16:14:13 · 478 阅读 · 0 评论 -
B. Journey Planning
链接:https://codeforces.ml/contest/1321/problem/BTanya wants to go on a journey across the cities of Berland. There arenncities situated along the main railroad line of Berland, and these cities are...原创 2020-03-02 10:25:03 · 671 阅读 · 0 评论 -
B. Nick and Array
链接:https://codeforces.ml/contest/1180/problem/BNick had received an awesome array of integersa=[a1,a2,…,an]a=[a1,a2,…,an]as a gift for his55birthday from his mother. He was already going to expl...原创 2020-02-25 18:55:17 · 285 阅读 · 0 评论 -
D1. Add on a Tree
链接:https://codeforces.ml/contest/1189/problem/D1Note that this is the first problem of the two similar problems. You can hack this problem only if you solve both problems.You are given a tree with...原创 2020-02-21 17:52:38 · 224 阅读 · 0 评论 -
C2. Exam in BerSU (hard version)
链接:https://codeforces.ml/contest/1185/problem/C2The only difference between easy and hard versions is constraints.If you write a solution in Python, then prefer to send it in PyPy to speed up exec...原创 2020-02-20 21:34:48 · 200 阅读 · 0 评论