![](https://img-blog.csdnimg.cn/20190927151132530.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
codeforces
文章平均质量分 51
小菜鸡加油
菜鸡
什么都能折磨
展开
-
待补题单
https://codeforces.com/contest/1280/problem/D(树形dp)原创 2021-04-22 21:41:22 · 81 阅读 · 0 评论 -
Hello 2020(A-D)
https://codeforces.com/contest/1284/problem/A思路:取循环节即可。然而我第一眼直接map判定是否出现过相同的字符串,看了半天发现题目说字符串会重复。签到给我wa了3发。#include<iostream>#include<vector>#include<queue>#include<cstring>#include<cmath>#include<map>#includ原创 2021-04-16 19:47:50 · 82 阅读 · 0 评论 -
防cf上unordered_map被卡
题目链接:https://codeforces.com/contest/1490/problem/F本来是都不怎么用unordered_map的,怕卡常就用了。然而cf确实不卡常,但是卡哈希。一般来说卡哈希用双哈希就卡不了了。这里提供一个cf大佬的文章防止卡哈希博客地址:http://codeforces.com/blog/entry/62393%E3%80%82需要添加:#include<chrono>struct custom_hash { static原创 2021-02-17 21:07:45 · 1115 阅读 · 1 评论 -
Codeforces Round #684 (Div. 2)[A-E]
A. Buy the String(思维+贪心)B. Sum of Medians(思维+数学)C1 - Binary Table (Easy Version)(构造+大模拟)C2. Binary Table (Hard Version)(构造+大模拟)原创 2020-11-19 12:35:08 · 124 阅读 · 0 评论 -
Codeforces Round #681 (Div. 2, based on VK Cup 2019-2020 - Final)(A-D题解)
A. Kids Seating(思维+构造)B. Saving the City(思维)C. The Delivery Dilemma(思维+二分)D. Extreme Subtraction(思维+差分构造)原创 2020-11-04 13:19:37 · 190 阅读 · 0 评论 -
2020ccpc威海部分题解
2020ccpc威海 A Golden Spirit(思维)2020ccpc威海B Labyrinth(思维+bfs扣关键点最短路)2020ccpc威海C Rencontre(树上各块中任意两点距离之和)2020ccpc威海D题 ABC Conjecture(规律+pollard_rho大数质因数分解模板)2020ccpc威海 H Message Bomb(思维+模拟)2020ccpc 威海 Clock Master(多个数的lcm+分组背包)...原创 2020-10-29 23:33:20 · 957 阅读 · 0 评论 -
Codeforces Round #677 (Div. 3)[A-G]题解
A. Boring Apartments(思维)B. Yet Another Bookshelf(思维)C. Dominant Piranha(思维)D. Districts Connection(思维+构造)E. Two Round Dances(思维+圆排列组合数学)F. Zero Remainder Sum(思维+四维dp)G. Reducing Delivery Cost(思维+最短路)...原创 2020-10-21 17:43:30 · 294 阅读 · 0 评论 -
Codeforces Round #676 (Div. 2)(A-D)
A. XORwice(思维+位运算)B. Putting Bricks in the Wall(思维+构造)C. Palindromifier(思维+构造)D. Hexagons(思维+变形矩阵)原创 2020-10-19 23:37:22 · 214 阅读 · 0 评论 -
Educational Codeforces Round 96 (Rated for Div. 2)[A-E]题解
.原创 2020-10-12 21:52:15 · 270 阅读 · 0 评论 -
Codeforces Round #673 (Div. 2)(A-D)题解
A. Copy-paste(思维)B. Two Arrays(思维+贪心分配)C. k-Amazing Numbers(思维前缀最小值+枚举相同数距离)D. Make Them Equal(思维+构造)原创 2020-09-28 19:18:20 · 1072 阅读 · 0 评论 -
Codeforces Round #672 (Div. 2)(A-D)题解
A. Cubes Sorting(思维+排序/逆序对+贪心)B. Rock and Lever(思维+位运算+贪心)C1. Pokémon Army (easy version)(思维+贪心(波峰波谷)/线性dp)C2.线段树dp,补了但是没搞清楚。9.26号会讲解好补上的。D - Rescue Nibel!(差分+组合数学+思维)详解...原创 2020-09-26 00:26:28 · 398 阅读 · 2 评论 -
Codeforces Round #618 (Div. 2)A-E题解
Non-zeroAssigning to ClassesAnu Has a FunctionAerodynamicWater Balance原创 2020-09-26 00:23:54 · 173 阅读 · 0 评论 -
Codeforces Round #670 (Div. 2)(A-D详解)
A:Subset MexB:Maximum ProductC:Link Cut CentroidsD:Three Sequences原创 2020-09-13 11:53:22 · 293 阅读 · 0 评论 -
Codeforces Round #669 (Div. 2)(A-E详解)
A:AhahahahahahahahaB:Big VovaC:Chocolate BunnyD:Discrete Centrifugal Jumps原创 2020-09-09 15:12:16 · 417 阅读 · 0 评论 -
Codeforces Round #668 (Div. 2)(A-D详解)
A:Permutation ForgeryB:Array CancellationC:Balanced BitstringD:Tree Tag原创 2020-09-07 13:58:37 · 278 阅读 · 0 评论 -
Codeforces Round #667 (Div. 3)[A-E详细题解]
A:Yet Another Two Integers ProblemB:Minimum ProductC:Yet Another Array RestorationD:Decrease the Sum of DigitsE:Two Platforms原创 2020-09-05 16:33:55 · 360 阅读 · 0 评论 -
B. Omkar and Last Class of Math
In Omkar’s last class of math, he learned about the least common multiple, orLCMLCM.LCM(a,b)LCM(a,b)is the smallest positive integerxxwhich is divisible by bothaaandbb.Omkar, having a laudably curious mind, immediately thought of a problem involv...原创 2020-07-12 10:29:22 · 308 阅读 · 0 评论 -
EDUCATIONAL CODEFORCES ROUND 88 (RATED FOR DIV. 2)
http://www.yyycode.cn/index.php/2020/05/30/educational-codeforces-round-88-rated-for-div-2/A. BERLAND POKERB. NEW THEATRE SQUAREC. MIXING WATERD. YET ANOTHER YET ANOTHER TASK【枚举的转化+区间最大连续子段和】原创 2020-05-30 21:52:44 · 162 阅读 · 0 评论 -
C. MIXING WATER
http://www.yyycode.cn/index.php/2020/05/30/c-mixing-water/There are two infinite sources of water:hot water of temperaturehh; cold water of temperaturecc(c<hc<h).You perform the following procedure of alternating moves:takeonecup of t...原创 2020-05-30 21:50:45 · 360 阅读 · 1 评论 -
D. YET ANOTHER YET ANOTHER TASK【枚举的转化+区间最大连续子段和】
http://www.yyycode.cn/index.php/2020/05/30/d-yet-another-yet-another-task%e3%80%90%e6%9e%9a%e4%b8%be%e7%9a%84%e8%bd%ac%e5%8c%96%e5%8c%ba%e9%97%b4%e6%9c%80%e5%a4%a7%e8%bf%9e%e7%bb%ad%e5%ad%90%e6%ae%b5%e5%92%8c%e3%80%91/Alice and Bob are playing yet ano.原创 2020-05-30 21:23:33 · 1220 阅读 · 0 评论 -
CODEFORCES ROUND #645 (DIV. 2)
http://www.yyycode.cn/index.php/2020/05/30/codeforces-round-645-div-2/A. Park Lightingtimelimit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputDue to the coronavirus pandemic, city authorities obligated .原创 2020-05-30 20:32:10 · 421 阅读 · 0 评论 -
DIV. 2 B — T-PRIMES
http://www.yyycode.cn/index.php/2020/05/23/div-2-b-t-primes/We know that prime numbers are positive integers that have exactly two distinct positive divisors. Similarly, we’ll call a positive integertТ-prime, ifthas exactly three distinct positive...原创 2020-05-23 13:04:38 · 590 阅读 · 4 评论 -
A. CUT RIBBON(暴力枚举或者完全背包)
http://www.yyycode.cn/index.php/2020/05/23/a-cut-ribbon/https://codeforces.com/problemset/problem/189/APolycarpus has a ribbon, its length isn. He wants to cut the ribbon in a way that fulfils the following two conditions:After the cutting each ribb.原创 2020-05-23 09:43:57 · 1126 阅读 · 2 评论 -
C. ALICE, BOB AND CHOCOLATE
http://www.yyycode.cn/index.php/2020/05/20/c-alice-bob-and-chocolate/Alice and Bob like games. And now they are ready to start a new game. They have placednchocolate bars in a line. Alice starts to eat chocolate bars one by one from left to right, a...原创 2020-05-20 20:51:38 · 386 阅读 · 0 评论 -
A. KIRILL AND THE GAME
http://www.yyycode.cn/index.php/2020/05/20/a-kirill-and-the-game/Kirill plays a new computer game. He came to the potion store where he can buy any potion. Each potion is characterized by two integers— amount of experience and cost. The efficiency of a .原创 2020-05-20 17:34:15 · 182 阅读 · 0 评论 -
B. LECTURE SLEEP
http://www.yyycode.cn/index.php/2020/05/20/b-lecture-sleep/Your friend Mishka and you attend a calculus lecture. Lecture lastsnminutes. Lecturer tellsaitheorems during thei-th minute.Mishka is really interested in calculus, though it is so har...原创 2020-05-20 16:26:33 · 253 阅读 · 0 评论 -
C. BALANCED TEAM[双头指针]
http://www.yyycode.cn/index.php/2020/05/19/c-balanced-team%e5%8f%8c%e5%a4%b4%e6%8c%87%e9%92%88/https://codeforces.com/problemset/problem/1133/CYou are a coach at your local university. There arennstudents under your supervision, the programming skill..原创 2020-05-19 16:26:39 · 233 阅读 · 0 评论 -
C. DOMINATED SUBARRAY[求最短的两个相同的数的子串长度]
http://www.yyycode.cn/index.php/2020/05/19/c-dominated-subarray%e6%b1%82%e6%9c%80%e7%9f%ad%e7%9a%84%e4%b8%a4%e4%b8%aa%e7%9b%b8%e5%90%8c%e7%9a%84%e6%95%b0%e7%9a%84%e5%ad%90%e4%b8%b2%e9%95%bf%e5%ba%a6/https://codeforces.com/problemset/problem/1257/C..原创 2020-05-19 09:29:09 · 216 阅读 · 0 评论 -
C. THREE PARTS OF THE ARRAY【双头指针+前缀和】
http://www.yyycode.cn/index.php/2020/05/18/c-three-parts-of-the-array%e3%80%90%e5%8f%8c%e5%a4%b4%e6%8c%87%e9%92%88%e5%89%8d%e7%bc%80%e5%92%8c%e3%80%91/You are given an arrayd1,d2,…,dnd1,d2,…,dnconsisting ofnninteger numbers.Your task is to split th...原创 2020-05-18 22:10:51 · 256 阅读 · 1 评论 -
B. BERSU BALL(双指针)
http://www.yyycode.cn/index.php/2020/05/18/b-bersu-ball/The Berland State University is hosting a ballroom dance in celebration of its 100500-th anniversary!nboys andmgirls are already busy rehearsing waltz, minuet, polonaise and quadrille moves.We...原创 2020-05-18 21:14:30 · 471 阅读 · 0 评论 -
C. COUNT TRIANGLES(枚举优化——不等式和的枚举)【不详细你砍我好了5555
http://www.yyycode.cn/index.php/2020/05/18/c-count-triangles%e6%9e%9a%e4%b8%be%e4%bc%98%e5%8c%96-%e4%b8%8d%e7%ad%89%e5%bc%8f%e5%92%8c%e7%9a%84%e6%9e%9a%e4%b8%be/图片转存失败,不能看的话来我博客Like any unknown mathematician, Yuri has favourite numbers:AA,BB,C...原创 2020-05-18 17:47:22 · 439 阅读 · 0 评论 -
C. PRODUCT OF THREE NUMBERS[等式枚举优化]
http://www.yyycode.cn/index.php/2020/05/17/c-product-of-three-numbers%e7%ad%89%e5%bc%8f%e6%9e%9a%e4%b8%be%e4%bc%98%e5%8c%96/You are given one integer numbernn. Find threedistinct integersa,b,ca,b,csuch that2≤a,b,c2≤a,b,canda⋅b⋅c=na⋅b⋅c=nor say th...原创 2020-05-17 22:32:33 · 289 阅读 · 0 评论 -
B. VANYA AND LANTERNS
http://www.yyycode.cn/index.php/2020/05/17/b-vanya-and-lanterns/anya walks late at night along a straight street of lengthl, lit bynlanterns. Consider the coordinate system with the beginning of the street corresponding to the point0, and its end cor...原创 2020-05-17 21:10:09 · 339 阅读 · 0 评论 -
B. TERNARY STRING
http://www.yyycode.cn/index.php/2020/05/17/b-ternary-string/You are given a stringsssuch that each its character is either1,2, or3. You have to choose the shortest contiguous substring ofsssuch that it contains each of these three characters at le...原创 2020-05-17 20:34:08 · 591 阅读 · 0 评论 -
CODEFORCES ROUND #643 (DIV. 2)
http://www.yyycode.cn/index.php/2020/05/17/codeforces-round-643-div-2/A. Sequence with DigitsLet’s define the following recurrence:an+1=an+minDigit(an)⋅maxDigit(an).an+1=an+minDigit(an)⋅maxDigit(an).HereminDigit(x)minDigit(x)andmaxDigit(x)maxDigit...原创 2020-05-17 20:19:52 · 340 阅读 · 0 评论 -
CODEFORCES ROUND #641 (DIV. 2)【A-C】
http://www.yyycode.cn/index.php/2020/05/16/codeforces-round-641-div-2%e3%80%90a-c%e3%80%91/如果图片看不到来我博客看叭A. Orac and Factorshttps://codeforces.com/contest/1350/problem/AOrac is studying number theory, and he is interested in the properties of diviso原创 2020-05-16 23:30:34 · 260 阅读 · 0 评论 -
CODEFORCES ROUND #642 (DIV. 3)[蒟蒻讲解]
http://www.yyycode.cn/index.php/2020/05/16/codeforces-round-642-div-3/A. Most Unstable ArrayYou are given two integersnnandmm. You have to construct the arrayaaof lengthnnconsisting ofnon-negative integers(i.e. integers greater than or equal t...原创 2020-05-16 16:22:37 · 547 阅读 · 0 评论 -
Educational Codeforces Round 85 (Rated for Div. 2) [A-D]
http://www.yyycode.cn/index.php/2020/04/18/educational-codeforces-round-85-rated-for-div-2a-d/A. Level Statisticstimelimit per test2 secondsmemory limit per test256 megabytesinputstandard input...原创 2020-04-18 11:20:40 · 396 阅读 · 0 评论