Можно ввести несколько слов — все они попадут в требования к поиску. Кроме того, осуществляется поиск по словоформам и, если повезет, по синонимам. Поддерживается поиск по названию, автору и специальный синтаксис запросов. Примеры:

  • 305 — ищет все посты, содержащие 305, найдет посты про Раунд 305
  • andrew stankevich contests — можно писать сразу много слов, будут искаться все
  • user:mikemirzayanov title:сазанка — ищет все посты в названии со словом "сазанка" авторства MikeMirzayanov
  • "vk cup" — можно использовать кавычку, чтобы искать точные совпадения
  • title:educational — искать в названии

Результаты

1.
Автор MikeMirzayanov, 3 года назад, По-английски
Please, read this Hello, Codeforces. Friends. I apologize, but today I will be a bit chaotic and mix personal with public. It just happened that way, I'm sorry. Today, my mother passed away. It's hard for me to write this. Even just seeing it in text makes it feel like something from a nightmare. She was extraordinary. It's difficult for me to articulate it right now, but take my word for it. It felt like all the best qualities one could imagine in a mother converged in her. I don't know any other people so kind, sincere, non-judgmental, capable of love, listening, befriending, supporting, and taking joy in the world around them, and bringing joy to their loved ones. Mom, it's already hard without you, it feels empty. She had glioblastoma. It's an aggressive brain cancer that affects only a few people out of 100,000. I believe, I hope, that science will soon be able to tackle this disease. But for now, this diagnosis is a death sentence. Maybe some of you are or will be associated with medic...
public. It just happened that way, I'm sorry. Today, my mother passed away. It's hard for me to, won't solve these problems here, we just can't., I apologize, but today I will be a bit chaotic and mix personal with public. It just happened that, Today, my mother passed away. It's hard for me to write this. Even just seeing it in text makes it

Полный текст и комментарии »

  • Проголосовать: нравится
  • +6564
  • Проголосовать: не нравится

2.
Автор YouKn0wWho, 5 лет назад, По-английски
The Ultimate Topic List (with Resources, Problems and Templates) This post took $4$ years to make. And this is the most significant thing that I have ever shared in my whole life. #### Story Hi, I have been doing CP for like $4$ years and from the very beginning what I have been feeling is a need for a comprehensive topic list that will contain all sorts of topics from easy to advanced with corresponding tutorials, problem lists and templates so that I wouldn't have to look at different sites, from here to there. So what do you do when you think something is missing from the world? Yeah, you create that thing! So here I am, sharing the ultimate topic list that you will need in CP. When I say that it took me $4$ years to make it, I genuinely mean it. I have been collecting them from the inception of my CP journey and yesterday I thought that it got its almost complete shape. You may not imagine the sheer excitement hidden under each of the characters of this post. #### Payment You can pay me just by upvoting this blog and by being a bet...
characters of this post. #### Payment You can pay me just by upvoting this blog and by being a, that topic. If you want more problems, then you can do it just by using Google., them by just using your best companion — Google., #### Payment You can pay me just by upvoting this blog and by being a better programmer and human, If you are a beginner then just learn basic topics and solve problems.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +4383
  • Проголосовать: не нравится

3.
Автор YouKn0wWho, 5 лет назад, По-английски
Codeforces Round #752 #### UPD: (28 April, 2022) <spoiler summary="Donated Finally"> Details: [here](https://codeforces.me/blog/entry/96333?#comment-907470) </spoiler> আবার চলে এসেছি! (That's Bengali for "I am back! (in Terminator mode)") I am super excited to invite you to participate in [contest:1603] and [contest:1604] which will be held on [contest_time:1604]. This round is rated for both divisions. You will be given $6$ problems in each division and $2$ hours to solve them. All the problems are authored and prepared by me. I would like to thank - - [user:antontrygubO_o,2021-10-26] for his breathtaking(<strike>literally</strike>) coordination of the round. <i style="color:White;"> no funny text this time</i> - [user:Alpha_Q,2021-10-26], [user:Anachor,2021-10-26] and [user:antontrygubO_o,2021-10-26] for putting up with my dumb ranting and helping with the problems. - [user:Um_nik,2021-10-26], [user:gamegame,2021-10-26], [user:kefaa2,2021-10-26], [user:dorijanlendvaj,2021-10-26], [u...
doing all this hard work, for trying to do more right than wrong. I want to thank me forjust being, make it more by just solving more problems!). I am a student, so pardon me if that's too little., /8771_blobheart.png" width="16px" height="16px" alt="blobheart">. Just hold right there. The, ="blobheart">. Just hold right there., Also, thanks for being a part of this. You have just helped someone who is in need (I mean after I, just solving problems. I will donate money based on the solve count of each problem by the following

Полный текст и комментарии »

  • Проголосовать: нравится
  • +3156
  • Проголосовать: не нравится

4.
Автор Rhodoks, история, 4 года назад, По-английски
Codeforces Round #810 Editorial Sorry for the late editorial. May this editorial help you. If you have questions, feel free to ask. [problem:1711A] <spoiler summary="hint1."> The minimal weight is at least $1$ since $1$ divides any integer (so $1$ divides $p_1$). </spoiler> <spoiler summary="solution"> Since $k+1$ does not divide $k$, a permutation with weight equal to $1$ is: $[n,1,2,\cdots,n-1]$. </spoiler> <spoiler summary="code"> ~~~~~ #include <bits/stdc++.h> using namespace std; void work() { int n; cin>>n; cout<<n<<' '; for (int i=1;i<n;i++) cout<<i<<' '; cout<<endl; } int main() { int casenum=1; cin>>casenum; for (int testcase=1;testcase<=casenum;testcase++) work(); return 0; } ~~~~~ </spoiler> [problem:1711B] <spoiler summary="hint1."> See the party as a graph. </spoiler> <spoiler summary="hint2."> Divide the vertices into two categories according to their degrees' parity. </spoiler> <spoiler summary="solution"> Let's consider ...
can maintain all positive changes of $|I|$, just decrease the $j$ with $i$ decreasing. Now you can, For the maximum independent set without the initial cell, you just need to remove it when it is in, So you can maintain all positive changes of $|I|$, just decrease the $j$ with $i$ decreasing. Now, The first player can just choose any matching $M$ and move to the vertex $P$ matching with current

Полный текст и комментарии »

Разбор задач Codeforces Round 810 (Div. 1)
Разбор задач Codeforces Round 810 (Div. 2)
  • Проголосовать: нравится
  • +3132
  • Проголосовать: не нравится

5.
Автор MikeMirzayanov, 4 года назад, По-английски
In Problems Statements, Example Inputs Are Now Highlighted if Test Cases Are Used <img src="/predownloaded/c1/64/c164a37e70461b3b6a0236b7e72c81c7f9b47d8d.png" style="width: 200px; float: right; margin: 1em 0 0 0;"/> Hello, Codeforces. Look what an interesting thing I've been working on the last few days. Now, if a problem uses test cases and its validator is written in the recommended way (using setTestCase), then the example inputs are displayed using different colors. Just follow the link and see how beautiful it turned out: <a href="https://codeforces.me/contest/1714/problems">https://codeforces.me/contest/1714/problems</a>! So far I have enabled this only for the last few rounds, but if everything works as intended, I will enable it for more rounds. In order to support this, I had to tinker a lot. I made changes to [testlib.h](https://github.com/MikeMirzayanov/testlib) so that the validator can return test markup. Support for this markup required changes in various system services. But I think it's worth it! The coolest thing is that it wa...
Just follow the link and see how beautiful it turned out:

Полный текст и комментарии »

  • Проголосовать: нравится
  • +3167
  • Проголосовать: не нравится

6.
Автор MikeMirzayanov, 3 месяца назад, По-английски
Telegram Returns as Title Sponsor of Codeforces! <img width="200px" src="https://assets.codeforces.com/images/telegram-logo.svg" style="width:200px;max-width:200px;float:right; margin: 0 1em 1em 1em"/> Hi, Codeforces! I have some great news. But maybe you've already noticed? Seen the updated logo? I'm glad to announce that Telegram is back as our title sponsor. I'm happy, and not just because this means we can keep developing and maintaining the system and (most importantly) running rounds for a long time to come. But there's something else, too. It was Pavel Durov who, way back in 2010, spent several hours asking questions and trying to understand what I had in mind. Then he put his faith in our community — and Codeforces received support for the very first time. That support helped us for many years. So this means a lot to me personally, and I'm proud that now, more than 16 years after that first conversation, that support is coming back. This helps with every round we run and gives us a chance to do new things, too....
back as our title sponsor. I'm happy, and not just because this means we can keep developing and, I'm glad to announce that Telegram is back as our title sponsor. I'm happy, and notjust because

Полный текст и комментарии »

  • Проголосовать: нравится
  • +2850
  • Проголосовать: не нравится

7.
Автор MikeMirzayanov, 8 лет назад, По-английски
Codeforces: Our Steps After DDOS Attack Hello. As I wrote into a comment, last round we are faced with a strong DDOS-attack which ruined the competition. I don't know who did it, I also don't know reasons to do it. I'm very upset about the situation and ready to make an effort to be prepared for such issues. I spend a lot of time to be ready for such incidents. Here are steps you need to do to be ready for unexpected failures: * Join our telegram channel by the link https://t.me/codeforces_official to read urgent news. * Be sure that you know the password of your Codeforces account. If you don't remember it, just use <a href="https://codeforces.me/passwordRecovery">the password recovery feature</a>. Please, do it right now. * I've implemented a minimalistic website for replacing the main site in case of emergencies. Now you can only read problems, view your submissions (without any details), submit codes. Probably, later I'll add some more features, but anyway, the minimalistic version will have only vital fea...
sure that you know the password of your Codeforces account. If you don't remember it,just use , . * Be sure that you know the password of your Codeforces account. If you don't remember it,just use

Полный текст и комментарии »

  • Проголосовать: нравится
  • +3010
  • Проголосовать: не нравится

8.
Автор MikeMirzayanov, 3 недели назад, перевод, По-русски
Codeforces Round 1134 (Div. 4) Hello Codeforces! I am glad to invite you to [contest:2290], which will take place on [contest_time:2290]. After quite a long break, I have taken up problem setting again — this time working together with AI agents. For me, this is an experiment in getting back into problem writing, and we will see together how successful AI turns out to be as a partner in this work. I am looking forward to seeing both Div. 4 participants competing officially and everyone else joining out of competition! <div style="height:1em;"></div> <spoiler summary="Why I decided to author this round (a bit of lyrics and rambling)"> Yes, I am dictating these words into my phone right now, to put them into shape for you a bit later. We live in an amazing time when so many things are changing. I have been programming for more than 25 years now, and throughout almost all of this time I wrote code every day and solved problems every day. At first, these were mostly programming contest problems — ...
daughter just turned 15. I still remember sitting in the <https://codeforces.me/blog/entry/3102>, gears, get into the flow, and just be with myself. Sometimes I think that workouts for me are a kind, submissions, and the longest wait before judging started was just over three minutes — and even that, very executor you can already trust with quite a lot. Well, all of that is just lyrics. At the, you know, it still fascinates me just the same. For me, it is still a kind of magic and music — I, After solving literally just a few problems, almost like magic, new problem ideas and little, Well, all of that is just lyrics. At the same time, I feel that it would be sad to lose the skills

Полный текст и комментарии »

  • Проголосовать: нравится
  • +2339
  • Проголосовать: не нравится

9.
Автор Radewoosh, история, 6 лет назад, По-английски
My opinion on how to practice competitive programming I'm not very often replying to questions about how to practice, but as I'm getting enough of them (and I've just seen another blog about practicing) let me tell you about it. Of course, every time when you ask someone good about how to practice, he/she will reply to you to "solve a lot of problems" and that's true, there's no other way. Anyway, I've thought about it and actually I'm able to tell a bit more. I know some people, I've seen many people practicing (including me) and I have an opinion. Many people practice in some organized way. High schools organize IOI/OI training contests every Saturday, universities organize ICPC training contests once a week, people try by their own to solve three problems each day, websites host rounds and so on. Here's a secret: it's a sh*t. Yep, that's true. If you want to be really good and to make it happen you compete in a training once a week, you do it only to be able to make excuses "but I'm training so hard" when you see no progress. ...
(and I've just seen another blog about practicing) let me tell you about it., force yourself, just really feel a need to practice. You can't rush art, right?, them and you want to just practice weekly, then better go and reconsider if you really want to be, If any other top-rated coder wants to share his/her way or just point the differences &mdash

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1899
  • Проголосовать: не нравится

10.
Автор BledDest, 3 года назад, По-английски
I don't want this to get normalized I don't think comments like "you use X in model solution, author, are you an idiot?", "f**k you and your problems, they are shit" and such should be normal on Codeforces, especially when written by someone high-rated and/or respected in the community. I also don't think this kind of behavior should be normal towards regular users. I know that sometimes contests can be frustrating. Sometimes it is the participant's fault, sometimes it is the problemsetter's fault, sometimes it just happens without anyone being guilty of that. And I understand that in some cases, the criticism the author receives is fair and well-deserved. But there is a fine line between criticism, saying that you didn't like the problems, and hurling insults against the author. The former two are acceptable (and sometimes even needed, because authors have to improve and learn from their mistakes); the latter one, in my opinion, should not be acceptable. It's not like we can ever get rid of offense and hatred ...
it is the participant's fault, sometimes it is the problemsetter's fault, sometimes itjust happens, the main thing I wanted to state was that insults against anyone should not be acceptable. It'sjust, , sometimes it is the problemsetter's fault, sometimes it just happens without anyone being guilty of that

Полный текст и комментарии »

  • Проголосовать: нравится
  • +2126
  • Проголосовать: не нравится

11.
Автор Um_nik, история, 5 лет назад, По-английски
Things I don't know I'm just in a mood to shitpost. Don't take it too seriously. Things that I have heard of, but don't know (imagine how many things I haven't even heard of): - Li-Chao Segment Tree - Segment Tree Beats - RMQ in $O(n)$/$O(1)$ - Any self-balancing tree except treap - Link-cut tree - Wavelet tree - Mergesort tree - Binomial heap - Fibonacci heap - Leftist heap - Dominator tree - 3-connected components in $O(n)$ - $k$-th shortest path - Matching in general graph - Weighted matching in general graph - Preflow-push - MCMF in $O(poly(V, E))$ - Minimum arborescence (directed MST) in $O(E \log V)$ - Suffix tree - Online convex hull in 2D - Convex hull in 3D - Halfplane intersection - Voronoi diagram / Delaunay triangulation - Operation on formal power series (exp, log, sqrt, ...) (I know the general idea of Newton method) - How to actually use generating functions to solve problems - Lagrange Inversion formula - [...
I'm just in a mood to shitpost. Don't take it too seriously.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1965
  • Проголосовать: не нравится

12.
Автор MikeMirzayanov, 7 лет назад, По-английски
Goodbye 2019. Hello 2020! <img src="/predownloaded/85/58/8558df7ac8a1c33d501ea8fd9b18dd3d95886b90.png" style="width:290px; float:right; margin: 0 1.5em 1.5em 1.5em"/> I am happy to wish you a Happy New Year! I wish you a great, bright, interesting New Year! Just believe that it can become so: difficulties will be left behind, and ahead of you will be a joy of victories and discoveries. I wish all of us new interesting problems, records and achievements! Set new goals and be sure to try to achieve them! And do not go far, we will try to make your 2020 year more fun! I thank with all my heart for the contribution to the community of coordinators, problem writers, testers, and those who wrote interesting posts and comments. Many thanks to the sponsors, partners and customers: you help the community not to stand still, give the opportunity to hold interesting events. Thanks to all visitors to the website and just not indifferent. See you in the new year! &mdash; [user:MikeMirzayanov,2019-12-31]
events. Thanks to all visitors to the website and just not indifferent., great, bright, interesting New Year! Just believe that it can become so: difficulties will be left, I am happy to wish you a Happy New Year! I wish you a great, bright, interesting New Year!Just

Полный текст и комментарии »

  • Проголосовать: нравится
  • +2750
  • Проголосовать: не нравится

13.
Автор geranazavr555, история, 6 лет назад, По-русски
Streams on Codeforces Hello everyone! Today Codeforces got support for streams! Thanks [user:tourist,2020-10-21] for the great idea! There are two popular platforms supported: Twitch and YouTube. The opportunity to add streams to Codeforces is open to red participants and by individual invitations for now. We possibly open this opportunity to more users later. The idea is that streamers will be able to announce their streams to the Codeforces audience. To do this, you should add the stream to the site using a special section in your profile. Please, note that when adding a Twitch stream, you just need to specify the URL of your channel, and when adding a YouTube broadcast, its unique short link (URL like youtu.be/...) Shortly before the start of the stream, a notification about the upcoming stream will appear in the sidebar on the right, which will be shown to all site visitors. For example, right now there is a [user:Errichto,2020-10-21]'s stream announcement in the sidebar. ![Streams in ...
a special section in your profile. Please, note that when adding a Twitch stream, youjust need to, that when adding a Twitch stream, you just need to specify the URL of your channel, and when adding a

Полный текст и комментарии »

  • Проголосовать: нравится
  • +2387
  • Проголосовать: не нравится

14.
Автор errorgorn, 17 месяцев назад, По-английски
I Love CF I miss the old CF, Anton rounds cold CF Textbook sized blogs CF, no cheater blogs CF I hate the new CF, the captcha hell CF No Div 1s scheduled CF, just endless Div 4s CF I miss the sweet CF, debug till sleep CF I gotta say pre-GPT I’d like to meet CF See we invented CF, it wasn't any CF And now I look and look around just AI cheaters CF I used to love CF, I used to love CF I even made the rounds, I thought I was CF What if CF made a blog about CF Called “I Miss the Old CF," man that would be so CF That’s all it was CF, we still love CF And I love you like CF loves CF
invented CF, it wasn't any CF And now I look and look around just AI cheaters CF, the new CF, the captcha hell CF No Div 1s scheduled CF, just endless Div 4s CF

Полный текст и комментарии »

  • Проголосовать: нравится
  • +2377
  • Проголосовать: не нравится

15.
Автор YouKn0wWho, 5 лет назад, По-английски
Codeforces Round #735 (Div. 2) কি অবস্থা মামা? (That's Bengali for "What's up dude?") I am super excited to invite you to participate in [contest:1554] which will be held on [contest_time:1554]. This round is rated for future LGM participants whose current rating is $\le 2099$. You will be given $5$ problems and $2$ hours to solve them. All the problems are authored and prepared by me. I would like to thank - - [user:antontrygubO_o,2021-07-20] for his awe-inspiring coordination of the round <i style="color:White;"> and rejecting my problems, and thus hurting my feelings.</i> - [user:Um_nik,2021-07-20], [user:_Ash__,2021-07-25], [user:Anachor,2021-07-20], [user:Arg_007,2021-07-20], [user:Alpha_Q,2021-07-20], [user:DAleksa,2021-07-20], [user:steinum,2021-07-20], [user:tasdid,2021-07-20], [user:border,2021-07-20], [user:mk_Shahriar,2021-07-20], [user:t17,2021-07-20], [user:imAnik,2021-07-20], [user:Alfeh,2021-07-20], [user:Aritra741,2021-07-20], [user:FrozenBlood,2021-07-20], [user:SajidZakaria,2021-07-20]...
set out to do. You will eventually be happy. Just hold right there., to do. You will eventually be happy. Just hold right there. The statements are super short and I

Полный текст и комментарии »

  • Проголосовать: нравится
  • +2167
  • Проголосовать: не нравится

16.
Автор Radewoosh, история, 8 лет назад, По-английски
Blogewoosh #1 Hello, codeforces! The community wants so the community gets it! :D Here it is, my very first blog about tasks and algorithms. At the beginning I've decided to post my entries on codeforces, maybe I'll switch to something different if it becomes uncomfortable. To pour the first blood I decided to choose a task from one of the old ONTAK camps. Task's name is "different words" ([you can submit here](https://szkopul.edu.pl/problemset/problem/wTy-sxQCIKry0Ml-6RvM0L78/site/?key=statement)). The statement goes as follows: You are given $n$ words ($2 \leq n \leq 50\,000$), every of length exactly $5$ characters. Each character can be a lowercase letter, an uppercase letter, a digit, a comma... basically, it can be any character with ASCII code between $48$ and $122$ (let's say that $k$ is the number of possible characters). A task is to find all pairs of indexes of words which are $\textbf{really different}$. Two words are $\textbf{really different}$ if they differ at all $5$ corres...
might look problematic, but it turns out that it's easy to fix it. We shouldn't just assign zeros and, $ (so words would consist only of digits $0$ and $1$) then this task would be trivial. We'djust, If we've found some of the pairs, maybe we should just try one more time? But how should we change, just group words which are the same, and for each word its set of really different words would be

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1799
  • Проголосовать: не нравится

17.
Автор Error_Yuan, история, 3 года назад, По-английски
Goodbye 74TrAkToR + Problem A~E: The problems themselves are good and typical A~E. Indeed I like problem D. The pretest for A is a bit weak, and it's not a big problem yet. + Problem F: The problem has an origin. :) See the link: [click](https://www.luogu.com.cn/problem/P9394). The problem in contest is only a weakened version of the one in Luogu. + Problem G: It's said that our great coordinator had not proved the time complexity of the intended solution is correct :) If the authors did, please share it in the editorial. (although this problem is completely beyond my ability :) ) + Problem H: Oh dear [user:74TrAkToR,2023-12-30], could you please OEIS the sequence before you use the "several-integer-input" problem in rounds next time? Anyone who copied the first example and opened [https://oeis.org/A286331](https://oeis.org/A286331) could quickly get the formula. And the problem itself is not so hard imo. Anyway, it should not be used in contest, especially for the last problem. For me pers...
in my entry. He just said, "it's all history". :), ). A just-so-so round. Problem E, . He just said, "it's all history". :) **Edit4:** According to [Appeal. 74TrAkToR](https

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1597
  • Проголосовать: не нравится

18.
Автор MikeMirzayanov, 3 года назад, По-английски
Codeforces: Results of 2023 [Annual Report] Hello, Codeforces. Let's recall 2023, shall we? In this post, I want to summarize this year. You know, a lot of terrible things happen in the world, and personally, this year was the hardest and most sorrowful for me. But today, we'll remember something else. We'll remember what this year was like for Codeforces. Recently, Codeforces turned 14 years old. Not bad, right? And for many years now, when asked "What is Codeforces?" the first thing I say is — it's a community! [cut]<br/> #### Personal Thanks! On behalf of the community (and myself), I say thank you to everyone who tries, helps, and makes efforts to keep the community alive. Thank you to the developers! Although I continue to engage in development and other technical activities, I'm glad that these guys made an effort and improved the platform: [user:geranazavr555,2024-02-04], [user:unreal.eugene,2024-02-04], [user:vbandurin,2024-02-04], [user:ChurakovaAlexandra,2024-02-04], [user:medvezhonokok,2024-02-04]...
whole list of you! It's pleasant and valuable that our community attracts your interest! I'lljust list, ! I'll just list them: ICPC, Huawei, Harbour.Space University, Pinely, VK, Nebius, OZON, JetBrains, " style="max-width: 600px; width: 600px;"/> Polygon shows confident growth this year! Just

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1748
  • Проголосовать: не нравится

19.
Автор 244mhq, история, 11 месяцев назад, По-английски
Please try to be more positive in your feedback on the rounds. Hi, a few disclaimers first. 1. I work as a coordinator on CF, but this blog is solely my initiative (I didn't tell anyone from CF about it). 2. I was a few times in the author role, so I think that I have the right to speak on behalf of both authors and coordinators. Obviously, it doesn't mean that all authors/coordinators think the same, but (based on discussion with some people) I think that my opinion is not unpopular. Main point of this blog — I feel like our community is becoming much more aggressive towards any things (some of which I can't even call issues) that they don't like during the round. I don't think it's a good direction, and I think it can decrease the motivation of authors & coordinators to do more rounds. Now I will explain why I think so. Obviously, you might guess that this blog was inspired by yesterday's round, but also a few recent ones too (for instance, CF 1069, CF 1058). The first thing that any person will see on the home page now is that...
authors (and coordinators) to see that their work is being appreciated. And, just to emphasize what, press upvote on a round, even if you're slightly unhappy with it, just to encourage authors for future, And, just to emphasize what part of the work was done well:

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1436
  • Проголосовать: не нравится

20.
Автор Bakry, 4 года назад, По-английски
Red Isn't Impossible _I waited for more than a year to write this blog._ I started CP in July 2017, I always dreamed about reaching red, and it finally happened. I didn't become red like talented contestants in 1-2 years, but it took me more than that. The start of my CP journey was average (you can see my graph); It took me more than six months to reach pupil, then another six months to get specialist, and it took me more time to achieve higher ranks. I didn't have any mentor or coach. So, I asked many stupid questions, which you can find if you read my old blogs. One of these questions is, "What's the importance of Dynamic Programming?" (I drafted this blog xD), But of course, I don't motivate people to ask these types of questions as they usually can be answered by just searching. I failed many times during my journey in CP, especially in important competitions (IOI21 and IOI22). I stopped CP many times because I was frustrated and believed I could never improve. For example, I stopped when I w...
ask these types of questions as they usually can be answered by just searching. I failed many, usually can be answered by just searching.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1996
  • Проголосовать: не нравится

21.
Автор MikeMirzayanov, история, 11 месяцев назад, По-английски
Goodbye, 2025. Hello, 2026! <img src="/predownloaded/f4/1f/f41ff0beb745fb2f84a55d9f2cc451273efc6267.jpg" style="width:300px; float:right; margin: 0 1em 1em 1em"/> Goodbye, 2025. Hello, 2026! Dear Santa, Please make 2026 a happy year—not just for me, but for everyone. We all need this. Hello, 2026! And of course, we have our traditional gifts! #### <img src="https://assets.codeforces.com/images/wand.png"/> Change Handle Feature Hurry! Until January 10, you can change your handle (<b>but only once</b>)! Note that next time you will be able to roll back the change or request another handle change only _after a year (in December 2026)_. Choose wisely! You can change your handle to a new one that hasn't been used by anyone else, or to one that you've previously used. Links to your old profile will automatically redirect to your updated profile. Again this year, if you've participated in at least 10 rounds, you can request the handle of an _inactive_ participant. This means the participant...
a happy year—not just for me, but for everyone. We all need this. Hello, 2026! And of course, Dear Santa, Please make 2026 a happy year—not just for me, but for everyone. We all need this.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1507
  • Проголосовать: не нравится

22.
Автор MikeMirzayanov, 23 месяца назад, По-английски
Goodbye, 2024. Hello, 2025! <img src="/predownloaded/85/58/8558df7ac8a1c33d501ea8fd9b18dd3d95886b90.png" style="width:290px; float:right; margin: 0 1.5em 1.5em 1.5em"/> Goodbye, 2024. Hello, 2025! Dear Santa Claus, Please make 2025 a happy year—not just for me, but for everyone. We all need this. Hello, 2025! And of course, we have our traditional gifts! #### <img src="https://assets.codeforces.com/images/wand.png"/> Change Handle Feature Hurry! Until the 10th of January, you can change your handle (<b>but only once</b>)! Note that you can roll back the changes or request another handle change only _after a year_. Choose wisely! You can change your handle to a new one that hasn’t been used by anyone else, or to one that you’ve previously used. Links to your old profile will automatically redirect to your updated profile. Again this year, if you’ve participated in at least 10 rounds, you can request the handle of an _inactive_ participant. This means the participant must have had a perio...
, Please make 2025 a happy year—not just for me, but for everyone. We all need this. Hello, 2025, Dear Santa Claus, Please make 2025 a happy year—not just for me, but for everyone. We all need

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1508
  • Проголосовать: не нравится

23.
Автор antontrygubO_o, 5 лет назад, По-английски
Giving negative feedback to contests in comments //This is a short post motivated by the comment section of the last Div2 round (and of several rounds before) Every problemsetter tries to make his contest as good as possible, and is upset when something goes wrong. Most problemsetters don't set contests for money, the payments are not worth the time and efforts spent on coming up with problems, preparing them, and hosting the contest. The most rewarding thing in this process in not the money, it's to see contestants enjoying your problems. That's why feedback is so important. If the comment section is filled with comments praising the contest, setter will most likely want to come back with another contest, and if it's filled with hate and offenses, it's possible that setter will just give up on problemsetting and won't want to host another round. This means two things. First, if you liked the round, or some particular problem, why not to write a comment about it? I am sure that most setters would really appreciate it, a...
and offenses, it's possible that setter will just give up on problemsetting and won't want to host, hate and offenses, it's possible that setter will just give up on problemsetting and won't want to, ? These comments are not even telling what's exactly is wrong with the contest — it'sjust hate, This is another type of comments — just saying that some particular problem was bad/shitty

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1347
  • Проголосовать: не нравится

24.
Автор Qingyu, история, 21 месяц назад, По-английски
The 2025 Universal Cup Finals The best and brightest programmers from around the world have gathered this week in Dongguan, China, for the highly anticipated 2025 Universal Cup Finals! <center> <img src="/predownloaded/b8/c4/b8c48453572a7a497d0be10c665c67bfe5074593.jpg"> </center> ### Event Details - Date: Saturday, February 22nd - Start time: 10:30 AM CST (2:30 AM UTC) - See [participating teams](https://codeforces.me/blog/entry/136593) - Full schedule can be found [here](https://ucup.ac/news/announcement-2025-ucup-finals/) ### Streaming Witness the best contestants in the world as they push the boundaries of skill and strategy. You can be part of this event by following us online either on [English Channel](https://www.youtube.com/@que_tourist) or [Chinese Channel](https://live.bilibili.com/11464806). ### Mirror Contest Join the mirror contest and compete in real-time with the finalists from anywhere in the world. Any Universal Cup registered team can participate. The mirror contest is ...
isn't just a competition – it's a global celebration of competitive programming. Join us for The, This isn't just a competition – it's a global celebration of competitive programming. Join us for

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1645
  • Проголосовать: не нравится

25.
Автор Um_nik, история, 4 года назад, По-английски
Pro Tips - get them while they are free More tips to use while studying under my tutoring [here](https://um-nik.notion.site/Pro-Tips-8b923b0dc7c94770824bdf4184afc43c). ## Stop caring about the rating Unless there are prizes involved, your position in the standings makes no difference. I can feel awful after winning a contest if I know that I could solve one more problem. Or I can feel OK losing a bunch of rating points knowing that I solved everything I could.  Because rating is just a number. It is highly volatile and it depends on other people, not only on your skill. But solving problems is totally up to you. And you should evaluate yourself not based on some random metric, but on your honest feeling whether you performed up to your expectations. Your sense of self should be under your control, don't get hung up on some imaginary value, you cannot reduce your progress to a single number. ## Don't use more than one account Rating is just a number. Do not be afraid to lose your colour. You’ll get it back in no t...
bunch of rating points knowing that I solved everything I could. Because rating isjust a number, that I solved everything I could. Because rating is just a number. It is highly volatile and it, And besides, rating is just a number. Your sole goal during the contest should be to solve as much, No explanation needed. Just do it., Rating is just a number. Do not be afraid to lose your colour. You’ll get it back in no time if you, just some idea that you had, but it may not be the fastest or prettiest way to solve your problem.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1119
  • Проголосовать: не нравится

26.
Автор TLE, история, 8 лет назад, По-английски
Linear Recurrence and Berlekamp-Massey Algorithm **#IjustWantContribution** It seems there isn't any blog about Berlekamp-Massey Algorithm around here, so I decided to go on a try. :P Acknowledgement: Hats off to matthew99 for introducing this algorithm. #### What is 'linear recurrence'? Assuming there is a (probably infinity) sequence $a_0,a_1...a_{n-1}$, we call this sequence satisfies a linear recurrence relation $p_1,p_2...p_m$, iff $\forall i \geq m,~a_i=\sum_{j=1}^m a_{i-j}p_j$. (Obviously, if $m\geq n$ any $p$ can do :P) #### How to calculate k-th term of a linear recurrence? For a polynomial $f(x)=\sum_{i=0}^{t} c_ix^i$, we define $G(f)=\sum_{i=0}^{t} c_ia_i$. Obviously $G$ satisfies $G(f)\pm G(g) =G(f \pm g)$. Because $a_i=\sum_{j=1}^m a_{i-j}p_j$, if we let $f(x)=x^m-\sum_{j=1}^m x^{m-j}p_j$, then $G(f)=0$. Also $G(fx),G(fx^2)...=0$. So $G(fg)=0$ (g is any polynomial). What we want is $G(x^k)$. Because $G(f\lfloor x^k/f\rfloor)=0$, then $G(x^k)=G(x^k \bmod f)$. [cut] We can calculate $x^k \b...
to acquire the exact transition matrix (or maybe just you're lazy enough), and this algorithm makes

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1492
  • Проголосовать: не нравится

27.
Автор zscoder, история, 7 лет назад, По-английски
[Tutorial] Generating Functions in Competitive Programming (Part 1) Hi everyone! Inspired by the recent [Codeforces Round 641](https://codeforces.me/contest/1349), I decided to write an introductory tutorial on generating functions here. I am by no means an expert in generating functions so I will write about what I currently know about them. [user:MiFaFaOvO,2020-05-15] has written a really interesting [blog](https://codeforces.me/blog/entry/76447) here on Codeforces about more advanced applications of generating functions, but I think there is no English tutorial on the basics of this topic yet (or at least on CP sites). Thus, I would like to share about this topic here. I plan to split this tutorial into two parts. The first part (this post) will be an introduction to generating functions for those who have never learned about them at all, and some standard examples and showcases of generating functions. The second part will be a collection of several applications of generating functions in CP-style problems. If you are already familiar with ge...
generating functions, you may just skip to [Part 2](https://codeforces.me/blog/entry/77551) directly, $ terms of $e^{P(x)}$ in $O(n\log n)$ time, so we just need to compute the first few terms of our EGF, , you may just skip to [Part 2](https://codeforces.me/blog/entry/77551) directly., Actually, what we just did is a special case of the more general Exponential Formula. However, I, Back to our problem, we want to write everything in terms of $B(x)$. RHS is easy, since it isjust, In other words, the EGF is just the OGF but every term $a_{i}$ is now divided by $i!$. Why the, The LHS is easy to intepret: it is just $C(x) - 1$., The proof is just differentiating the left side $n$ times and compare the constant term. I leave, This is just a direct consequence of convolution, but I include it here because it is so commonly, To get the answer, we just need to find $n![x^{n}y^{k}]H(x,y) = n![x^{n}]\frac{(e^{x}-1)^{k}}{k, \sum_{n \ge 0}\binom{k}{n-k}x^{n-k}$, since it is just $\displaystyle\sum_{r \ge 0}\binom{k}{r}x^r$ in

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1299
  • Проголосовать: не нравится

28.
Автор Um_nik, история, 2 года назад, По-английски
On AI ruining "solving math problems with computer" You all went crazy. Instead of arguing with every opinion separately, I just want to ask one question: Why are you doing competitive programming? Is it to get to 1600 rating and put it on the resume? If so, please use AI, cheat, and do everything possible to get to 1600 as soon as possible and get the f**k out of this platform. And if you are (not) a normal person and do competitive programming because it is fun to solve problems, do you think it is fun to copy the problem statement into an AI model prompt and then copy the code it spews to submit? And why do you assume that everyone else will do that if there will be such an opportunity? The same goes for cheaters. Yes, some people do not do this as a sport, for fun. Why do you care? I do think that AI is ruining competitive programming. By proxy. And that proxy is all of you who are running around yelling "We will all die, somebody do something about AI". I have seen a couple of comments saying "authors/coordinators must make s...
a better complexity than $O(n^2)$. Why? Instead, we could just make tests for $n \le 100$ to check, what we collectively agree to be one of the best div2A ever just because "a machine can guess it"?, Instead of arguing with every opinion separately, I just want to ask one question: Why are you, You all went crazy. Instead of arguing with every opinion separately, I just want to ask one

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1199
  • Проголосовать: не нравится

29.
Автор -is-this-fft-, история, 5 лет назад, По-английски
Self-deception: maybe why you're still grey after practicing every day I generally don't like to give much advice on "how to practice", but recently I have been thinking a lot about this and I realized that there is something that I believe affects a lot of people (though it is admittedly hard to tell) that barely gets talked about: self-deception. Self-deception is a devious thing. It can be very hard to detect, yet can be fatal to improvement. This blog is mainly directed to greys, greens and cyans that can't get out of these categories. Most examples are given with that in mind. That being said, I believe others have something to think about as well. This is my first blog on such "psychological issues" and I don't know if I'll ever make another one. It's certainly a difficult topic to write about because for most of the blog, the message is "your practice is not as good as you think it is" or even "you aren't as good as you think you are" which can of course be a hard thing to hear. Thus, I have to somehow be very gentle while getting the poin...
easier to you you will solve. The ones that you don't immediately solve you just kind of... leave be. Or, everything you do. Read this blog carefully. More than once I have explained these ideas and peoplejust, gives you a reason to do CP instead of something else, but it's not enough. If youjust watched a, like I slogged through them — just kinda did them, with overall less interest in solving the, Read this blog carefully. More than once I have explained these ideas and people just walk away, just once. You may discover that coming up with ideas is far more possible than you perhaps think.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1292
  • Проголосовать: не нравится

30.
Автор MikeMirzayanov, 4 года назад, По-английски
Goodbye 2022. Hello 2023! <img src="/predownloaded/f4/1f/f41ff0beb745fb2f84a55d9f2cc451273efc6267.jpg" style="width:300px; float:right; margin: 0 1em 1em 1em"/> Dear Santa Claus. Please make 2023 a happy year, not just that. Please, we all need this. Hello, 2023! And we have traditional gifts! #### <img src="https://assets.codeforces.com/images/wand.png"/> Change Handle Feature Hurry! Only until the 10th of January, you can change your handle (<b>but only once</b>)! Note that it will be possible to roll back the changes or change the handle again only _after a year_. Be careful what you wish for. You can change your handle to the new one which wasn't used before by anybody or which was used by you before. The links to a profile page with an old handle would automatically redirect to the actual profile. Again, this year if you took part in at least 10 rounds you can request a handle of an _inactive_ participant. It means that the participant should have a period of activity on Codeforces of...
; float:right; margin: 0 1em 1em 1em"/> Dear Santa Claus. Please make 2023 a happy year, notjust, Dear Santa Claus. Please make 2023 a happy year, not just that. Please, we all need this.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1424
  • Проголосовать: не нравится

31.
Автор NXIST_buster, история, 6 лет назад, По-английски
Corruption, Cheating at ICPC Yinchuan This blog is about Corruption and Cheating at ICPC YinchuanRegional. ICPC Yinchuan Regional is one of the ICPC regional contests for students competing in the geographic area of Asia East Continent. I. Background: General Info ------------------ Ningxia Institute of Science of Technology, or NXIST is a higher education institute in China. Since 2019, NXIST has held two regional contests. The and both were considered by many participants as jokes, yet until today participants are unaware of the NXIST's extent of evil. Zhihu is a Chinese website similar to Quora, and I will refer to this website for information. II. Background: Before 2021 ------------------ Regional competitions in China consists of two stages: The online selection contest and the onsite regional contest. As there are many contestants in China, the online contest is considered serious and rules are usually strictly enforced, with entire universities where some participant cheats disqualified from attend...
"Just For Fun" and these teams are official. These teams were later awarded medals from the contest, , yet NXIST later said that the stars were "Just For Fun" and these teams are official. These teams, Just now, the judges and testers of ICPC Yinchuan regional reported that "from the contest archive

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1685
  • Проголосовать: не нравится

32.
Автор Enchom, 12 лет назад, По-английски
Who sorry_dreamoon really is Hello everybody. So I was really bored tonight and looked at so many comments being like "[user:sorry_dreamoon,2015-02-18] is X" and then people arguing and disagreeing. Since I had nothing better to do, I decided to finally unravel the truth of who he actually is. Here is the full case and how I actually got to him, hope you enjoy! :D Selection ------------------ Let's start by the obvious. He managed to get first place in Div2 and he got second in Div1 (would've been first if the scores were static). So what we know is that he is really good. Let's look at the past 10 Div1 contests. It turns out that only 8 times it happened that someone with a rating of less than 2500 got in top5. This is 8 times out of 50 people being in top5. But he was second and almost first, so he is better than that. It turns out actually, that in the past 10 Div1 contests, only 2 times it happened that someone with rating less than 2500 got in top3. Combining this information with [user:sorr...
This is just a small fraction of the flow class. About 90% of it is completely identical.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1383
  • Проголосовать: не нравится

33.
Автор Kuroni, история, 6 лет назад, По-английски
Codeforces Round #715 <p style="text-align: right;"> <i> "Love" is a violent word.<br> "I love that about you..." Doesn't that just mean "If that changed, I wouldn't love you anymore?"<br> "Love" is a word that binds you.<br> — Touko Nanami — </i> </p> Hi Codeforces! [user:Ari,2021-04-13] and I are pleased to invite you to participate in [contest:1508] and [contest:1509], which will be held at [contest_time:1508]. Each division will have **6 problems** and **2 hours and 15 minutes** to solve them. Big thanks to the following people: - Sir [user:antontrygubO_o,2021-04-13] for being an amazing coordinator; the round wouldn't happen without you ❤️ - [user:Scrubpai,2021-04-13], [user:1-gon,2021-04-13], [user:hugopm,2021-04-13], [user:tfg,2021-04-13], [user:dorijanlendvaj,2021-04-13], [user:xuanquang1999,2021-04-13], [user:300iq,2021-04-13], [user:Mike4235,2021-04-13], [user:Luminal,2021-04-13], [user:QuangBuiYT,2021-04-13], [user:jamienguyen,2021-04-13], [user:Pichu,2021-04-13], [user:ch...
..." Doesn't that just mean "If that changed, I wouldn't love you anymore?" "Love" is a word that

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1371
  • Проголосовать: не нравится

34.
Автор MikeMirzayanov, история, 20 месяцев назад, По-английски
My Reply on "Mike, please stop ignoring your userbase" This is a response to [this post](https://codeforces.me/blog/entry/141442). Originally, I intended to leave it as a comment, but the text turned out to be quite long. So I decided to publish it as a separate post. Hi! Let me start with the main idea: I don't think I ignore too many issues (though I do ignore some). In most cases, I do work on them, but these days I just don't feel like writing about it. That kind of communication takes a lot of energy &mdash; which I currently don't have. Oh, it looks like you edited the beginning of the blog, and now it triggers less of an internal protest in me. Honestly, lately I've been in a difficult emotional state, and I just don't have the energy or desire to interact much. It's not just about Codeforces &mdash; it's generally harder for me to engage than it used to be. I won't go into details (health, relocation, family issues, changes in the nature of my work due to bots) &mdash; all of that affects my mental state and willingne...
(though I do ignore some). In most cases, I do work on them, but these days I just don't feel like, effort just to keep the site running and to avoid total data scraping by AI bots. They ignore both, protest in me. Honestly, lately I've been in a difficult emotional state, and I just don't have the, ). In most cases, I do work on them, but these days I just don't feel like writing about it. That kind, This post ended up much longer than I planned, but I just wanted to share what's been going on

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1425
  • Проголосовать: не нравится

35.
Автор MikeMirzayanov, 10 лет назад, По-русски
Codeforces: summing up 2016 year <center> <img src="http://assets.codeforces.com/images/Happy-New-Year-HD-Wallpapers.jpg"/> </center> Somehow it turns out that for me, each coming the New Year means more and more. This is an excellent opportunity to take stock, to breathe fresh air and to go through a kind of catharsis. This is a rare opportunity to be with the family, dress up in Santa Claus and just have fun. Holidays give me a clear criterion that I do the right things. If during the holidays, I begin to think about it, to recall some deferred ideas, eager to implement something new. So I’m doing right things. My things. And now exactly the same as in several recent years: during New Year holidays I write code for Codeforces, trying new technology or simply I’m making minor changes in testlib. It is necessary to me: at this moment are no deadlines, do not press the obligation. Just now, at 3 am, I can not break away from being able to do something new. I would like to take a moment and realize that spun in ...
is a rare opportunity to be with the family, dress up in Santa Claus and just have fun. Holidays, many as done in the previous year. But just look at this beauty!, necessary to me: at this moment are no deadlines, do not press the obligation. Just now, at 3 am, I, rare opportunity to be with the family, dress up in Santa Claus and just have fun., just show themselves to you. Very pleased that this year the list of our partners long and varied

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1405
  • Проголосовать: не нравится

36.
Автор MikeMirzayanov, 5 лет назад, По-английски
New Year Gift: Codeforces Catalog — Early Access <img style="float:right; margin: 1em 0 0 0; width:200px;" src="/predownloaded/13/56/1356aec5e821992f4dc1d1c8b297917eae36d5be.jpg"/> Hey! Are you celebrating the New Year already? I wish you a Happy New Year. I wish you progress, joy and health. We decided to show the current progress in the catalog of significant Codeforces posts. So far, quite a bit has been implemented, but somehow you can already use it! Would you like to see it? Follow the link: <br/> <div style="font-size:30px;"><a href="https://codeforces.me/catalog">Catalog &rarr;</a></div> <br/> As planned, the catalog will collect and classify interesting and useful posts from Codeforces. Indeed, many useful articles have been written in Codeforces over 12 years (God, already 12 years!). The catalog will be a kind of Codeforces golden fund in the future. The catalog is a tree of topics to which posts can be added. We will still work on its functionality, for now there are only basic features. Don't ...
be discouraged if something is not supported, which is very necessary — just let me know, is very necessary — just let me know!

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1754
  • Проголосовать: не нравится

37.
Автор Errichto, 11 лет назад, По-английски
Good Bye 2015 Hi everybody. The last round of the 2015 will take place on the 30-th of December ([starting time](http://www.timeanddate.com/worldclock/fixedtime.html?day=30&month=12&year=2015&hour=18&min=5&sec=0&p1=166)). The contest will last 3 hours. It won't be a usual round. Both divisions will compete together. You will get 8 problems to solve in 3 hours. Points will decrease slower than usually &mdash; otherwise you would get eps for solving a problem at the end. Scoring will be announced just before a contest. So will the speed of the points/minute loss. My goal was to provide you a diverse problemset with interesting problems for all contestants. During a contest you should consider reading not only the next problem but the few next ones. You will get this round thanks to work of many people. I am a problem setter. [user:GlebsHP,2015-12-28] helps me with everything (a lot). [user:AlexFetisov,2015-12-29], [user:johnasselta,2015-12-29] and [user:Zlobober,2015-12-29] are t...
solving a problem at the end. Scoring will be announced just before a contest. So will the speed of the, just before a contest. So will the speed of the points/minute loss. My goal was to provide you a

Полный текст и комментарии »

Анонс Good Bye 2015
  • Проголосовать: нравится
  • +1387
  • Проголосовать: не нравится

38.
Автор Um_nik, история, 5 лет назад, По-английски
How to practice Competitive Programming [Um_nik version] CP is about solving problems fast. And as absurd as it may sound, I believe that <span style="color:blue">SOLVE</span> and <span style="color:red">FAST</span> are very different and almost independent parts, and you need to practice them separately. Let’s look at some <span style="color:red">contest</span>, like a CodeForces round. For the sake of simplicity let’s assume that every problem has some *difficulty*, which is a numerical value denoting how hard it is, bigger values correspond to harder problems (it is not true, but it is an ok-ish approximation, at least if we consider subjective difficulty for a fixed person). Contests are made for a wide range of participants, and problemsetters strive to make contests interesting for a wide range of participants, which means having a *smooth difficulty gradient*. Well... as smooth as it is possible with 5-6 problems. <spoiler summary="Graph 1"> ![ ](https://s3.us-west-2.amazonaws.com/secure.notion-static.com/677e0ae2-a8df-4874-aff...
good to keep you in competitive shape. Also participating in contests is just fun, that’s also very, that just are classical in contests. - It is hard to make a training regime out of, , or for a hint, just a yes/no question. Most of the time the answer will be “No”. In the case of a, ://codeforces.com/blog/entry/62730) or just being stupid. My experience even says that most Russian, =GetObject) Just by having a lot of problems archives can, Just by having a lot of problems archives can almost always provide

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1117
  • Проголосовать: не нравится

39.
Автор SanguineChameleon, 19 месяцев назад, По-английски
Seems like a notorious coincidence #### _1 minute before contest starts_ Alright, this is it. The round is starting soon. I hope everything goes well! #### _9 minutes after contest starts_ ...What? Someone solved H already? Uh oh. Okay, maybe they are just really good at XOR problems. #### _40 minutes after contest starts_ Oh! An LGM solved it. Let's look at their submission... ~~~~~ // https://yukicoder.me/problems/no/2990 ~~~~~ Oh. Oh no. Oh no no no no no. --- Hi, so to me seems like a notorious coincidence. I was the author of problem H, and unfortunately, it exactly coincides with [No.2990 Interval XOR](https://yukicoder.me/problems/no/2990) on yukicoder. Just to be **absolutely clear**, I had the idea for H long before that: - I thought of problem H in January 2024. - The problem was proposed in February 2024. - The problem was approved in October 2024. - The problem on yukicoder was released in December 2024. Here are some obligatory evidence screenshots: <spoile...
idea is just really unfortunate., Just to be **absolutely clear**, I had the idea for H long before that:, Okay, maybe they are just really good at XOR problems.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1133
  • Проголосовать: не нравится

40.
Автор antontrygubO_o, 6 лет назад, По-английски
Some thoughts on recent discussions Hello everyone! I finally decided to write some response/explain my view after all recent discussions of my problems and rounds I coordinate, and I would like to make a few points. **1.** After some recent contests there were a lot of comments saying that Data structure problems should appear as easy problems (say, D2A-D2D in a Div2 of $6$ problems) ![ ](https://i.imgur.com/fmA8zgE.png) ![ ](https://i.imgur.com/m4pJLv6.png) ![ ](https://i.imgur.com/JsryG77.png) I don't think I agree with this. To begin with, I don't think that having Data Structure problem is a requirement for a good contest at all, not just in first few positions. ![ ](https://i.imgur.com/VWAOgxg.png) However, for positions D2A-D2D, I just don't see a way to properly include data structure problems. Take some Data Structure problem, it consists from two parts: <ul> <li> Knowing/implementing the Data Structure </li> <li> Actually thinking about the problem, and how this Data Structure...
a requirement for a good contest at all, not just in first few positions., fit positions D2A-D2C. Just because that concepts themselves are already quite challenging., for a good contest at all, not just in first few positions. ![ ](https://i.imgur.com, how to apply them, this won't help. That's why you should learn how to solve problems, notjust, **5.** Some people think that I just won't accept Data Structure/Flow/Some string structures, And I don't want to accept standard problems on DP/Binary Search/Graphs just to make the set more, However, for positions D2A-D2D, I just don't see a way to properly include data structure problems

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1111
  • Проголосовать: не нравится

41.
Автор MikeMirzayanov, 6 лет назад, По-английски
Codeforces: Results of 2020 [list some changes and improvements] Hello, Codeforces! I understand that 2021 has been going on for a long time, but here I have picked up a subset of some of the improvements that the Codeforces team made in 2020. Soon I will publish numbers (no, charts) with statistics for 2020. In the meantime, I bring to your attention a list of changes and improvements. By the way, this is a decent list. This is about half to a quarter of all changes. It's just that other changes are more often somewhere in the internals of the system and are not visible to users. Please read this list. Each item is the effort of someone from the team. Thanks to [user:geranazavr555,2021-03-14], [user:kuviman,2021-03-14] and [user:cannor147,2021-03-14] for their efforts. You've made our platform better! Well, by the way, I don't quit programming and many improvements were made by me. The items on the list are written in a concise and informal form, many of the items I just copied from commit messages from git. If you want more details &mdash...
of all changes. It's just that other changes are more often somewhere in the internals of the system, By the way, this is a decent list. This is about half to a quarter of all changes. It'sjust that, The items on the list are written in a concise and informal form, many of the items Ijust copied

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1394
  • Проголосовать: не нравится

42.
Автор YouKn0wWho, 5 лет назад, По-английски
(The Ultimate) Code Library Hey everyone, I am sharing my personal code library where I compiled **almost all** the important templates that you will need in CP (saying almost just for courtesy). Most of the codes are originally written by me and some of them are collected from others but modified in a cleaner way. Link: [https://github.com/ShahjalalShohag/code-library](https://github.com/ShahjalalShohag/code-library) It took me around 4 years to complete the list. Maybe each line is just a line to you but to me it tells a story of the excitements I had while learning those stuffs, the sleepless but fun nights I had to seek knowledge. ###### Why am I sharing this library? - Just so that your learning path becomes a bit smoother. - Knowledge hidden inside my head or codes in a private code-library will be useless when I am dead, so it's better to share those among people before I die. Also, you can make me happy(as in to pay me) just by upvoting this blog and giving a star to the repository. I beli...
templates that you will need in CP (saying almost just for courtesy). Most of the codes are, ###### Why am I sharing this library? - Just so that your learning path becomes a bit smoother, Also, you can make me happy(as in to pay me) just by upvoting this blog and giving a star to the, It took me around 4 years to complete the list. Maybe each line is just a line to you but to me it

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1334
  • Проголосовать: не нравится

43.
Автор tourist, 3 года назад, По-русски
Code Weekend #1 <div align="right" margin="20px"> <img align="right" src="/predownloaded/72/f1/72f1f31badb1452243838a0fc2553c04accff164.jpeg" alt="logo" width="300px" height="300px" margin="20px"/></div> Hello everyone! We, the [RGBTeam](https://clist.by/team/Romka,tourist,%E2%88%A83886090/) ([user:qwerty787788,2024-05-21], [user:Romka,2024-05-21] and [user:tourist,2024-05-21]), are huge fans of heuristic programming competitions and are quite saddened by the fact that they are becoming less and less frequent each year. One day, we decided to organize our own competition :) Despite the fact that such ideas often remain just ideas, this time we have a serious mindset, and now we want to invite you all to participate in the first — and hopefully not last — **[Code Weekend #1!](https://codeweekend.dev)** The competition will be held in a format quite similar to ICFPC/Google Hashcode — there will be one problem and several dozen tests for it. You will need to submit just an output according to t...
ideas often remain just ideas, this time we have a serious mindset, and now we want to invite you, problem and several dozen tests for it. You will need to submit just an output according to the, remain just ideas, this time we have a serious mindset, and now we want to invite you all to

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1034
  • Проголосовать: не нравится

44.
Автор Ari, история, 6 лет назад, По-английски
On Problems vs. Questions in Competitive Programming: My solution _TL;DR: The most reasonable solution to the problems vs. questions debate is to use none of the currently accepted terms._ As we have seen many times, particularly over the past few days, the task of assigning a label to the activities we perform as competitive programmers is a bigger problem than one might think at first. Time and time again we have seen people questioning what we should call our activities, often to the point of eliciting some rather harsh responses. To give some context to this discussion, I will focus on two of the terms that members of the community have adopted over the years, _problems_ and _questions_. (Sorry task lovers! You have some fine points for sure, we frequently talk about subtasks rather than subproblems or subquestions after all :P). All quotations here are posted anonymously, but if you want to claim ownership of one of them or have one removed, just tell me. If you are familiar with the arguments, feel free to skip to the final section of the...
fun of it. Indian English is different from American English or British English, but it'sjust that, international communities to know the word, freeing it from racial associations. 5. It'sjust really, or have one removed, just tell me. If you are familiar with the arguments, feel free to skip to the, , just tell me. If you are familiar with the arguments, feel free to skip to the final section of, > Cause question is just a wrong word for describing algorithmic problems. Question is meant to be

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1178
  • Проголосовать: не нравится

45.
Автор EvenImage, история, 7 лет назад, По-английски
A problem collection of ODE and differential technique ##A problem collection of ODE and differential technique *This problem might be well-known in some countries, but how do other countries learn about such problems if nobody poses them.* For those who are interested in well-known problems in China. Thank [user:Elegia,2020-04-23] and [user:djq_cpp,2020-04-23] for developing this technique. Thank [user:tEMMIE.w.,2020-04-23] for reviewing this article. ####[Chain Reaction](http://uoj.ac/problem/50) in UOJ Round 3 By [user:vfleaking,2020-04-23] **Statement** ​ You are given a set $A$, you need to compute $g_{i} = \frac{1}{2} \sum_{j,k}{i-1 \choose j}{i-1-j \choose k} g_jg_k$ where $i-1-j-k \in A$. **Solution** ​ Let the EGF of $g$ be $x(t)$ and EGF of $A$ be $a(t)$. Thus $x'(t)=\frac{1}{2} a(t) x^2(t)+1$. We can solve this equation by D&C and FFT in $O(n\log^2 n)$. But there is a <s>slower</s> solution in $O(n\log n)$. ​ For a polynomial equation $f(x(t))=0$, we can use the Newton's method to solve it. If we find ...
it might be possible to improve it to $O(n \log a)$ or just $O(n\log n)$ but without $\exp, \ln$., )$. So we can just replace the derivative of the DGF in the above argument to this transformation.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1044
  • Проголосовать: не нравится

46.
Автор MikeMirzayanov, 7 лет назад, По-английски
Testing Round #16 (Unrated) Hello, Codeforces! Paul [user:stingray,2020-05-07] Komkoff is my hero! He found some issues in the network configuration. The most important of them was about flow control auto-negotiation: in case of our network routers the number of dropped packets reduced in times. Thanks! To be sure that it really helped to fix the issue I ask you to take part in [contest:1351]. It will start on [contest_time:1351]. Probably, it will contain 3 easy problems which are not prepared for now (I'll use some old problems, I think). The only reason to host the round is to check the system under a load. It will be an unrated round. I am upset about what happened with the last round. Once again, I apologize to both the participants and the writer, coordinator and testers. I wrote [user:Monogon,2020-05-07] about the incident and apologized. I am sure that the only way to **absolutely** prevent unrated rounds is just don't host them. And this is not my way. The most popular rounds were hosted with...
unrated rounds is just don't host them. And this is not my way. The most popular rounds were hosted, I am sure that the only way to **absolutely** prevent unrated rounds is just don't host them. And

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1625
  • Проголосовать: не нравится

47.
Автор MikeMirzayanov, 9 лет назад, По-русски
Codeforces: Results of 2017 <img src="/predownloaded/e4/09/e40915ee54c5991b91098756a90270d94be893b3.jpg"/> Happy New Year, Codeforces! I hasten to wish the whole community (and including me) correct programs, sudden insights, beautiful ideas and interesting problems! I hope that you have met the new year at least as fun as I am. Have you had enough sleep after New Year's Eve? This year, the traditional post summarizing the past year, I sat down to write only on January 1, 2018. I hope that I will not have to sum up the whole year. This post is important to me, since it draws a line to all the work done by the Codeforces team and the entire community in 2017. Many thanks to the team: all of the achievements listed below are the result of joint efforts. We did an excellent job! The community must know its heroes. In 2017, [user:MikeMirzayanov,2018-01-02], [user:KAN,2018-01-02] (problem coordinator), ~gritukan,2018-01-02 (second problem coordinator), ~netman,2018-01-02 (ex-second problem coordinator), ~k...
just show themselves to you. Very pleased that this year the list of our partners long and varied

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1319
  • Проголосовать: не нравится

48.
Автор neal, 8 лет назад, По-английски
Don't use rand(): a guide to random number generators in C++ Don't use `rand()`. Why? Let's jump right into some code. What value will the following code print, approximately? ~~~~~ #include <cstdlib> #include <iostream> using namespace std; const int ITERATIONS = 1e7; int main() { double sum = 0; for (int i = 0; i < ITERATIONS; i++) sum += rand() % 1000000; cout << "Average value: " << sum / ITERATIONS << '\n'; } ~~~~~ Should be about 500,000, right? Turns out it depends on the compiler, and on Codeforces it prints 16382, which isn't even close. [Try it out yourself](http://codeforces.me/contest/1025/customtest). ### What's happening here? If you look up [C++ documentation on `rand()`](https://en.cppreference.com/w/cpp/numeric/random/rand), you'll see that it returns "a pseudo-random integral value between `0` and `RAND_MAX`." [Click again on `RAND_MAX`](https://en.cppreference.com/w/cpp/numeric/random/RAND_MAX) and you'll see that "This value is implementation dependent. It's guaranteed that th...
., how long until the sequence takes to repeat). So the lowest bit has a period ofjust **2**, the, One last thing: if you want 64-bit random numbers, just use `mt19937_64` instead., `rand()` itself has more quality problems than just `RAND_MAX` being small though; it is typically

Полный текст и комментарии »

  • Проголосовать: нравится
  • +891
  • Проголосовать: не нравится

49.
Автор dXqwq, 2 года назад, По-английски
Mike, alts and unfriendly comments I know that the following content might not be welcomed and I will lose lots of contribution, but I should write something about such a bunch of chaotic comments under there. I may delete this tomorrow if I find my words useless. ### What happened Several months ago, Mike posted a blog about banning [user:orzdevinwang,2024-10-07]'s alt, [user:zh0ukangyang,2024-10-07], and more alts. Lots of participants, including myself, were angry because [user:zh0ukangyang,2024-10-07] is such a talented coder and codeforces didn't treat the rule of single account seriously at that time. Then more and more alt accounts with high rating are reported, including mine. After that I didn't use alts anymore, and most of high-rated Chinese participants(100% in my friends) discarded their alts and followed the rules. We might think that the rules are not that perfect, but rules are rules. I believe that no one will say "Banning [user:zh0ukangyang,2024-10-07] is unacceptable". But I know what y...
can do is just follow the rules and protect our environment. I fell in love with coderforces 6 years, in the last round, Mike just banned some accounts. I heard that you will be banned if you login to, rules is acceptable and may lead codeforces to a better platform of CP. Just shouting and attacking, So in the last round, Mike just banned some accounts. I heard that you will be banned if you login

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1016
  • Проголосовать: не нравится

50.
Автор Endagorion, 12 лет назад, перевод, По-русски
Codeforces Round #300 (with prizes!) Hello, Codeforces! [On Sunday, April 26th at 19:00 MSK](http://www.timeanddate.com/worldclock/fixedtime.html?day=26&month=4&year=2015&hour=19&min=0&sec=0&p1=166) the 300'th regular Codeforces Round will take place. I would like to congratulate all Codeforces members and administration on this remarkable milestone. The platform has grown hugely in size and quality since its foundation, has hosted lots of exciting competitions, and has been providing the opportunity to everyone to hone their problem solving and algorithmic mastery. For this we thank the Codeforces platform creator [user:MikeMirzayanov,2015-04-24] and all the Codeforces crew. Keep up the incredible job, guys! That being said, I'm excited to announce that the problems on the jubilee three-hundredth Codeforces Round will be set by me, Mikhail Tikhomirov ([user:Endagorion,2015-04-24]). You may remember the past rounds with my problems: [#99](http://codeforces.me/contests/138,139), [#109](http://codeforces.me/contest...
interesting and satisfying problem just for themselves! The scoring will be announced later.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1212
  • Проголосовать: не нравится

51.
Автор HosseinYousefi, 12 лет назад, По-английски
C++ Tricks I see lots of programmers write code like this one: ~~~~~ pair<int, int> p; vector<int> v; // ... p = make_pair(3, 4); v.push_back(4); v.push_back(5); ~~~~~ while you can just do this: ~~~~~ pair<int, int> p; vector<int> v; // ... p = {3, 4}; v = {4, 5}; ~~~~~ [cut] [This](http://codeforces.me/blog/entry/10124) is a great C++11 tutorial for those who want to know more about C++11. #### 1. Assign value by a pair of {} to a container I see lots of programmers write code like this one: ~~~~~ pair<int, int> p; // ... p = make_pair(3, 4); ~~~~~ while you can just do this: ~~~~~ pair<int, int> p; // ... p = {3, 4}; ~~~~~ even a more complex `pair` ~~~~~ pair<int, pair<char, long long> > p; // ... p = {3, {'a', 8ll}}; ~~~~~ What about `vector`, `deque`, `set` and other containers? ~~~~~ vector<int> v; v = {1, 2, 5, 2}; for (auto i: v) cout << i << ' '; cout << '\n'; // prints "1 2 5 2" deque<vector<pair<in...
, pair > >::iterator` for me it's so suffering! just use auto it = s.begin(), ; // ... p = make_pair(3, 4); v.push_back(4); v.push_back(5); ~~~~~ while you canjust do this, And that's why `emplace_back` faster: `emplace_back` is faster than `push_back` 'cause itjust, Here, I just changed `int` to `T` and added `typename T` to my template., Trust me, that's a lot of code for that, just use this:, We can also change the values just change `auto` with `auto &`:, When you work with STL containers like `vector`, you can use `move` function to just move container, one) Capture List: simple! We don't need it here, so just put `[]`, while you can just do this:

Полный текст и комментарии »

  • Проголосовать: нравится
  • +971
  • Проголосовать: не нравится

52.
Автор MinakoKojima, история, 11 лет назад, перевод, По-русски
My sad story Teams advancing to 2016 WF Phuket in Asia have been announced recently. This announcement is undisputedly tantamount to a death sentence for me. I am the one waiting anxiously, refresh Dr. Hwang's blog everyday. But it seems that for years, our training was meaningless. I think many of us dedicate our passion to programming contests because we see them transparent, fair and without any corruption. And I also believe that as contestants, what we should do is only focus on the practice. And I thought those political business should never come to bother me one day. But sadly, it is my team who is going to become one of the sacrifices of a succession of the dissension. What happened so far ------------------ The quarrel between the Asia director and the local community is [a long story](http://blog.sina.com.cn/s/blog_b946da100101q21y.html) to tell. But it has never been as serious as it was in the past season. Now reflecting on this, I know on the surface everything is going okay...
Dr. Hwang make decision should be questioned. What Dr. Hwang do this time is just to make an example, extra slot to Chennai is just a sleight of hand designed to look like it is fair. My wish, which Dr. Hwang makes decision should be questioned. What he has done this time isjust to make an, Dr. Hwang has just replied to me that he will try after one week for an additional participation

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1310
  • Проголосовать: не нравится

53.
Автор tourist, 6 лет назад, По-английски
touristreams are back! 006: SNSS 2020 R1, and more It's this time of the year again! Tune in at [twitch.tv/the__tourist](https://twitch.tv/the__tourist) at around [21:45 MSK, 21 Aug 2020](https://www.timeanddate.com/worldclock/fixedtime.html?msg=touristream+006&iso=20200821T2145&p1=3396) to watch me solving [SnarkNews Summer Series 2020 Round 1](https://contest.yandex.com/snss2020/contest/19320/enter) live! First I will do the round competitively without much interaction, and I'll be up for discussing the problems on stream afterwards. SnarkNews Winter/Summer Series (SNWS/SNSS) is organized by [user:snarknews,2020-08-19] yearly and consists of 5 rounds. Each round is a virtual 6-problem 80-minute contest open for 10 days. The series is open to all, but problem statements are in Russian only. Unlike last series, I'll be reading problem statements automatically translated to English on stream. To make the stream more fun and for easier understanding of what will be going on, you're welcome to do the round yourself beforehand! If...
automatic translators. Alternatively, you may just read the problems without solving them. In any case, may just read the problems without solving them. In any case, **don't discuss the problems in, **UPD4:** Just a friendly reminder: Round 3 ends in less than 24 hours, and thus my next stream is

Полный текст и комментарии »

  • Проголосовать: нравится
  • +747
  • Проголосовать: не нравится

54.
Автор dario2994, 6 лет назад, По-английски
About Problemsetting (for AtCoder and Codeforces) Since the amount of information available about the preparation of a competitive programming contest for AtCoder/Codeforces is very little, I decided to collect here what was my experience. I will try to both describe my experiences and give some general advice to wannabe problemsetters. I hope that this will be useful to future problemsetters who are "out of the loop". Moreover, participants might be curious to know what happens behind the scenes (and maybe the platforms may consider this as a form of constructive feedback). *Acronyms*: - AGC = Atcoder Grand Contest - GR = Codeforces Global Round ### Why I know something about problemsetting? I am in the competitive programming world since ~8 years: I have participated in IOI/ICPC/GCJ and a number of contests on AtCoder/Codeforces (and lately Codechef). I am not a top participant but, being in this world for so long, I know, more or less, all the standard tricks. Recently, I was the author of the *flagship conte...
contains some additional comments on the problem. Just writing a sketch of a solution is *much easier, for me) and it is much better to just guess the difficulties depending on testers' results. For the, saying that problem-setters should be paid more, just that the current compensation does not justify the, " problemsetter (and/or I was just lucky). Do not expect this treatment., ) hours just before the contest., , I strongly suggest to avoid inserting bad problems in a problemset just to finish it (I guarantee, One last thing: it is absolutely normal to be a bit stressed just before the round. Don't worry, it

Полный текст и комментарии »

  • Проголосовать: нравится
  • +936
  • Проголосовать: не нравится

55.
Автор MikeMirzayanov, 8 лет назад, По-русски
Hello, ITMO! <img src="https://assets.codeforces.com/images/itmo-logo.png" style="margin:1em 1em 1em 1em; float:right;"/> Hi Codeforces! For you, perhaps it was yet another Codeforces round. But not for me. [contest:1066] is the first round tested on new judging servers at ITMO University. And this is not just an update of location. Ta-dam! Now your solutions will be judged on the new Intel i3-8100 processors. And this is not all news. The number of judging servers has increased, which means fewer queues during rounds! I am pleased to announce that now I live in St. Petersburg, I work at ITMO, and Codeforces is gradually moving from the walls of dear to me Saratov University to ITMO University. The decision to move was not easy for me. My plan is that, based on ITMO, I can focus more on Codeforces development and work on the platform. The number of world champions per square meter is simply overwhelming, and working with a large team of such enthusiasts (and professionals!) of sports pro...
round tested on new judging servers at ITMO University. And this is not just an update of location

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1331
  • Проголосовать: не нравится

56.
Автор SanguineChameleon, история, 13 месяцев назад, По-английски
I've (also) completed Project Euler ###_I've been dreaming of writing this for so long._ --- About 2 years ago, [user:Radewoosh,2025-10-22] posted a [blog](https://codeforces.me/blog/entry/122793) celebrating that he had solved all 865 problems on Project Euler. As a (naively optimistic) high-schooler back then, I thought to myself: _"Surely it can't be that hard, right?"_ 2 years later, there are now 965 problems, and I've solved all of them!! ![ ](/predownloaded/79/01/79019d6682d1c09808c1a205d72c4f4f838eccd8.png) ![ ](/predownloaded/98/f6/98f6fbe17d73c4691ad803c2d0725569c47d0cfb.png) --- I can’t even begin to describe how happy I am, and how wonderful the journey has been. Maybe I’ll write about it in another blog sometime. For now, I’ll answer some questions you might be thinking... ####_Literally, who asked?_ No one, of course. But this achievement means a lot to me, and I hope that this post inspires someone out there. ####_How long did it take?_ Kind of a difficult question to ans...
way to force myself to be uncomfortable, to actually *think* about problems, instead ofjust solving, , **SanguineChameleon2**. Didn't do much after that. I just left it there for a while. - **Sep 2023, . I just left it there for a while. - **Sep 2023-Oct 2025** (16-18yo): Okay, for real this time, At the end of the day, I'm just a silly teenager with too much time on his hands., But if you just want to solve PE to get better at competitive programming, then I'd suggest, Not "difficult" in the same way Project Euler is, though. I just find them incredibly dry., To be able to discover a mathematical truth, to make an incredible observation, or evenjust dip my

Полный текст и комментарии »

  • Проголосовать: нравится
  • +900
  • Проголосовать: не нравится

57.
Автор -is-this-fft-, история, 5 лет назад, По-английски
[Tutorial] Collection of little techniques #### Introduction There are a number of "small" algorithms and facts that come up again and again in problems. I feel like there I have had to explain them many times, partly because there are no blogs about them. On the other hand, writing a blog about them is also weird because there is not that much to be said. To settle these things "once and for all", I decided to write my own list about about common "small tricks" that don't really warrant a full tutorial because they can be adequately explained in a paragraph or two and there often isn't really anything to add except for padding. This blog is partly inspired by [user:adamant,2022-03-15]'s [blog](48417) from a few years ago. At first, I wanted to mimic adamant's blog structure exactly, but I found myself wanting to write longer paragraphs and using just bolded sentences as section headers got messy. Still, each section is short enough that it would not make much sense to write separate blogs about each of these things. A...
hypothesis), the second is just directly translated from lines 4 to 7. Now notice that $$ \begin, in heuristic/"proof by AC” algorithms. The idea is to pretend that things in number theory arejust, longer paragraphs and using just bolded sentences as section headers got messy. Still, each section is, reply something along the lines of "oh, you foolish person, don't you realize it isjust bitsets?" and, the array — we can just pretend that it was the last one added to prove the correctness., , v)$, where $u$ and $v$ are part of the given subset of vertices. Using the fact that wejust learned, To undo what we just did, we can simply do everything backwards.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +804
  • Проголосовать: не нравится

58.
Автор errorgorn, 3 года назад, По-английски
Confession: I sent problem H to goodbye Going to be 100% honest here, I sent problem H to goodbye. I feel really bad to authors of Goodbye 2023 for ruining their round, it seems the round would have been better by just removing H. As much as the community is out here roasting [user:74TrAkToR,2023-12-31], I also had a part to play in this contest. I wish to be as transparent as I can here without saying any classified information (apologies to [user:KAN,2023-12-31] and [user:74TrAkToR,2023-12-31] if anything here shouldn't be disclosed). To give some context, here is what went down in goodbye round from my perspective: - 13 days before contest: KAN asks me if I can source a 1E for goodbye. I asked traktor to send me the testing gym so that I could gauge how hard the 1E should be. He told me he will send me after he translates the statements. (UPD: Note that the IMO 1986 problem was already removed before this stage which is why a new 1E was needed, I never saw this IMO problem) - 11 days before contest: traktor send it...
2023 for ruining their round, it seems the round would have been better by just removing H. As much, Simply, you are just removing the coordinator as the middle man of being the message forwarder

Полный текст и комментарии »

  • Проголосовать: нравится
  • +815
  • Проголосовать: не нравится

59.
Автор MikeMirzayanov, 7 лет назад, По-русски
Codeforces: Results of 2019 <a style="float:right; display: inline-block; margin:0 1em 1em 2em; max-width: 60%;" href="https://codeforces.me/10years"/> <img style="max-width:100%" src="https://assets.codeforces.com/images/codeforces-10-years-300.png"/> </a> Hi Codeforces! The platform recently turned 10 years old. We accept your congratulations at <a href="https://codeforces.me/10years">https://codeforces.me/10years</a>. Please review the progress in 2019 and support the anniversary crowdfunding campaign. Your donation will be a contribution to the future of Codeforces, will help its development and work. We need resources to continue to host rounds, not to stop developing, to innovate and to maintain the existing infrastructure. In 2019, together with numerous writers the coordinators worked on problems: [user:KAN,2020-02-06], [user:300iq,2020-02-06], [user:cdkrot,2020-02-06], [user:arsijo,2020-02-06] and recently joined [user:isaf27,2020-02-06]. And this year, rounds coordinated by other exper...
, an increase was obtained in all major metrics (from 15% to 45%). Just look at these numbers!

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1154
  • Проголосовать: не нравится

60.
Автор dario2994, 6 лет назад, По-английски
Codeforces Global Round 11 <img src="/predownloaded/2e/e2/2ee2f0f95f05aae6ca6f47812dae2dc2aabf277b.png" style="width:200px; float:right; margin: 0 1em 1em 1em"/> Hi! On [contest_time:1427] we will host [contest:1427]. This is the fifth round of the 2020 series of [Codeforces Global Rounds](https://codeforces.me/blog/entry/65002). The rounds are open and rated for everybody. The prizes for this round are as follows: - 30 best participants get a t-shirt. - 20 t-shirts are randomly distributed among those with ranks between 31 and 500, inclusive. The prizes for the 6-round series in 2020: - In each round top-100 participants get points according to the [table](https://pastebin.com/QT5sXEaT). - The final result for each participant is equal to the sum of points he gets in the four rounds he placed the highest. - The best 20 participants over all series get sweatshirts and place certificates. Thanks to XTX, which in 2020 supported the global rounds initiative! Problems for this round ar...
**UPD**: The round is postponed by 15 minutes because just before the round there will be a 10

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1025
  • Проголосовать: не нравится

61.
Автор Golovanov399, 7 лет назад, По-английски
C++ tips and tricks Hello, codeforces. I would like to tell you about some tricks and constructions I use in C++. They are not hidden or anything, moreover, most of them are from stl or maybe well known among software engineers, but I often see codes where something is done by hand in, say, 5 lines, while in stl there is a function which does the same. The things below are filtered by my personal sense of non-popularity (so no `__builtin` functions) and usage frequency (so there almost surely are similar things I don't know about) and are not really sorted in any reasonable order. Let's begin. [cut] <hr> - ### `all(x)` This may be an exception to the rule of non-popularity -- this is quite widely used, but some next items will depend on `all(x)`, so I define it here. So, I talk about ```[c++] #define all(x) (x).begin(), (x).end() ``` Now sorting a vector looks like `sort(all(vec))` instead of `sort(vec.begin(), vec.end())`. However, it's not all about this define. Imagine you nee...
without any prewritten code. Just watch:, ++ paradigm where you can just read stuff or maybe because `val (n, k) = readLine()!!.split(' ').map, Instead, you can just use

Полный текст и комментарии »

  • Проголосовать: нравится
  • +756
  • Проголосовать: не нравится

62.
Автор vovuh, история, 6 лет назад, По-английски
My thoughts on clarifications and on the round #677. Alright, I'm done. I wanted to write a blog like that for a long time, but now I really don't have enough patience to ignore this issue anymore. I want to say that I get 100-200 clarifications each Div.3 round. It doesn't even matter how well the statements are, it doesn't matter if there are any issues with solutions or checkers, people always find what to ask. Before I start whining here, I really want to recommend anyone to read these two [user:Um_nik,2020-10-20] blogs: [this one](https://codeforces.me/blog/entry/62730) and [this one](https://codeforces.me/blog/entry/62744). Sorry, [user:Um_nik,2020-10-20], I unnecessarily tagged you, I will not do that anymore. Now some breaking news for most participants: _your local IDE compiler_ and _Codeforces compiler_ are **actually** different things! If your code works fine locally but gets WA/TL/RE/ML/etc on Codeforces, it (most probably) means you have a bug somewhere in your code. There are rare cases when the issue is with comp...
$50$ questions about this and just answered "read the global announcement". $50$ times. I wasted like, are spamming something like "why my question is not answered?? please answer!!" you arejust, before the round start just to smooth out the difficulty curve. This is pretty old problem that was, people think they can just talk like that to others., ?? please answer!!" you are just increasing the amount of work for me and the waiting time for others. I, About English: so many questions have pretty strange English and I just can't understand what are

Полный текст и комментарии »

  • Проголосовать: нравится
  • +979
  • Проголосовать: не нравится

63.
Автор Radewoosh, история, 8 лет назад, По-английски
Blogewoosh #5 (with images from now) Hello, codeforces! Because after Round #507 sad men in suits visited me in my flat, this time I won't write about any task from the future. Instead, this blog will be about my own trick. I said "my own," but probably some of you have already heard about it or even figured it out, but I've developed it by myself, so I consider it as my own. In particular, it's **GEOMETRY TIME!!!**. But please, don't escape already. I also don't like this topic so much, that's why I really like this trick. Let me tell you a story from one onsite Polish contest, which took place a few months ago. I was thinking about one of the problems, and I've figured out that I had to do some binary-search (on doubles) and then check if a set of half-planes has a non-empty intersection. The answer would tell me in which direction should I turn in the binary search. Firstly, I grabbed my head, because I've never written an intersection of half-planes. I had my acm library with [user:Errichto,2018-09-07]'s code...
infinity like $10^{18}$, or something similar. Vertical half-planes should just cut our interval and make, "). Don't calculate it, just focus on the fact that it exists. It looks like this:, How to calculate the difference for fixed $x$? Just find minimum on black lines (according to the

Полный текст и комментарии »

  • Проголосовать: нравится
  • +801
  • Проголосовать: не нравится

64.
Автор tourist, 9 лет назад, По-английски
My strategy at AtCoder & CS Academy There's been much controversy lately about the late submission strategy not penalized by scoring systems of AtCoder and CS Academy. Most of the relevant discussion happened earlier at http://codeforces.me/blog/entry/53431 and http://codeforces.me/blog/entry/53449. I have a lot of thoughts on the topic, so I've decided to share them in a separate blog post. I really like the strategic part of programming competitions. Of course, problem solving is more important. But every contest consists of multiple problems, so there has to be a way of comparing participants which performed better at different problems. There's a huge variety of scoring rules, and I find it truly amusing. The "submit after solving all problems" strategy looks widely attributed to me now, mostly due to [user:Petr,2017-07-24]'s remarks regarding my participation in AtCoder contests. In my opinion, it's wrong for multiple reasons. A closer five-word description of my strategy is "implement after solvin...
faster and better. Maybe that's due to subconscious thinking happening in background, orjust a, goals by requiring much commitment, we're just decreasing participation.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +972
  • Проголосовать: не нравится

65.
Автор Wind_Eagle, 5 лет назад, По-русски
Codeforces Round #741. How contest author is entertaining. Hello, Codeforces! Not too long ago there was my second round, Codeforces #741 (Div. 2). Before it started, I wondered: surely there will be a lot of cheating on my round, just like on any other? So I decided to do something unusual. As you know from [a blog about cheaters] (https://codeforces.me/blog/entry/93893), it's easy to find telegram/youtube channels with cheaters. So I decided to find a couple and join them... So, the first telegram group I found was [link not available yet]. There weren't too many cheaters in it but they were, here's an example: <spoiler summary="Picture"> <a href="https://imgbb.com/"><img src="https://i.ibb.co/kJqMzMS/pic1.png" alt="pic1" border="0"></a> </spoiler> I joined this telegram group, and there was a meaningful dialogue: <spoiler summary="Picture"> <a href="https://ibb.co/1mC2csG"><img src="https://i.ibb.co/VqFB6HY/pic2.png" alt="pic2" border="0"></a> </spoiler> This may seem unbelievable, but the admin of the group actuall...
started, I wondered: surely there will be a lot of cheating on my round, just like on any other? So, What does one want to say as a conclusion? It's all very sad, frankly. There are notjust a lot of

Полный текст и комментарии »

  • Проголосовать: нравится
  • +950
  • Проголосовать: не нравится

66.
Автор PinkieRabbit_buster, 3 года назад, По-английски
PinkieRabbit Cheated in Div. 1 Contest on Apr 27 I am writing to report an incident of cheating by PinkieRabbit during the recent contest 1965 on Codeforces. **PinkieRabbit asked help about problem D from others during the contest,** which is definitely against the contest rules. I have attached the evidence of the cheating behavior in the appendix, please read it. This evidence clearly shows the communications PinkieRabbit had with another person during the contest. It is a contest recording video published after contest by himself. As a former fan of PinkieRabbit, after seeing this video, I was shocked by how dishonest PinkieRabbit was. I believe such actions undermine the integrity of the competition and the platform as a whole. [user:win114514,2024-05-05] cheated by grouping up in contest 1905, finally punished by skipping. Therefore, I respectfully request that Codeforces take appropriate action against PinkieRabbit to maintain the fairness of the contests on Codeforces. He only cheated in one problem this round, so I sugg...
7, heck, how you ...... how it's just like that., F: It's not a global subtraction either. I'm not drawing it right here. It's just that he has to, F: Well, you just need to find the one, the smallest one of these., F:no you ... you have the largest one, that's fine, you just take the largest one, you know the

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1076
  • Проголосовать: не нравится

67.
Автор adamant, история, 19 месяцев назад, По-английски
Complex FFT is not as bad as you think ... Probably. Hi everyone! As some of you _might_ already know, I don't like NTT. Primary reasons for this are: - I don't like modular arithmetic optimizations (Montgomery, etc). - I don't like NTT mods, and prefer good, old $10^9+7$. - I do like algebra of complex numbers. But, to my regret, the overwhelming mainstream in modern competitive programming is NTT. Primary reasons are: - It's allegedly faster. - It needs less memory. - It has no precision issues. - People don't like algebra of complex numbers. There is nothing I can do about the last, but today I'll address the first 3. Optimizing complex FFT was on my mind for quite some time, but I didn't really work on it _that much_ until the [blog](https://codeforces.me/blog/entry/142063) by [user:Qwerty1232,2025-04-24] on optimizing NTT has dropped, which motivated me to actually put some serious effort into this. In this blog, we will primarily focus on optimizations that are specific to complex arithmetic...
essentially it just does the same thing as its scalar version., generally known to be outstandingly stable. But how much stable exactly? Will just $6$ bits be enough, their negacyclic convolution (i.e. the product modulo $x^n+1$) by computing just a single imaginary, to FFT, you would recognize that what we're doing here is, really, just using it on the top level, vector $x[0]+y[0], \dots, x[3]+y[3]$, all in just one assembly instruction., , in essence, we can just multiply relative error components when repeatedly applying linear, - Take just complex numbers fft/ifft/dot implementation [here](https://lib.cp-algorithms.com/cp, I will just refer you to [Step F](https://codeforces.me/blog/entry/142063) of the, If we consider e.g. the error just for the real part, we get, If we look just on how large the numbers can be in the output, the trivial estimate would be $n C^2, In other words, we can generally just apply most regular arithmetic operations directly to the, Note that estimating relative error just for $x$ would be fruitless, as $x$ might be $0$, leading, We will get to them in detail later on, but in essence they just process two FFT layers at once, }$ from around 3 ms to just **0.7 ms**.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +731
  • Проголосовать: не нравится

68.
Автор adamant, 16 месяцев назад, По-английски
GF: Competitive programming Discord server (Div. 1 only) Hi everyone! Every once in a while someone makes a competitive programming [Discord server](https://discord.com). Today, we're inviting you to join one of them &#128522; So, first things first, the big flashy link for those who want to cut to the chase: <br><br> <center> <span style="display:inline-block; border:2px solid #ccc; padding:10px; border-radius:8px; background:#f9f9f9;"> <a href="https://discord.gg/sTk4khgmSd" style="font-weight:bold; font-size:1.2em;">Join us!</a> </span> <div style="margin-top:5px; font-size:0.85em;"> <a href="https://discord.gg/bitset" style="color:#555;">discord.gg/bitset</a> </div> </center> **Name**: GF<br> **Members**: 1000+ (and growing!)<br> **Admins**: ~Halzion,2025-08-09 ~rewhile,2025-08-09 ~defnotmee,2025-08-09, ~adamant,2025-08-10<br> **Moderators:** <table style="border-collapse:collapse; border:none; margin-left:2em;"> <tr> <td style="border:none; padding:0 8px;">~jeroenodb,2025-08-09</...
! - Every month, the user with most `;gitgud` score gets a **special shiny role**, and **Discord nitro

Полный текст и комментарии »

  • Проголосовать: нравится
  • +436
  • Проголосовать: не нравится

69.
Автор Qingyu, 7 месяцев назад, По-английски
The 2026 Universal Cup Finals The best and brightest programmers from around the world have gathered this week in Shanghai, China, for the highly anticipated 2026 Universal Cup Finals! <center> <img src="/predownloaded/e6/93/e693e47e517f397b13fc0a1dab505067ca789e98.jpg"> </center> ### Event Details - Date: Sunday, May 10th - Start time: 11:00 AM CST (3:00 AM UTC) - See [participating teams](https://codeforces.me/blog/entry/153064) - Full schedule can be found [here](https://finals.ucup.ac/schedule/) ### Streaming Witness the best contestants in the world as they push the boundaries of skill and strategy. You can be part of this event by following us online either on the [English livestream](https://www.youtube.com/watch?v=Y9HMX3zhFMM) or the [Chinese livestream](https://live.bilibili.com/1753191619). <center style="margin: 2em;"> <iframe width="560" height="315" src="https://www.youtube.com/embed/Y9HMX3zhFMM" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipb...
This isn't just a competition – it's a global celebration of competitive programming. Join us for

Полный текст и комментарии »

  • Проголосовать: нравится
  • +769
  • Проголосовать: не нравится

70.
Автор lotusblume, 16 месяцев назад, По-английски
Worst-Case Graphs for Maximum Flow Algorithms Maximum flow algorithms are known to perform significantly better in practice than their worst-case time complexities would suggest. So in this blog, I will present graphs on which the following maximum flow algorithms actually achieve their worst-case running time: | Algorithm | Time Complexity | | ----------------------- | ------------------------------ | | Ford-Fulkerson with DFS | $\mathcal{O}\big(m^2 \cdot U)$ | | Edmonds-Karp | $\mathcal{O}\big(n \cdot m^2\big)$ | | Dinic | $\mathcal{O}\big(n^2 \cdot m\big)$ | | DFS with Scaling | $\mathcal{O}\big(m^2 \cdot \log(U)\big)$ | | Dinic with Scaling | $\mathcal{O}\big(n \cdot m \cdot \log(U)\big)$ | | Most Improving Augmenting Paths | $\mathcal{O}\big(m \cdot \log(U) \cdot (m + n \cdot \log(n))\big)$ | | FIFO Preflow Push | $\mathcal{O}\big(n^3\big)$ | | Highest-Label Preflow Push | $\mathcal{O}\big(n^2 \cdot \sqrt{m}\big)$ | Here and in the rest of this blog: - $n =$ number of vertices, ...
first three paths repeat themselves. In fact this pattern can be continued arbitrarily oftenjust by

Полный текст и комментарии »

  • Проголосовать: нравится
  • +927
  • Проголосовать: не нравится

71.
Автор shiven, история, 2 года назад, По-английски
A summary of what passes for an Indian ICPC Contest, apparently The online round for the India’s ICPC was held on 23rd. And also a week before that. The first time around, the organisers tried debuting a self-hosted DOMjudge instance. That didn’t go too well, so a recontest was scheduled on CodeChef. If you’re not too familiar with the Indian ICPC system — this online prelims is used to select teams that can participate in the offline regionals. From a single university, usually approx. 2 teams (for the top unis) or 1 (for almost all unis that aren’t in top-15) qualify. As you could guess, it’s quite easy for good teams to miss a spot. Looking at the first contest’s rankings, teams from rank 2 to 100+ all had 4 solves. Owing to severe system issues in the first contest, the time penalties weren’t too reliable differentiators, leading to the recontest this Saturday. In hindsight, we forgot to be grateful for the problemset and reliable testcases the first time. I’m sure everyone agrees that the basic requirements (ignoring all other stuff...
even stated anywhere explicitly. Just assumed. The video goes: *‘maybe there are not too many, this library-checker problem exist? Just a thin veil of ‘observation’ (which is itself very standard, **Disclaimer:** This is just a list of issues that I sourced by talking to the handful of teams at, However, the organisers seem to believe that the re-contest was a fair metric just because CodeChef, ](https://codeforces.me/blog/entry/136522?#comment-1221792). Just to point out the obvious, whenever, just as registration fees, along with sponsorships and stuff] to be far worse then online contests, just because CodeChef didn’t break, so here’s a compilation of what went wrong. Maybe they re-evaluate

Полный текст и комментарии »

  • Проголосовать: нравится
  • +925
  • Проголосовать: не нравится

72.
Автор ATSTNG, история, 7 лет назад, перевод, По-русски
[Tutorial] Matroid intersection in simple words **[This article is also available in [Russian](https://codeforces.me/blog/entry/69287?locale=ru)]** Hello, CodeForces. I think that matroids are beautiful and powerful concept, however, not really well known in competitive programming. I’ve discovered matroids at 2019 Petrozavodsk Winter Training Camp. There was a problem that clearly cannot be solved using usual techniques I knew, editorial for this problem was just these three words “just matroid intersection”. Back then it took me more than 2 days of upsolving to find all the information and details I need and implement solution that gets Accepted on this. And it took way longer to actually understand why does it work and exactly how does it work. (I still hesitate in some details.) Of course, it is not hard to google up all the definitions and some related articles, but in my opinion they all are focused more on mathematical part of theory, strict proofs in some not really obvious but short ways, and observing only ke...
clearly cannot be solved using usual techniques I knew, editorial for this problem wasjust these three, maximum size independent set, not just equal all the time., picture at the same time. If graph is connected then any basis of this graph is just a spanning tree, слов “just matroid intersection”. Тогда мне потребовалось больше двух дней дорешивания чтоб найти, $ incoming power (just as previous one) 3. Ensure there is no loops (forget about edges direction and, , we can check presence of edges only when BFS tries to use them. We might think that itjust

Полный текст и комментарии »

  • Проголосовать: нравится
  • +904
  • Проголосовать: не нравится

73.
Автор Qingyu, 17 месяцев назад, По-английски
About the Universal Cup, the Semifinals, and myself... Hey'all! This gonna be a long post, so let me put an important TLDR here first: we are going to host **The 3rd Universal Cup Semifinals**, which will take place on August 24, 2025 **online**, at [11:00 (UTC)](https://www.timeanddate.com/worldclock/fixedtime.html?msg=The+3rd+Universal+Cup+Semifinals&iso=20250824T19&p1=33&ah=5). This contest will be a part of our Finals Team Selection, which the detailed rules and announcements will be published later next week. --- Now for some extra context, if you're interested. Last week, we hosted the [last online stage](https://codeforces.me/blog/entry/143954) of The 3rd Universal Cup. After that, I posted a [feedback form](https://docs.google.com/forms/d/1g5Txhiirh_lRsvGfkYWRozu0WDDGK31IAXjB7VgeVoM/edit) on our discord server. I received lots of thoughtful responses (P.S — it's still open, so feel free to fill it out if you haven't yet!). I've read through all the feedback, and I'd like to share a few thoughts. ### On the Number...
frustrating, unreasonable, and just straight-up awful stuff happened to me. I've been carrying all, rating impact on others becomes really marginal. _Teams did absolutely nothing wrongjust because, reaching out to them isn’t easy. Just based on my experiences in China, it was a complete nightmare to, ://universal-cup-website.qoj.ac/) is just a temporary page built on QOJ, and it's hard to maintain it, I know all of this might sound confusing — it’s hard to explain it properly in just a few, I would just say everything in short: I was admitted and planned to enroll PKU in 2024 by Chinese, This leads to a debate that has happened a lot of times — why can't we just have a week long

Полный текст и комментарии »

  • Проголосовать: нравится
  • +814
  • Проголосовать: не нравится

74.
Автор maomao90, 3 года назад, По-английски
Editorial for Hello 2024 ### [problem:1919a] Author: [user:maomao90,2024-01-02] <spoiler summary="Hint 1"> When does the game end? </spoiler> <spoiler summary="Solution"> Depending on whether the player chooses to exchange wallets with their opponent on step $1$, $1$ coins will be removed from either the opponent's wallet or the player's wallet. This means that if either of the players still has remaining coins, the game will not end as at least one of the choices will still be valid. The only way that the game ends is when both players have $0$ coins. Since each operation decreases the total amount of coins by exactly $1$, the only way for Alice to win the game is if $a + b$ is odd. </spoiler> <spoiler summary="Code"> ~~~~~ #include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int a, b; cin >> a >> b; if ((a + b) % 2 == 0) { cout << "Bob\n"; } else { cout << "Alice\n"; } } ...
ReLU function, so we just need to store in each node the resultant function $f(x) = \max(x - p, q, transition to $dp_i$, notice that the first transition is just a range increment on the entire range, just have to figure out which edge of depth $i - 1$ we have to attach the edge of depth $i$ to.

Полный текст и комментарии »

Разбор задач Hello 2024
  • Проголосовать: нравится
  • +760
  • Проголосовать: не нравится

75.
Автор YouKn0wWho, 3 года назад, По-английски
A Huge Update on The Ultimate Topic List Hi, around 3 years ago I compiled most of the Competitive Programming topics in one place [here](https://codeforces.me/blog/entry/95106) with relevant resources, templates, and problems. It got great responses, it now has 4000+ upvotes and the blog website has been visited 200k+ times! But it contained links to only 1-2 resources and problems per topic and it didn’t contain basic topics for beginners. Also, there was no way of tracking your progress. This time I decided to improve it, by a lot. I took this project one month ago and it took me on average 6h-10h per day for the last one month to complete this project (also I was doing a full-time job). I hope it was worth it! The new version is not just a blog, it is a full-fledged website with multiple features (I have hosted it on one of my existing websites): ![topic_list](/predownloaded/7e/20/7e2045c57574d37e170ea3eb1fdc5516ff68bc0e.png) - **Topics:** The website contains around 500 topics and tricks. Not all topics are ...
The new version is not just a blog, it is a full-fledged website with multiple features (I have

Полный текст и комментарии »

  • Проголосовать: нравится
  • +792
  • Проголосовать: не нравится

76.
Автор Zhtluo, история, 3 года назад, По-английски
The Reason You are Bad at Codeforces — You are Not Russian Enough If you are triggered by this clickbaity blog title, you are probably interested in improving your Codeforces skills. Now, I will share my point of view on the differences between Codeforces and ICPC contests, and how you can, in my humble opinion, maximize your Codeforces rating gain. I mostly consider that all conceivable competitive programming problems need three aspects of skill: 1. Observation &mdash; the ability to understand the problem and come up with non-trivial properties. 2. Technique &mdash; the ability to apply a well-known algorithm or data structure to the problem. 3. Implementation &mdash; the ability to code fast and debug fast. Collaterally, I refer to these three skills as Russian-ness, Chinese-ness and American-ness, respectively, for reasons you will soon see below. ## Observation (Russian-ness) Observation means that you stare at some problem for a sufficient amount of time and you are able to reduce it to some easier problem. One good proble...
*Why learn swimming? Just jump into the river. It works for everyone who lives after that!*, . 1. Just study math problems instead!, . One is that the code is just long but is not particularly tricky, such as the famous [Rubik's cube, A lot of people in Codeforces Catalog will just say that you should do more problems. That is, I think, ultimately, this line of thought just loses people out of competitive programming for

Полный текст и комментарии »

  • Проголосовать: нравится
  • +772
  • Проголосовать: не нравится

77.
Автор Um_nik, история, 14 месяцев назад, По-английски
On AI ruining "solving math problems with computer" [a year later] I guess you were right in the part "a year from now LLMs will solve problems on your level". You were also saying something along the lines of "you'll change your mind when it starts affecting you". In this part, you were wrong. Cheaters always existed, and they always will. LLMs make it easier to cheat, true. There is no way of completely preventing LLM cheating (or any other kind of cheating) in online competitions. I just coordinated the round everyone is buzzing about, so I can with confidence say that in the CF rules for coordinators and authors, there isn't anything about making problems LLM-proof. Not for easy problems, not for hard problems, nothing. And I doubt any such rules will appear. LLMs are forbidden by the rules, that's that. So we, as honest participants (yes, I will assume that you are an honest participant, otherwise this blog is not applicable to you and I don't care about you), will have to accept that some problems in the future rounds will be LLM-able, ...
got AC just have seen this problem before and copied their old solution., ) in online competitions. I just coordinated the round everyone is buzzing about, so I can with, , looking for discrepancies, is still a good tactic. But maybe, just maybe, after seeing how, I just coordinated the round everyone is buzzing about, so I can with confidence say that in the CF

Полный текст и комментарии »

  • Проголосовать: нравится
  • +680
  • Проголосовать: не нравится

78.
Автор Errichto, 6 лет назад, По-английски
Matrix Exponentiation tutorial + training contest tl;dr &mdash; video tutorial https://www.youtube.com/watch?v=eMXNWcbw75E and codeforces GYM training https://codeforces.me/gym/102644 (register by finding this contest in GYM instead of using the link directly) video editorial: [part 1 (ABCDEF)](https://www.youtube.com/watch?v=kQuCOFzWoa0) and [part 2 (GHI)](https://www.youtube.com/watch?v=RA_SpxP2t54) codes to all 9 problems: https://github.com/Errichto/youtube/tree/master/matrix-exponentiation Prerequisites: binary exponentiation and iterative dp (you don't need to know matrices) The youtube tutorial ([link](https://www.youtube.com/watch?v=eMXNWcbw75E)) focuses on intuition and graph-like visualization . Or, if you prefer, below is a shorter (less detailed) text tutorial instead. You can practice by solving a set of 9 educational problems in GYM https://codeforces.me/gym/102644. ABCD are easy, EF medium, GHI are hard. If you are stuck, see hints below or watch the full solution analysis &mdash; [part 1 (ABCDEF)](https:...
Matrix exponentiation isn't just for summing up products of values, $ in String Mood so the complexity is just $O(\log n)$.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +606
  • Проголосовать: не нравится

79.
Автор Geothermal, история, 7 лет назад, По-английски
Remove Virtual Contestants from Contest Leaderboards As most of you are likely aware, cheating in virtual contests (typically by submitting prewritten or copied solutions in order to appear at the top of the leaderboard) is very common. Most recently, [user:wannabecandidatemaster,2020-05-28] submitted solutions to all problems in [this round](https://codeforces.me/contest/1358/standings) in order to take first place in the standings, and [user:bemandrei,2020-05-28] competed virtually in [this round](https://codeforces.me/contest/1360/standings) after competing in the round officially, and ended up in second place on the leaderboard. In response to the rise of VC cheating (as well as some other issues with the VC system I'll describe below), I'd like to make a simple proposal: **Remove all virtual participants from the contest leaderboards.** The one exception is that you should see your own name on leaderboards for contests you VCed (that is, virtual contestants should be visible only to themselves). Similarly, virtual participan...
, rather than just the pre-tests, so it is impossible for them to FST: if their solution fails a test

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1001
  • Проголосовать: не нравится

80.
Автор errorgorn, 2 года назад, По-английски
[RANT] Warning to other coordinators about Wuhudsm Hi again, it is me. I want to preface this blog by saying that I am totally aware that it is not good netiquette to screenshot private messages and publish them publicly. But honestly, I can't care anymore now. Below is an unorganized rant. Sorry, I'm too pissed to write the things below concisely. And here: I'm pinging him: [user:wuhudsm,2024-07-21]. In an ideal world, I could probably just tell him privately to stop doing it. But I already did. So I think I need to write this blog to either stop him from doing this again or just soft-ban him from authoring more rounds by telling everyone about it. Let me just preface this blog with a fact of coordination -- it is very possible that problems from contest A will be used in contest B even after testers from contest A have seen those problems. So there are indeed (many) testers who could possibly be affected by this. Some examples of this happening (where I was involved): - Contest problems based on on-site contests were quit...
group of authors, so I did not think too much about it. And since this was the first incident, Ijust, participate in ICPC). I just wish to go back to being a humble competitor of competitive programming., problems for multiple contests, just ensure that you explicitly tell the coordinator about it and the, question and informed them (just a few days before the round)., . You don't care how your problem is in a contest, just that it appears in a contest; you arejust, As a sidenote, I just want to make it clear that OCPC is not a place where you send bad problems, In an ideal world, I could probably just tell him privately to stop doing it. But I already did. So, Let me just preface this blog with a fact of coordination -- it is very possible that problems from

Полный текст и комментарии »

  • Проголосовать: нравится
  • +621
  • Проголосовать: не нравится

81.
Автор SecondThread, история, 5 лет назад, По-английски
CF Sweatshirt signed by legends at ICPC World Finals Good morning! ICPC World Finals just concluded in Moscow. I was lucky enough to be participate representing the University of Central Florida, who finished in a respectable 17th place. While there, friends, acquaintances, and CF Legends signed my Codeforces sweatshirt in their handle with their current color. The most common request of the people I asked was to show off what it ended up looking like on a blog post of Codeforces, so here that is! ![ ](https://wumbogames.github.io/cfPictures/IMG_2102.png) ![ ](https://wumbogames.github.io/cfPictures/IMG_2101.png) <spoiler summary="Famous Signings"> ![ ](https://wumbogames.github.io/cfPictures/IMG_2075.png) ![ ](https://wumbogames.github.io/cfPictures/IMG_2078.png) </spoiler> #### Signers: - [user:MikeMirzayanov,2021-10-11] the creator and maintainer of Codeforces and Polygon who deserves our eternal thanks, and [user:Una_Shem,2021-10-11] without whose work there would be no sweatshirt to sign. - [user:tourist,2021-1...
Good morning! ICPC World Finals just concluded in Moscow. I was lucky enough to be participate

Полный текст и комментарии »

  • Проголосовать: нравится
  • +772
  • Проголосовать: не нравится

82.
Автор Radewoosh, история, 8 лет назад, По-английски
Blogewoosh #2 Hello, codeforces! All signs in the sky and on the ground indicate that you've enjoyed my first blog, so here is the second one. I've decided to choose a Polish task again, as there are plenty of interesting ones. This time we'll take a look at the "plot purchase" ([you can submit here](https://szkopul.edu.pl/problemset/problem/hwbyoUkNFPXQLOPcw3x5huTR/site/?key=statement)), which is a bit easier, but a few years ago I was very proud of myself when I solved it. The statement goes as follows: You are given a square $n \times n$ grid ($1 \leq n \leq 2000$). In every cell, there is a number from the range $[1, 2 \cdot 10^9]$. You are also given an integer $k$ ($1 \leq k \leq 10^9$). A task is to find a subrectangle of this grid such that the sum of values in this subrectangle lies in the range $[k, 2\cdot k]$ (or report that there is no such subrectangle). Just print coordinates of its opposite corners. [cut] $ $ If the problem would be more difficult, and we'd be asked to fi...
range $[k, 2\cdot k]$ (or report that there is no such subrectangle). Just print coordinates of its, sum of values, then it'd be possible to find it in $O(n^3)$ time, just by fixing lower and upper sides, Sooo, is it the end? Can we just cut the rectangle as long as it has the sum greater than $2 \cdot

Полный текст и комментарии »

  • Проголосовать: нравится
  • +838
  • Проголосовать: не нравится

83.
Автор peltorator, 18 месяцев назад, По-английски
"Algorithms in Depth" Stream Series: Kicking Off With FFT Hi Codeforces! I’ve long believed that it's _really_ worth revisiting the same competitive programming topics multiple times. The first time, you’re just trying to survive and maybe grasp the basics. The second time, you’ve solved some problems, you know where you got confused, and you're ready to absorb more. By the third time, you’ve seen and solved enough to start appreciating the subtleties — the tricks, advanced applications, deeper meaning. But most lectures I’ve seen are designed as a one-size-fits-all — trying to cover everything from scratch _and_ dive into the advanced stuff in one go. That’s rarely optimal. Take binary search. I once talked about it for six hours straight. A beginner at that lecture would’ve probably quit CP immediately. And that’s ok. Beginners don’t need all that. But the truth is, there _is_ that much depth to explore even in seemingly simple topics like binary search — once you're ready. Yet many people only see the beginner version once and mo...
multiple times. The first time, you’re just trying to survive and maybe grasp the basics. The second, will cover only the basics. No fancy math. Just the simplest path to fast polynomial multiplication, - A basic lecture: just enough to multiply polynomials with minimal pain.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +631
  • Проголосовать: не нравится

84.
Автор YouKn0wWho, 4 года назад, По-английски
[Tutorial] Common Mistakes in Competitive Programming and How to Avoid Them One thing is for sure. You do make mistakes. I also make miskates and that's what makes us human. But what we can surely do is &mdash; to try to minimize the errors that we make throughout our life. I have compiled some of the mistakes that I made in my early Competitive Programming phase. I also mentioned how to avoid them. Also, in most cases, I will give you a chance to find out what the bug is before I reveal the culprit as I tried to make this blog interactive. The codes that I have used in this blog have been written in C++ as it is the most used language for CP. **So, if you are new to CP, stick with me as you might don't wanna repeat the mistakes that I made when I was a beginner.** #### Mistake 1 Check out the following code: <spoiler summary="Code"> ~~~~~ #include<bits/stdc++.h> using namespace std; int main() { int a = 1000'000'000,b = 1000'000'000; long long product = a * b; cout << product << '\n'; return 0; } ~~~~~ </spoiler> The outp...
$24$. You may use `round(pow(5, 2))` in this particular case to avoid the precision issue orjust, than just looping through all the indices and setting them to $-1$ or $0$. But be careful while using, Just declare a vector only as much as we need., Just typecast!

Полный текст и комментарии »

  • Проголосовать: нравится
  • +634
  • Проголосовать: не нравится

85.
Автор jiry_2, история, 9 лет назад, По-английски
A simple introduction to "Segment tree beats" Hi, I’d like to introduce a simple trick about segment tree in this blog as I promised in [this comment](http://codeforces.me/blog/entry/54750?#comment-387957). Sorry for the long delay, as a sophomore in Peking University, I've just finished a tired semester and a painful final exam. And now I finally have enough time to do a simple introduction to this interesting algorithm. It may be a huge project for me since my English is not good. I think I will finish this blog in several steps and I will try to finish it as soon as possible :) In China, all of the 15 candidates for the Chinese National Team are asked to write a simple research report about algorithms in informatics Olympiad, and the score will be counted in the final selection. There are many interesting ideas and algorithms in these reports. And I find that some of them are quite new for competitors in CF although they are well known in China from the final standings of some recent contests. For example, In the last co...
first kind and the second kind of values. Pay attention to some boundary conditions, if there arejust, interval sum of historic information. It's quite hard since we can't just use the traditional lazy, sophomore in Peking University, I've just finished a tired semester and a painful final exam. And now I, tags and add some new tags. And another possibility is that if we just change some of the values, After the transformation, we can find that the strict second maximum value we maintained isjust, How about the historic maximum value? What if we just maintain a historic maximum value $H_i$ on, Thus, we can just use tags and ordinary segment tree to solve this problem in $O(n \log n, You may find that this potential function is just the same as the proof given by [usr:gepardo

Полный текст и комментарии »

  • Проголосовать: нравится
  • +771
  • Проголосовать: не нравится

86.
Автор antontrygubO_o, история, 7 лет назад, По-английски
On problemsetting 2 [Previous part](https://codeforces.me/blog/entry/70178) Hi there again! Previous part with opinions of some amazing problemsetters turned out to be interesting for you, so I decided to gather some more opinions :D. I really hope that this post will help someone in their problemsetting future! #### When and how did you start problemsetting? [user:300iq,2020-01-11]: April, 2017 [user:maroonrk,2020-01-11]: In 2015 Summer, I hold the first contest with friends at high school club. It was a local Japanese contest. [user:Radewoosh,2020-01-11]: In high school, so probably for 5 years. I was creating problems for other people from my school as my teacher told me that it's a completely different point of view. [user:voidmax,2020-01-11]: It was 3 years ago. I was on plane and I didn't have a clue what to do in my free time. Then I realized that I can try myself in problemsetting. Later I created first and one of my favorite problem ([problem:963B]). I was full of inspiration a...
believe that "solving easier subtask first and then harder" should not be worth more than "just solving, more new ideas, it just depends on the time I spend on thinking about new problems., period and most of the time don't have any good ideas. It's a matter of time. I just wait for, require just roaming to get the solution it isn't so nice for everybody. I like thinking about the, very strange without any proof (just write and see), but after some time I found proof and realized, No. Data structure is just a tool to solve problems. Of course it is good that the round have a, [user:300iq,2020-01-11]: I am just thinking a lot, trying to come up with some beautiful

Полный текст и комментарии »

  • Проголосовать: нравится
  • +631
  • Проголосовать: не нравится

87.
Автор pashka, 6 лет назад, По-английски
EDU: Segment Tree, part 1 Hello everyone! I just published a [new lesson](https://codeforces.me/edu/course/2/lesson/4) in the EDU section. This is the first part of the lesson about the segment tree. <img src="/predownloaded/ad/f8/adf89a39c4a3c646e9b047bc1e24e894a01034d4.png"/> In this lesson, we will learn how to build a simple segment tree (without mass modifications), and how to perform basic operations on it. We will also discuss some tasks that can be solved using the segment tree. <center style="margin:2.5em;"> <a href="/edu/courses" style="text-decoration:none; font-size:18px; background-color:#01579B; color:white; font-weight:bold; padding:0.5em 1em;">Go to EDU &rarr;</a> </center> More about EDU section you can read in [this](/blog/entry/79530) post. Hope it will be helpful, enjoy!
Hello everyone! I just published a [new lesson](https://codeforces.me/edu/course/2/lesson/4) in, I just published a [new lesson](https://codeforces.me/edu/course/2/lesson/4) in the EDU section

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1309
  • Проголосовать: не нравится

88.
Автор Radewoosh, история, 8 лет назад, По-английски
Blogewoosh #4 Hello, codeforces! It's time to continue the series of Polish tasks. I've decided to write about my own task one more time. Its name is "cook" ([you can submit here](https://szkopul.edu.pl/problemset/problem/9NFtPM59qGWa7wdn570ifuP0/site/?key=statement)). The task isn't very hard, but it uses cute (in my opinion) trick. The statement goes as follows: There is a cook in a restaurant. He has $n$ ($1 \leq n \leq 10^6$) orders which he must fill. Every order is a piece of paper, and all orders are speared on a spindle (sharp stick with pierced pieces of paper) in a fixed order which cannot be changed. Normal cook would just take orders one by one from the top of the spindle and fill them in this order, but the cook in this task has supernatural cooking powers and can combine orders to fill them faster. In particular, if at some moment there are $k$ out of $n$ orders still on the spindle, he can choose one of three options: $---$ He can take the topmost piece of paper and fill this...
is the size of a column). Has the complexity just increased to $O(n \cdot \log^2(n))$? No! The main, of paper) in a fixed order which cannot be changed. Normal cook would just take orders one by one, result will be in $DP[n][e]$. Transitions are easy. We just have to consider each of the three, So, let's just do it! We need only $\log(n)$ pairs of columns, because when the main pair points at

Полный текст и комментарии »

  • Проголосовать: нравится
  • +752
  • Проголосовать: не нравится

89.
Автор Balajiganapathi, история, 11 лет назад, По-английски
ICPC Regionals — The Chennai flood and the Asia Director Background ---------- One of the regionals in India was scheduled to be held at [Hindustan University](http://icpc.hindustanuniv.ac.in/) at Chennai on December 17 &mdash; 18, 2015. Unfortunately Chennai was stuck by a [natural disaster](https://en.wikipedia.org/wiki/2015_South_Indian_floods). The entire south India received heavy rainfall and hence there was a lot of flooding at many places including Chennai around that time. Atleast 347 people died in the state of Tamil Nadu (where Chennai is located). The damage due to the floods overall in south India is estimated to be atleast USD 3 Billion. It is the costliest flood in 2015. Ofcourse, due to this the Chennai regionals was postponed. I think everyone here will agree that this was an unexpected, unprecedent situation and hence it was entirely understandable that the regionals was postponed. The Blog post ------------- Dr. C J Hwang is the ICPC Asia director. In response to the above postponement he posted a blog article...
, but it does not take that much time either. This reason is here just so he can rush the decision, Comment: That is just luck. It is great luck that there never was any problem during any of the

Полный текст и комментарии »

  • Проголосовать: нравится
  • +967
  • Проголосовать: не нравится

90.
Автор Radewoosh, 8 лет назад, По-английски
Blogewoosh #3 Hello, codeforces! This time I've decided to choose a task from my own contest which took place last April and was known as the Grand Prix of Poland. If you want to write this contest virtually in the future, then consider not reading this blog. If you've participated in this contest and maybe even solved this task, then anyway I recommend reading it, cause this task has many very different solutions, each of them being very interesting (in my opinion). It's also a reason why this blog is longer than previous ones. I'll write about task C "cutting tree" (not uploaded to the ejudge yet :/). The statement goes as follows: You are given a tree with $n$ vertices ($1 \leq n \leq 2 \cdot 10^5$). The task is to calculate $f(k)$ for each integer $k$ from the range $[1, n]$ where $f(k)$ is defined as the maximum number of connected components of size $k$ which we can "cut off" from the tree. A connected component of size $k$ is a set of $k$ vertices such that it's possible to traverse ...
fix has no vertices assigned to it (because some other component has absorbed it), we shouldjust, it's impossible to fix it so we should just erase this color. To do this, a function $recolor(vertex, Then just run dfs on this extracted tree. In every vertex (starting from leaves) let's do the

Полный текст и комментарии »

  • Проголосовать: нравится
  • +767
  • Проголосовать: не нравится

91.
Автор Tony2_CF, история, 11 месяцев назад, По-английски
The Time Complexity Lower Bound for Segment Tree Beats is log^2 Original Post: https://jiry-2.blog.uoj.ac/blog/1404 The following content is translated by Gemini 2.5 Pro. ## Part 1: Introduction to the Hacking Method ### How to Map the Hack Sequence to a Segment Tree First, we are given a Hack sequence of length $len$. After $O(1)$ range addition operations and $\Theta(\log len)$ global $\text{chkmax}$ operations, this sequence becomes a cyclic shift (rotation) of the original sequence. Since a cyclic shift does not affect our range addition and global $\text{chkmax}$ operations (we can simply shift the indices for the range addition accordingly), we can consider the sequence as unchanged. If we have such a sequence, let $len=n^{\frac{1}{3}}$, and place such a sequence at intervals of $n^{\frac{2}{3}}$. Each sequence corresponds exactly to a segment tree interval. A subtree of size $n^{\frac{2}{3}}$ contains exactly one such segment tree interval. For the Hack sequence, the range addition operations are performed one by one on eac...
Note that here $n_f,n_g$ is just a classification, representing a type of node. A tree can have

Полный текст и комментарии »

  • Проголосовать: нравится
  • +767
  • Проголосовать: не нравится

92.
Автор SecondThread, история, 6 лет назад, По-английски
Petition to revoke unrated account permissions to post comments/blogs Unrated Account Disaster ================== Recently there have been an obscene number of unrated accounts showing up. Several of them have inappropriate names, so I won't give examples because I want to keep this post clean, but I'm sure you have seen them in the comments. They are likely all by the same individual, possibly with a few copy-cat troublemakers as well. Recently, certain ones have begun to spam useless comments on old posts to clog up the recent actions, effectively hiding all relevant conversations except on the blog posts they spam on. For whatever reason, these are overwhelmingly on [user:Errichto,2020-07-10]'s old blog posts. Occasionally there are also a flood of obscene blog posts made by the user themselves. Here's an example of what I mean: ![ ](https://wumbogames.github.io/cfPictures/Spam.png) #### This is obnoxious and I would like to see it stop. The current solution clearly doesn't work. As soon as they get banned or muted or whatever, they c...
can just make another throw-away account and continue spamming tomorrow.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +761
  • Проголосовать: не нравится

93.
Автор SlavicG, 5 лет назад, По-английски
How to use Codeforces [GUIDE] I see a lot of newcomers struggling to use the website to it's fullest, so I decided to write a blog that has all important information about how to use Codeforces in a single place. I will update it with time, so feel free to write your suggestions/questions in case I missed something and I will be glad to add it to the post! I would like to thank [user:_Vanilla_,2022-02-05] and [user:mesanu,2022-02-05] for helping me write the blog, and [user:Monogon,2022-02-05], [user:down,2022-02-05] and [user:AlperenT,2022-02-05] for proofreading and giving suggestions. #### Navigating through pages ![ ](https://media.discordapp.net/attachments/705371983650619454/928235498487570442/bandicam_2022-01-05_12-36-00-134.jpg?width=991&height=110) It's possible to navigate through most pages of Codeforces using the bar on the top, I will talk about what each tab does more in depth below: #### The Help Page The help page contains the answer to a lot of questions about Codeforces, such as rati...
page where there are "Last submissions of the problem". To view it just click on the ID of the, In case of practicing, you can choose whether you want to see the tags or not. Just click the "Show, You can also see submissions from a certain user just by writing his name in the Participant box.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +726
  • Проголосовать: не нравится

94.
Автор Radewoosh, история, 5 лет назад, По-английски
My own algorithm — offline incremental strongly connected components in O(m*log(m)) Hello Codeforces! As all of you know, there are so many known algorithms named after people who invented them &mdash; from the easiest ones, like Dijkstra, to the harder ones, like Berlekamp–Massey algorithm. These algorithms were innovative when they were invented, so of course, it's good that they are named after their inventors. But, today, I've seen a blog about the solution to the problem "compute LCS of two strings in time $O((n + k) \cdot \log(k))$, where $n$ is the sum of lengths of the strings, and $k$ is the number of pairs of matching positions in them". To be honest, it a bit pissed me off that even this algorithm is named after its creators. Is it ok to name the solution to every possible problem after its author? I won't judge it. Anyway, I want my very own Radecki algorithm, so let me give it a try. If anyone has ever heard about it &mdash; it's cool. Let me know, and it'll be just another helpful blog on Codeforces. Let's imagine the following problem: there is...
, just a pdf is worth nothing, but it's possible to dig deeper and believe me: the solution implemented, , just getting the list of undirected edges) has 72 lines.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +543
  • Проголосовать: не нравится

95.
Автор Lyde, 4 года назад, По-английски
Sometimes it's not their fault. Hello! It's 2023 now, and everyone is happy and hoping for a good year, which many good contests to come. So I want to say about one thing that I saw in most of the contests from last year, which I was pretty much annoyed about it and decided to speak about so that this year we will hope to have a better experience doing contests here. I have been in this community for more than 3 years now, not very long, but definitely enough to say that although the number of participants did increase, the number of users increase dramatically, but the number of people that respond to the contests positively don't. It actually did decrease though. I still remember that 500+ upvotes for a contest announcement are a normal thing back then, but I rarely see them now. And a common thing right now, every single contest that is over will have some comments criticizing it, but not in a good way at all. So I will make this quick for certain types of comments like that. I don't know if you do but I ...
And yeah, don't curse in a different language. Please. It is just wrong in every way., Or something like, "D is just boring implementation", "B is harder than C", or "E isjust cancer

Полный текст и комментарии »

  • Проголосовать: нравится
  • +680
  • Проголосовать: не нравится

96.
Автор bicsi, история, 6 лет назад, По-английски
I might get stigmatized for this, but here it goes Recently, Moscow Fall Workshops has taken place (it ended about one week ago), and I wanted to address some issues that came into my mind during that period. As you might notice, it took me some time to build the courage and get in the right mindset to write about this. First of all, I want to say that I am a huge supporter of programming camps and, in general, initiatives to enhance the joy of doing competitive programming and I respect the efforts of building communities around CP. I have always had a kind of excitement when thinking about participating in programming camps (Petrozavodsk, Moscow Workshops, etc.) and their “hardcore” style with lots of contests. I therefore appreciate the immense efforts of organizers, problem setters, and testers, when preparing this camp. ### Main point Coming towards the main point of the blog, I felt that the last programming camp was a bit… underwhelming. Moreover, I’m having a hard time trying to justify the costs of doing such a camp,...
experience the surprise of having participated in the last workshop, and realizing that I’mjust, premium contest. _Oh no, I think I’ve just opened Pandora’s box! Aaargh!_, started), which made me essentially want to just skip the day.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +795
  • Проголосовать: не нравится

97.
Автор Arpa, история, 14 месяцев назад, По-английски
I Filled an Empty Codeforces Page! <div style="float: right;margin: 0 1.0em 1.0em 1.0em;text-align: center;"> <iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="" frameborder="0" height="560" src="https://www.youtube.com/embed/T9UZ21eaZJE" title="YouTube video player" width="315"></iframe> </div> <center> <be> <a href="https://algoritmiacademy.com/wp-content/uploads/2025/09/comments.png"> <img width="50%" src="https://algoritmiacademy.com/wp-content/uploads/2025/09/comments.png"> </a> <br> </center> You might wonder: what kind of _popular_ or _controversial_ topic gets **175 comments**? The answer: <center> <be> <a href="https://algoritmiacademy.com/wp-content/uploads/2025/09/content.png"> <img width="50%" src="https://algoritmiacademy.com/wp-content/uploads/2025/09/content.png"> </a> <br> </center> You are right! [Codeforces edu section &mdash; Community Course](https://codeforces.me/edu/course/3)! Most of ...
I've just added the first set of tutorials on the RMQ Problem, which covers these three topics:, It's just a starting point, but hopefully, it will encourage others to contribute. Let's work

Полный текст и комментарии »

  • Проголосовать: нравится
  • +921
  • Проголосовать: не нравится

98.
Автор neal, 8 лет назад, По-английски
Blowing up unordered_map, and how to stop getting hacked on it C++ has always had the convenient data structures `std::set` and `std::map`, which are tree data structures whose operations take $O(\log n)$ time. With C++11, we finally received a hash set and hash map in `std::unordered_set` and `std::unordered_map`. Unfortunately, I've seen a lot of people on Codeforces get hacked or fail system tests when using these. In this post I'll explain how it's possible to break these data structures and what you can do in order to continue using your favorite hash maps without worrying about being hacked [cut] . So how are they hackable? We always assume hash maps are $O(1)$ per operation (insert, erase, access, etc.). But this depends on a key assumption, which is that each item _only runs into $O(1)$ collisions on average_. If our input data is completely random, this is a reasonable assumption. But this is no longer a safe bet when the input isn't random, especially so if someone is adversarially designing inputs to our code (a.k.a. hacking ph...
has a policy to resize itself when it gets too large. So we just need to find this list of primes.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +753
  • Проголосовать: не нравится

99.
Автор ko_osaga, история, 4 года назад, По-английски
OR Convolution for Common People Several years ago, a wise person told me that a convolution on a bitwise operator is possible: Given $A, B$ of size $2^N$, you can compute $C[i] = \sum_{j \oplus k = i} A[j] B[k]$ $C[i] = \sum_{j \land k = i} A[j] B[k]$ $C[i] = \sum_{j \lor k = i} A[j] B[k]$ in $O(2^N N)$ time. Cool! I asked a wise person, how such things are possible. A wise person replied, _"Of course you know how FFT works, let's begin with Fast Welsh-Hadamard Transform..."_ I said, No. I don't know how FFT works. Thank you. Then I just threw it into my ICPC teamnote. Years have passed, I still don't know how FFT works, and while writing some stupid essay, a random idea came to my mind. I wondered, "Does nobody really know this? Why anyone didn't explain OR convolution this way?". I searched on Google, and nobody was telling things this way, so this is certainly not a common explanation. But why? It should be. Let me use my time to change things for good. ## Sum of Subsets For convenience, I'll...
it. You want to take $A$ back. What should you do? Just undo it!, works. Thank you. Then I just threw it into my ICPC teamnote., Given an array $A$, how to compute $(\sum_{j \subseteq i} A[j])$? This is just a [sum-of-subsets DP

Полный текст и комментарии »

  • Проголосовать: нравится
  • +609
  • Проголосовать: не нравится

100.
Автор .o., 12 лет назад, перевод, По-русски
Good Bye 2014 Hi, Codeforces! Welcome to the last Codeforces Round of 2014, **Good Bye 2014**! This round is *very unusual*; First, the round starts at **[December 30th, 18:00 MSK](http://www.timeanddate.com/worldclock/fixedtime.html?msg=Good+Bye+2014&iso=20141230T18&p1=166&ah=2&am=30)**. Second, the round lasts for **2.5 hours**. And lastly, the round will be **division combined**, which means Div1 contestants and Div2 contestants won't be separated. The problems are prepared by me ([user:tncks0121,2014-12-29]) and Seunghyun Jo ([user:ainta,2014-12-29]). This is our second round at Codeforces. Because our first round caused(?) [the Black Day](http://codeforces.me/blog/entry/10683), we hope this round won't cause any errors like before :D Thanks to Won-seok Yoo([user:ainu7,2014-12-29]), who tested our round and gave us comments about the problemset. We'd like to thank some people who were necessary to make this round: Maxim Akhmedov ([user:Zlobober,2014-12-29]) gave us great help prepar...
The score distribution will be posted just before the round starts, as usual.

Полный текст и комментарии »

Анонс Good Bye 2014
  • Проголосовать: нравится
  • +758
  • Проголосовать: не нравится

101.
Автор -is-this-fft-, история, 2 года назад, По-английски
Things you should know before you discuss cheating Cheating has been discussed a lot lately. I'm writing a blog post about it with actual data (mainly, I want to know if there is an actual increase). However, in the many discussions that have ensued both here and on Discord servers, I noticed several recurring misconceptions. I wrote a section to debunk them and it grew kind of long, long enough to be a post in itself. So while my scripts are running, we can treat this as a kind of teaser. ### Things you should know before you write a comment about cheating Vocabulary: - _To plagiarize_ [means](https://dictionary.cambridge.org/dictionary/english/plagiarize) to use someone else's work while passing it off as yours. It refers to the act itself, **not** to its detection or punishment. "jrandomcoder plagiarized all of his solutions in round 987" is a meaningful statement. "jrandomcoder cheated in round 987 but he still hasn't gotten plagiarized, I request [user:MikeMirzayanov,2024-08-16] to look into this" is not. - _Plague_ is a...
recent cases, just because you checked a number of recent ones and noticed a pattern. So everything here, As I'm writing my actual blog, it has become clear to me just how much effort does in fact go

Полный текст и комментарии »

  • Проголосовать: нравится
  • +652
  • Проголосовать: не нравится

102.
Автор SirShokoladina, история, 8 лет назад, По-русски
Codeforces Round #497 by Skyglow <img style="float: right; margin: 0px 30px 20px 50px;" src="/predownloaded/7a/cb/7acb70215acb214185582e201c004419b1a7622f.jpg"> Hello, everyone! We are a Death Metal band [Skyglow](http://skyglowband.com/). Recently we released our first album. And since we happen to be sport programmers, we decided to make a Codeforces round in honor of this! The round will take place on [contest_time:1007]. There will be five problems for each division, three of them will coincide. The problems were made up by me and [user:SirRembocodina,2018-07-09], the contest was also prepared with the help of [user:TeaPot,2018-07-09], [user:GrumpyKitten,2018-07-09], [user:mingaleg,2018-07-09] and [user:niyaznigmatul,2018-07-09]. Thanks to [user:demon1999,2018-07-10] and [user:winger,2018-07-13] for testing, our coordinator [user:arsijo,2018-07-09] and, of course, [user:MikeMirzayanov,2018-07-09] for Codeforces and Polygon platforms. You can listen to the album by following the link: - https://skygl...
. Just [send me a private message](http://codeforces.me/usertalk?other=SirShokoladina) **before the

Полный текст и комментарии »

  • Проголосовать: нравится
  • +859
  • Проголосовать: не нравится

103.
Автор Yandex, 7 лет назад, По-русски
Happy Birthday, Codeforces! Dear Codeforces, <img src="/predownloaded/32/a6/32a6b841dd1f306d9f2f1b232ef710ed9a27c350.jpeg" style="float:right; margin:0 1em 1em 1em;"/> Happy 10th anniversary from Yandex! Over the past ten years, you have become more than just a platform for competitions having developed into a community hub where people can socialize, discuss interesting tasks and make useful contacts — a large part of life for every competitive programmer. Keep it up – continue growing and developing! Codeforces, with its immense contribution to competitive programming, is very important to the entire community of sport programmers around the world. Yandex actively supports programming contests and competitions and appreciates what Codeforces does, having benefitted from a large number of talented employees with a background in competitive programming. It wouldn’t be the same without this community. We would also like to use this opportunity to thank [user:MikeMirzayanov,2020-04-01] for Polygon, which ...
Happy 10th anniversary from Yandex! Over the past ten years, you have become more thanjust a

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1417
  • Проголосовать: не нравится

104.
Автор MikeMirzayanov, 12 лет назад, По-русски
Codeforces: results of 2014 <img src="http://assets.codeforces.com/images/statistics-2014/snowman-en.png" style="float:right; margin:0 1em 1em 1em;"/> Hello 2015! Hello Codeforces! It seems it is time to take stock. Frankly, I was almost feared to start summing statistics of 2014. In 2013 Codeforces showed rapid growth so that it would not be surprising to look bad on the background of 2013. Certainly not! I was pleasantly surprised by the statistics and reports! Just below is a list of major events and achievements of Codeforces over the year. For you, it's just a list, but please note &mdash; every item includes hard work of multi-day Codeforces team, writers of problems, the organizers of contests and tournaments, problem testers and volunteers. Yay! Together we have done all of this: * introduced Codeforces API * added (and sometimes improved) all Andrew [user:andrewzta,2015-01-03] Stankevich contests * Codeforces supported mode to work as iframe-widget, and Codeforces helped Google to run https...
Just below is a list of major events and achievements of Codeforces over the year. For you, it's

Полный текст и комментарии »

  • Проголосовать: нравится
  • +934
  • Проголосовать: не нравится

105.
Автор Errichto, 8 лет назад, По-английски
Wanting to get contribution is good I initially wrote a longer comment on [user:Radewoosh,2018-08-17]'s blog but realized the following part is a completely separate thing. ### **Wanting to get contribution is a good thing.** It's an incentive to literally contribute to the community. This is how rankings work. People dream to be top10 rating one day and it motivates them to work harder. The "top contributors" list has the same goal: to incentivize people to help others. I don't mind if someone says "you want to get to top10 contribution" to me, and I joke with friends about it (also about [user:Swistakk,2018-08-17] and [user:Radewoosh,2018-08-17]). The bad thing is that a comment like this can be seen by others and make them less motivated (maybe unconsciously) to contribute. You likely don't realize how much the feedback matters. Preparing contests isn't more profitable than working in a company, but it's so rewarding to know some people liked your problems that it motivates you to do it again. It should be si...
So remember: saying "you just want contribution" basically means "you just want people to find your

Полный текст и комментарии »

  • Проголосовать: нравится
  • +460
  • Проголосовать: не нравится

106.
Автор Una_Shem, история, 7 лет назад, По-русски
About Gift Distribution Hello everyone! <img alt="Packages" src="https://codeforces.me/predownloaded/a7/ce/a7ce52909464af02e2f922990c8c7e4418b98f67.jpg" style="float:right; height: 500px; margin: 10px; max-width:50%;"/> “My name is Una and I am from the Codeforces team” &mdash; this is usually how my messages to users of the site begin. One of the reasons why I write a message is very joyful &mdash; sending out gifts to the winners of the competitions and now also to participants of crowdfunding dedicated to the 10th anniversary of Codeforces. That’s what I’d like to talk about a little bit. Everyone knows where it all starts &mdash; there is a round with gifts, in the comments to which after the ending the coordinators or Mike post a list of winners. Then, in a short time, all winners receive a system message asking them to update the data about the size of the T-shirt and address. In some special cases, such as crowdfunding, for example, all participants receive an email. For various reasons...
the size, there’s just nothing we can do after t-shirts are manufactured. Please note the size charts

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1291
  • Проголосовать: не нравится

107.
Автор nyavim, история, 2 года назад, По-английски
Another Graph Editor! **UPDATE (5 Dec 2024)** There have been a few new features since its initial release. - Multiple graphs/testcases (each "tab" can store its own testcase so you can visualize all testcases at once) - Multi-edge support - Bipartite mode - More appearance-related configuration sliders Thanks for all the support and suggestions! Things will continue to be added slowly over time, but if there's a particular feature that you want you can just open an issue on GitHub. --- Hello, Codeforces! I've been working on a graph visualization tool for a while now, and because I couldn't think of a good name for it, I've opted to call it *Another Graph Editor*. If you have any name suggestions, pls let me know. Here's the [website](https://anacc22.github.io/another_graph_editor/) and the [repo](https://github.com/anAcc22/another_graph_editor). ![ ](https://github.com/anAcc22/another_graph_editor/blob/main/screenshots/main.png?raw=true) The layout is very much inspired by CS A...
if there's a particular feature that you want you can just open an issue on GitHub., value at node `i`, you can just copy-paste it into *Node Labels* and it'll show up as little, , as you may just copy paste the test case edge data into the text area using the form `u v w`, where

Полный текст и комментарии »

  • Проголосовать: нравится
  • +811
  • Проголосовать: не нравится

108.
Автор unreal.eugene, 5 лет назад, По-английски
Polygon Updates (June — August 2021) Hello, Codeforces. I and [user:DK318,2021-08-19] joined the Codeforces team in June. These three months we mainly dealt with the development of the Polygon platform. In this post, we would like to present to you a list of what we have done during this time. Most of the changes were made to attain easier problem creation. This list does not include minor bug fixes or any improvements that are invisible to users. #### Tables support when rendering statements in HTML Now it's possible to insert the most basic tables in your HTML statements. For example, you can show the scoring system of your problem or insert several images side by side. Only column text alignment and border specification are supported now. <img src="/predownloaded/4a/4a/4a4a6c726e96df40929803a1276a448947d6ebed.png" style="width: 800px; margin-left: auto; margin-right: auto; display: block"/> #### A brief manual for writing statements We bet a lot of users who wrote statements were confused by the fact ...
revert option. This option allows you to bring the old version back but doesn't commit itjust yet. The

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1013
  • Проголосовать: не нравится

109.
Автор zscoder, история, 7 лет назад, По-английски
[Tutorial] Generating Functions in Competitive Programming (Part 2) Welcome to Part 2 of my tutorial on generating functions. The [first part](https://codeforces.me/blog/entry/77468) focused on introducing generating functions to those without any background in generating functions. In this post, I will demonstrate a few applications of generating functions in CP problems. Let us start with some relatively straightforward examples. Note: Unless stated otherwise, all computations are done modulo a convenient prime (usually $998244353$). Also, $[n]$ denotes the set $\\{1,2,...,n\\}$. ### Blatant Applications in Counting Problems **Problem.** [AGC 005 Problem F](https://atcoder.jp/contests/agc005/tasks/agc005_f) You have a tree $T$ with $n$ vertices. For a subset $S$ of vertices, let $f(S)$ denote the minimum number of vertices in a subtree of $T$ which contains all vertices in $S$. For all $1 \le k \le n$, find the sum of $f(S)$ over all subsets $S$ with $|S| = k$. Constraints: $n \le 2 \cdot 10^{5}$. <spoiler summary="Solution"> First, ...
$[x^m]\frac{1}{(1-x)^{n-1}}$ and $[x^m]\frac{x}{1-x-x^2}$ fast (the former is just some binomial, $c(k)$). This is just $C_{o}'(1)$. By Quotient Rule, this is equivalent to finding $\frac{A_{o}'(1, the OGF for $d_{n,k}$. $d_{1,k}$ is just the Fibonacci sequence, so we know that $P_{1}(x) = \frac{x, , it might be a stretch to call this a generating function problem but I just want to demonstrate, . However, we just need to "rationalize" the numerator and rewrite our function as, Firstly, let's find the EGF of $b(k)$. This is just a special case of $a(k)$ when $s_{i}=0$, so we, For convenience, now we ignore the $n!$ term and just let $ans(k)$ be $\displaystyle\sum_{j=1}^{n, In any case, after some work you can find $B(x)$. How do we find $A(x)$? Just refer to the identity, Once we obtained the values of $E(1), E(2), ..., E(n-1)$, we just need to represent $E(k)$ in terms, Speaking in generating functions, this is just the equation, }$ since all the terms with $i \ge 1$ sum up to $0$. Hence, we just need to output the constant term of

Полный текст и комментарии »

  • Проголосовать: нравится
  • +518
  • Проголосовать: не нравится

110.
Автор PurpleCrayon, 5 лет назад, По-английски
[Tutorial] Simulated Annealing in Competitive Programming Hi Codeforces! I've recently noticed a lack of simulated annealing tutorials, so I decided to make one. It all started when I was trying to "cheese" [problem:1556H] after the contest. In general, simulated annealing is a pretty niche topic, but it can sometimes lend you unintended solutions for very hard problems. It's also very useful in contests like Google Hashcode, where you can add simulated annealing to an already good solution to make it a lot better. Simulated annealing's name and terms are derived from physical annealing, the process of letting metals or glass cool down and harden while removing internal stresses. An Overview ------------------ Simulated Annealing is an approximation algorithm. It's generally useful in problems with low constraints (i.e. $n \leq 50$ or $n \leq 100$) where you need to find the minimum/maximum of something over all possible states (and there are usually way too many of them to check). In general, it's good at finding the global maximum...
Where $a$ is just some constant that you choose.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +602
  • Проголосовать: не нравится

111.
Автор I_love_Hoang_Yen, 12 лет назад, По-английски
The 'science' of training in competitive programming So few minutes ago [I answered this question on Quora](https://www.quora.com/What-is-the-best-strategy-to-improve-my-skills-in-Competitive-programming-in-2-3-months/answer/Thanh-Trung-Nguyen). It felt like a good answer (because it has pictures), so I would like to share it again here. **If you don't see the images, just click the Quora link above** Many people tell you that solving lots of problems and you will become red on Topcoder/Codeforces one day. It is true, and is the only universally approved way in competitive programming community, but actually it is just half of the story. Let me first explain to you the 'science' of problem solving (which is not very scientific, since it was only developed by myself). For each problem, in order to solve it, you must jump over a gap. It can be either a difficult implementation, or some hard-to-see observation, or difficult algorithm, etc. <a href="http://tinypic.com?ref=353d2df" target="_blank"><img src="http://i58.tinypic.com/...
to me, and passing through them feels just like casual walking., you must solve gradually harder problems, not just the easy ones. Get out of your comfortable zone, **If you don't see the images, just click the Quora link above**, But.. it also means that, if you just solve too easy problems, you can still only walk through, Some problems are very hard. The gap is just too huge, or there are many many gaps, and you can get

Полный текст и комментарии »

  • Проголосовать: нравится
  • +563
  • Проголосовать: не нравится

112.
Автор prvocislo, история, 4 года назад, По-английски
I Reached GM after 5 years Hello Codeforces! I did it! My main goal for 2022 was to reach red and I succeeded in the last contest of the year by getting +1 delta and going from cursed 2399 to 2400! I was very happy but scared to celebrate because I was worried that my rating would go down to 2399 again after the cheater removal. But now it’s 2401, so I think I’m safe now. Why am I writing this blog? I'm very excited about this achievement, it means a lot to me and I want to share my happiness with Codeforces. Also people ask me in DM quite often about how I got onto this level or who I am in general, so I think it's time to summarize it all into one blog post. Oh, wait… You don’t even know me, so why should you keep reading this blog post? Let me introduce myself a little first. I’m a high schooler from a small European country where few people do Codeforces. I love competing in OI and MO, I always did. One day, my father found the Codeforces website and suggested that I should start practicing there. At ...
3. Always implement the problem after reading the editorial/solving it, don’t just settle for “mind

Полный текст и комментарии »

  • Проголосовать: нравится
  • +716
  • Проголосовать: не нравится

113.
Автор -is-this-fft-, история, 6 лет назад, По-английски
How to ask for help in PM There was a blog today with a similar title, and although it was (I think, not really sure as I didn't get a good look) some kind of satire/joke blog, I wanted to post some serious advice about things I (don't) like to see when people are PMing me. However I decided that this wouldn't be in the spirit of the blog and decided to make a separate blog. And now that blog is deleted anyway. While it's not a bad thing to write messages to more experienced users, most people who write me do things that make them very difficult to deal with. These are my opinions, but somewhy I feel that many reds will agree. Some things here feel silly to write because they are so obvious. But I'm only writing them because people regularly mess them up. [cut] $~$ ####Use punctuation and spelling. There are some [very simple rules](https://codeforces.me/blog/entry/82186#comment-689836) that make your messages infinitely more readable. I find it especially strange when many of these messagers call...
(maybe exponential complexity) (if you can, you may also just copy someone else's solution) > - Write a, another time, but there comes a point where you just being to annoy. You should understand when that, resources"** If you ask something specific, maybe I have something good. But 99% of the time I willjust

Полный текст и комментарии »

  • Проголосовать: нравится
  • +746
  • Проголосовать: не нравится

114.
Автор zscoder, история, 10 лет назад, По-английски
[Tutorial] Non-trivial DP Tricks and Techniques Hi everyone! Today I want to share some DP tricks and techniques that I have seen from some problems. I think this will be helpful for those who just started doing DP. Sometimes the tutorials are very brief and assumes the reader already understand the technique so it will be hard for people who are new to the technique to understand it. Note : You should know how to do basic DP before reading the post DP + Bitmasks ------------------ This is actually a very well-known technique and most people should already know this. This trick is usually used when one of the variables have very small constraints that can allow exponential solutions. The classic example is applying it to solve the Travelling Salesman Problem in $O(n^{2} \cdot 2^{n})$ time. We let $dp[i][j]$ be the minimum time needed to visit the vertices in the set denoted by $i$ and ending at vertex $j$. Note that $i$ will iterate through all possible subsets of the vertices and thus the number of states is $O(2^{n} \cdo...
example, as $dp[2A][n]$ is just $\sum_{i = 0}{n} a_{i} \cdot b_{n - i}$ and we can calculate this by, problems. I think this will be helpful for those who just started doing DP. Sometimes the tutorials are, Next, we just have to multiply this with $f(0, 0) + f(1, 1)x + ... + f(K, K)x^{K}$ and we get the, ]$ from $dp[i][\cdot]$ in $O(n)$ time. Now, we just have to calculate $dp[2i][\cdot]$ from $dp[i][\cdot, }$. Indeed, this is just a result of the formula above, where we iterate through all possible subset sizes

Полный текст и комментарии »

  • Проголосовать: нравится
  • +612
  • Проголосовать: не нравится

115.
Автор SecondThread, история, 7 лет назад, По-английски
Why problem writers should stop saying “It is guaranteed that” Please Stop Guaranteeing Things ================== There are two common meanings for something being “guaranteed”, and often it is up to the reader to guess the author’s intended meaning. This is annoying and creates unnecessary barriers to entry. **Meaning #1:** The thing we are guaranteeing is provably true for the given input. The thing we are guaranteeing is simply true. We don’t want to provide a proof since it would be long, unnecessary, and annoying to read, and might spoil the solution, but you have our word that an answer always exists. Example: We give you two positive integers A and B (1 <= A, B <= 100). Find some positive integer C (1 <= C <= 200) such that C < A + B. **It is guaranteed that some C exists.** **Meaning #2:** The only input that is legal is input for which this is true. The thing we are guaranteeing might not always be true without this guarantee. Thankfully, we are providing this guarantee so that you only need to concern yourself with solving t...
impossible case isn’t super obvious like n=1, then an impossible case just doesn’t exist.”, "You just suck at reading problems. Use samples. Reread the statement. This is a skill, you have to, Alternatives: ------------- Meaning 1: Make it clear that the ‘guarantee’ is just to make the, Just don’t provide the ‘guarantee’ at all and make it a red herring

Полный текст и комментарии »

  • Проголосовать: нравится
  • +608
  • Проголосовать: не нравится

116.
Автор -is-this-fft-, история, 2 года назад, По-английски
Is it just me or has discussion on Codeforces become a lot less lively? A few months ago, I was pretty disheartened. I wrote a [blog](https://codeforces.me/blog/entry/128552) that I put thought and effort into, and it got only +163 votes and basically no discussion. Meanwhile, a [dumb parody](https://codeforces.me/blog/entry/128316) I had published just 5 days earlier got +959 votes. Ok, but let's say that this is a bad example, maybe my explanation was bad or uninteresting or people just don't care about residual graphs that much. That's fair. But I suspect this is a bigger trend. I don't know if my memory deceives me here, but I feel like some years ago there were more high-quality, educational blogs with active discussion. [user:WeakestTopology,2024-09-16] posted a math blog recently and there are no comments, the blog might just slide out of Recent Actions pretty soon. This seems to happen a lot with such blogs, especially on "advanced" topics. What I see a lot instead is poor quality content. Lots of blogs like "please debug my code" and "how...
Is it just me or has discussion on Codeforces become a lot less lively?, "how can I improve" just overwhelm all other content. A lot of comments have extremely bad quality, . Meanwhile, a [dumb parody](https://codeforces.me/blog/entry/128316) I had publishedjust 5 days, . [user:WeakestTopology,2024-09-16] posted a math blog recently and there are no comments, the blog mightjust slide

Полный текст и комментарии »

  • Проголосовать: нравится
  • +316
  • Проголосовать: не нравится

117.
Автор -is-this-fft-, история, 7 лет назад, По-английски
[Tutorial] The DFS tree and its applications: how I found out I really didn't understand bridges #### Introduction This is a tutorial/exploration of problems that can be solved using the "DFS tree" of a graph. For a way too long time, I didn't really understand how and why the classical algorithm for finding bridges works. It felt like many tutorials didn't really explain how it works, kind of just mentioned it in passing and quickly just moved on to implementation. The day someone explained what the DFS tree is, I finally understood it properly. Before, it took me ages to implement bridge-finding properly, and I always had to look up some detail. Now I can implement it at typing speed. But more importantly, I began to see how the same techniques can be used to solve graph problems that have more or less nothing to do with bridges. The thing is, when you have a black box, you can only ever use it as a black box. But if you have a box that you understand well, you can take it into pieces, repurpose the pieces for completely different things, all without getting lost...
bridges works. It felt like many tutorials didn't really explain how it works, kind ofjust, . Obviously the edge we remove must also come from that component, so we can just pretend that this is, Sometimes the DFS tree is just a way to represent a graph that makes implementation of certain

Полный текст и комментарии »

  • Проголосовать: нравится
  • +565
  • Проголосовать: не нравится

118.
Автор Dominater069, 2 года назад, По-английски
Analyzing how good O1-Mini actually is I would like to thank [user:redpanda,2024-09-13] and [user:qmk,2024-09-13] for their great help in writing and reviewing this blog. They are also the users who queried O1-mini for all the following problems. We tried O1-mini on several problems, from a variety of sources. Let's list the results first. **Note** : - Some of the WA verdicts here actually means that the AI just "stopped thinking" which means the AI thought for a long enough time without any useable results so it ran into an error. - All ratings mentioned are Codeforces ratings, the Atcoder ratings have been converted to codeforces rating. To measure the approximate codeforces rating of the atcoder problems mentioned here, you can use https://kenkoooo.com/atcoder/#/table/ + https://silverfoxxxy.github.io/rating-converter. <h4> D2ABs </h4> - [problem:1762B] [<a class="rated-user user-gray" title="Gray">1100</a>] <a class="rated-user user-green" title="Green AC">AC</a> - [problem:1998B] [<a class="rated-...
- Some of the WA verdicts here actually means that the AI just "stopped thinking" which means the, These contests simply aren't fair in the current format. Even if you ban AI, i can alwaysjust

Полный текст и комментарии »

  • Проголосовать: нравится
  • +583
  • Проголосовать: не нравится

119.
Автор ToxicPie9, 3 года назад, По-английски
You won't believe how this simple trick defeated the unexplained bug destroying every top LGM ### TL;DR Currently people are discussing a slowdown bug on Codeforces that seems to happen randomly, and can cause code to run 100x slower and get TLE. More details in [user:pajenegod,2024-03-03]'s [blog post](https://codeforces.me/blog/entry/126654). In this article, I present a mitigation: add the following to your code. ~~~~ #include <windows.h> void *operator new(size_t size) { if (void *ptr = HeapAlloc(GetProcessHeap(), 0, size ? size : 1)) return ptr; throw std::bad_alloc{}; } void operator delete(void *ptr) { HeapFree(GetProcessHeap(), 0, ptr); } ~~~~ <spoiler summary="If you use malloc/free in C++ (you shouldn't), also change them."> ~~~~ void *my_malloc(size_t size) { if (void *ptr = HeapAlloc(GetProcessHeap(), 0, size ? size : 1)) return ptr; throw std::bad_alloc{}; } void my_free(void *ptr) { HeapFree(GetProcessHeap(), 0, ptr); } ~~~~ </spoiler> <spoiler summary="If you use aligned new/delete in C++, also change the...
disastrous dumpster fire C library. How to fix this? It's easy, just replace it with memory management, Let's look at UCRT first. In non-debug mode, `malloc` simply calls `_malloc_base`, which isjust a, This is because I have absolutely no idea what the code does or how it works. It mightjust not, just bad implementation from C++ STL, and isn't really the contestants' fault, so I don't usually

Полный текст и комментарии »

  • Проголосовать: нравится
  • +794
  • Проголосовать: не нравится

120.
Автор TooFast, история, 5 лет назад, По-английски
I'm just a blue <p> Inspired by <a href="https://www.youtube.com/watch?v=tyeJ55o3El0">this video</a>. </p> <p> Dedicated to my fellow blues: </p> <p> I'm just a blue.<br /> Yes, I'm only a blue.<br /> And I'm sitting here observing my queue.<br /> Well, it's a long, long journey<br /> To be a candidate master.<br /> It's a long, long wait<br /> Before escape from disaster,<br /> But I know I'll be a purple some day<br /> At least I hope and pray that I do<br /> But today I am still just a blue.<br /> </p> <p> Gee, Blue,<br /> You certainly have a lot of patience and courage.<br /> </p> <p> Well, I got this far.<br /> When I started I wasn't even a blue<br /> I was just a gray<br /> Some folks back home decided they wanted a purple son<br /> So they called their gang on WhatsApp, and they said<br /> You're right, there oughta be a purple.<br /> Then he sat down<br /> And wrote me out and introduced me to Codeforces.<br /> And I became a blue, and I'll remain a bl...
I'm just a blue, Well, I got this far. When I started I wasn't even a blue I was just a gray , today I am still just a blue.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +398
  • Проголосовать: не нравится

121.
Автор MikeMirzayanov, 3 года назад, По-английски
Goodbye 2023. Hello 2024! <img src="/predownloaded/f4/1f/f41ff0beb745fb2f84a55d9f2cc451273efc6267.jpg" style="width:300px; float:right; margin: 0 1em 1em 1em"/> Dear Santa Claus. Please make 2024 a happy year, not just that. Please, we all need this. Hello, 2024! And we have traditional gifts! #### <img src="https://assets.codeforces.com/images/wand.png"/> Change Handle Feature Hurry! Only until the 10th of January, you can change your handle (<b>but only once</b>)! Note that it will be possible to roll back the changes or change the handle again only _after a year_. Be careful what you wish for. You can change your handle to the new one that wasn't used before by anybody or which was used by you before. The links to a profile page with an old handle would automatically redirect to the actual profile. Again, this year if you took part in at least 10 rounds you can request a handle of an _inactive_ participant. It means that the participant should have a period of activity on Codeforces of ...
Dear Santa Claus. Please make 2024 a happy year, not just that. Please, we all need this.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +686
  • Проголосовать: не нравится

122.
Автор KAN, 21 месяц назад, По-английски
Codeforces Blitz Cup 2025 Hi Codeforces! As announced earlier, we’re holding an individual competition, the Codeforces Blitz Cup 2025, to celebrate 15 years of Codeforces. The tournament features PvP matches in a novel Blitz format, where every second (literally!) counts. In a 40-minute match, the opponents rush to solve each consecutive problem quicker than the rival. One needs to come up with a correct solution, think over the optimal implementation, and code cleanly: only the first one to get a problem correctly claims the points. <spoiler summary="Complete Blitz rules"> - Each match lasts 40 minutes, with 7 problems of increasing difficulty (worth 2, 3, 4, 6, 8, 10, and 12 points). - Problems are revealed one at a time, in the order of increasing difficulty. - Only the first contestant to solve a problem earns points. - Once a problem is solved, it becomes unavailable, and the next one is revealed after 60 seconds. Contestants need to code the solution from scratch. It is forbidden to use ...
bracket. The first round has just concluded, and we’ve already seen both head-to-head battles and

Полный текст и комментарии »

  • Проголосовать: нравится
  • +644
  • Проголосовать: не нравится

123.
Автор Xellos, история, 11 лет назад, По-английски
Codeforces Round #333 — editorial ### Hints: [div2A](#div2A): Try conversions between bases. [div2B](#div2B): Solve a simpler version of the problem where $A_{i+1} \neq A_i$ for all $i$. [div1A](#div1A): What are the shortest paths of the vehicles? what's the shorter of those paths? [div1B](#div1B): Forget about the ceiling function. Draw points $(i,A[i])$ and lines between them &mdash; what's the Lipschitz constant geometrically? [div1C](#div1C): Some dynamic programming. Definitely not for the exp. score of one person &mdash; look at fixed scores instead. [div1D](#div1D): Compute $dif(v)$ in $O(N)$ (without hashing) and then solve the problem in $O(N^2)$. You need some smart merges. [div1E](#div1E): Can you solve the problem without events of type 1 or 2? Also, how about solving it offline &mdash; as queries on subsets. ![ ](https://i.imgur.com/bnWmD60.png) ### <a name="div2A"></a>Div. 2 A: Two Bases ------------------------------------ It's easy to compare two numbers if the same bas...
afterwards and the original $H_w$'s root should become its son, so we're rerooting $H_w$. We'lljust, allows us to compute those values directly. After computing $dif(v)$ for each $v$, we canjust compute, are 2 things we could try to compute: probabilities of individual overall ranks of Kleofáš orjust, can do better. We've just described how we can pick those exhibits based on the queries between, each other, then we just need to sum up the exp. numbers of people with those scores (which wejust, remember all levels of the perfect binary tree, but just the one we're computing and the one above it, the, to a common base — just use the formulas, =|A_k-A_i|$ and $j-i < k-i$; we just need to divide those inequalities, If $v$ is a leaf, of course, we can just create $H_v$ that consists of one vertex., If we just had 1 query and nothing else, it's just standard knapsack DP. We'll add the exhibits one, If we're left with just one query, we can solve it in $O(Nk)$ as the usual 0-1 knapsack., In order to avoid casework, we can just compute the answer as the maximum of the train's and the, Let's figure out how to compute $\text{dif}(v)$ for just one fixed $v$. One more or less obvious, The name is really almost unrelated — it's just what a tree with arbitrary letters typically

Полный текст и комментарии »

Разбор задач Codeforces Round 333 (Div. 1)
Разбор задач Codeforces Round 333 (Div. 2)
  • Проголосовать: нравится
  • +490
  • Проголосовать: не нравится

124.
Автор Phantasmagorias, история, 5 лет назад, По-английски
Codeforces Round #745 Editorial I'm very sorry about all the inconvenience, and I would like to bear the blame. Much thanks to those who help me prepare this round. It's not their fault. And much thanks to your participation. [problem:1581A] ------------------ idea: [user:interlude,2021-09-30] preparation: [user:CQXYM,2021-09-30] tutorial: [user:CQXYM,2021-09-30] Assume a permutation $p$, and $\sum_{i=2}^{2n}[p_{i-1}<p_i]=k$. Assume a permutaion $q$, satisfying $\forall 1 \leqslant i \leqslant 2n, q_i=2n-p_i$. We can know that $\forall 2 \leqslant i \leqslant 2n,[p_{i-1}<p_i]+[q_{i-1}<q_i]=1$. Thus,$\sum_{i=2}^{2n}[q_{i-1}<q_i]=2n-1-k$, and either $p$ should be counted or $q$ should be counted. All in all, the half of all the permutaions would be counted in the answer. Thus, the answer is $\frac{1}{2}(2n)!$. The time complexity is $O(\sum n)$. If you precalulate the factors, then the complexity will be $O(t+n)$. ----- <spoiler summary="solution"> ~~~~~ #include<stdio.h> int f[100001]; int m...
In addition, the answer of the problem is $f_{n,m,k}$. Actually, the dp proccess isjust like a, To solve this problem, use NTT and polynomial inversion algorithm is just ok. Each time we, just about $l$, and the right part is just about $r$. Then we enumerate $l$, the answer of the best

Полный текст и комментарии »

Разбор задач Codeforces Round 745 (Div. 1)
Разбор задач Codeforces Round 745 (Div. 2)
  • Проголосовать: нравится
  • +799
  • Проголосовать: не нравится

125.
Автор Radewoosh, история, 8 лет назад, По-английски
Blogewoosh #7 Hello, codeforces! Long time no see, right? So maybe it's a good idea to try to return to my blogs slowly. This time the blog will be about a trick, which usually isn't necessary to solve a task, but can be useful to make implementation much more comfortable. Let's look at [this](https://codeforces.me/contest/932/problem/F) problem. It is about some DP on a tree in which we have to use convex hull trick to improve the complexity. The task requires merging two convex hulls with "smaller to bigger" trick. I recommend you to read the statement before reading the rest of the blog (and the [editorial](https://codeforces.me/blog/entry/57796) if you don't know how to solve it). [cut] $ $ So, how to merge two convex hulls? If we keep them in something like the set from C++, then we can just take every element from the smaller one and try to add it to the bigger one. Unfortunately, adding one element in this way requires some ifology and care. It's hard to implement it, especiall...
just take every element from the smaller one and try to add it to the bigger one. Unfortunately

Полный текст и комментарии »

  • Проголосовать: нравится
  • +697
  • Проголосовать: не нравится

126.
Автор cgy4ever, 12 лет назад, перевод, По-русски
Codeforces Round #270 Do you want to win a T-shirt? Do you want to learn how to design tasks for programming contest? Do you want to solve 7 tasks in 2.5 hours? So Codeforces Round #270 is right for you. It was designed by me in California, Assembled in polygon (so Thank you [user:MikeMirzayanov,2014-09-26] for the system and [user:Gerald,2014-09-26] for organize and testing), will start on [regular time this Sunday](http://www.timeanddate.com/worldclock/fixedtime.html?day=28&month=9&year=2014&hour=19&min=30&sec=0&p1=166), don't miss it! The organizers of **<a href="/blog/entry/13929">Marathon24</a>** decided to present gifts to the best finishers of the round! Best 25 participants will get Marathon24 tshirts! Thanks! <center> <img src="http://www.elmostshirts.com/images/tshirts.jpg"/> <br><small>It is just an image to attract your attention. Real tshirts will be designed specially for Marathon24!</small> </center> There are some articles introduced how to become a problem setter, like [Pro...
It is just an

Полный текст и комментарии »

  • Проголосовать: нравится
  • +794
  • Проголосовать: не нравится

127.
Автор PrinceOfPersia, 12 лет назад, По-английски
Algorithm Gym :: Data structures Today I want to introduce you some very very useful data structures. In this lecture, we are trying to improve your data structures skills, stay with us and click on **read more**. [cut] Important data structures : Trees ----- Trees are one of the most useful data structures.A tree is a connected-acyclic graph.There are too many types of trees, like : rooted trees, weighted trees, directed trees, tries, etc. Partial sum ----------- There are two types of problems solvable by partial sum. 1.Problems which you are asked to answer some queries about the sum of a part of elements (without modify queries). Solution of all of this problems are the same. You just need to know how to solve one of them. Example : You are asked some queries on an array $a_1,a_2,...a,_n$. Each query give you numbers $l$ and $r$ and you should print $a_l + a_{l+1} + ... + a_r$ . Solution : You need to build another array $s_1, s_2, ..., s_n$ which $s_i = a_1 + a_2 + ... + a_i$ ...
Solution of all of this problems are the same. You just need to know how to solve one of them., You can read more about it, just google `sgi STL`.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +608
  • Проголосовать: не нравится

128.
Автор -is-this-fft-, история, 4 года назад, По-английски
On "is this greedy or DP", forcing and rubber bands #### Introduction When it comes to "problem-solving techniques", there are roughly 3 levels: 1. Concrete algorithms (Kruskal's algorithm, Li-Chao tree, fast Fourier transform) 2. General patterns (dynamic programming, greedy, square-root decomposition) 3. Meta-strategies ("how do I even go about solving this problem?") There is some grey area, but in general this classification works well. [Many tutorials](https://codeforces.me/catalog) have been written about ideas that fall into 1 or 2. But very little has been written about the third category. On the catalog, I think the only blogs that really qualify are [this](62730) and [this](20548). There is also [this](92248?#comment-809401) valuable comment. As to why there is so little written, I think I can identify two reasons. - Most strong contestants don't really consciously think about these. After solving a problem with FFT, it's hard not to know you used FFT. If you used DP, even if you did it without thinki...
_can_ mean that in some problems (for example, in game problems with just 2 parameters, you can, about the simplest non-trivial variant. Instead of having a set $B$ of operation lengths, let'sjust, is just dsu + stack" and like... no, it's not. You left out all the reasons about why it works, how, string problems, but they have their own standard tricks and techniques just like everything else., this point. "Deciding" whether to use DP or greedy and then forcing your choice isjust a bad approach., I'll not delve into the solution with a set $B$ instead of just one width $b$, but it is not hard, This forcing fallacy also extends to more specific algorithms, not just more general patterns like

Полный текст и комментарии »

  • Проголосовать: нравится
  • +548
  • Проголосовать: не нравится

129.
Автор MikeMirzayanov, история, 11 лет назад, По-русски
Codeforces: Rating Is Fixed (bug, go away!) Hello! Last weeks I was concerned (and probably, you too) about abnormal rating growth of our leaders. Of course, first of all I'm talking about [user:tourist,2016-04-06], his rating is just rushed into the sky. [ ](http://codeforces.me/predownloaded/99/59/9959129ab312a0bd0923600541211a1246a5201b.png) There were even comments from a series of "I told, and it happened" ![ ](http://codeforces.me/predownloaded/f6/a2/f6a2d5fcb18598f48cc5e3e3719e8ea135c5f820.png) After the first round of VK Cup 2016, I carefully investigated the reasons of such growth and found a simple and trivial bug in the rating formulas. It's funny that even after being published, nobody found it. Look at this function: ~~~~~ private double getSeed(List<Contestant> contestants, Contestant contestant, int rating) { Contestant extraContestant = new Contestant(null, 0, 0, rating); double result = 1; for (Contestant other : contestants) { result += getEloWi...
course, first of all I'm talking about [user:tourist,2016-04-06], his rating is just rushed into the

Полный текст и комментарии »

  • Проголосовать: нравится
  • +878
  • Проголосовать: не нравится

130.
Автор brunomont, 6 месяцев назад, По-английски
Chinese Postman Problem: How I Ran a 180 km Ultramarathon Through Every Street in My City Hello, Codeforces! A couple of years ago, a friend of mine told me that two cyclists had passed through every single street in the center region of the city I live in (Belo Horizonte, southeastern Brazil), on the [third try](https://www.strava.com/activities/1030665876/overview). <spoiler summary="First try"> After ~160 km, they had not completed 1/3 of the goal. [Strava link](https://www.strava.com/activities/976021527). <img src="/predownloaded/8a/53/8a53829f7d78e88808a3ff751b64406ec2fc0efd.png" style="width: 600.0px;max-width: 100.0%;max-height: 100.0%;"> </spoiler> <spoiler summary="Second try"> They were better prepared, but one of the guys was run over by a car (no big injuries). [Strava link](https://www.strava.com/activities/999450285). <img src="/predownloaded/85/8f/858fdcdcfda93cd1d9c7c59db7dbfad9e63d6ea2.png" style="width: 600.0px;max-width: 100.0%;max-height: 100.0%;"> </spoiler> <center> <img src="/predownloaded/8d/5c/8d5cfb677a361654105e49f36f214c35...
1. If cars pass through it, then it is a street (as long as it is not just a parking space); 2. If

Полный текст и комментарии »

  • Проголосовать: нравится
  • +802
  • Проголосовать: не нравится

131.
Автор MikeMirzayanov, 4 года назад, По-английски
Testlib: tests + CI Hello, Codeforces. I have wanted for a long time and now, finally, I sat down and did it. Many of you are familiar with my [Testlib](https://github.com/MikeMirzayanov/testlib) project. This is a library that helps you develop problems if you are using C++. In the case of problems for Codeforces rounds, its use is mandatory. It seems to me that it is almost a de facto standard for preparing materials for completely different olympiads and competitions. The history of С++-Testlib is almost lost in centuries, I published the first version in 2005. Nowadays, making edits to Testlib has become tricky. The code grown to thousands of lines, also it has too long a history. This increases the likelihood of accidentally changing some aspect of behavior, which will jeopardize the holding of a Codeforces round or another important competition. In short, making a bug in this code or changing behavior anywhere is highly discouraged. So I recently took the plunge and wrote some test...
, just want to run tests on single `g++` version using `--std=c++11`. You can use `bash run.sh g++ v0 g++`., You need to have installed `bash` and some tools. After just do `cd tests && bash run.sh`.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +711
  • Проголосовать: не нравится

132.
Автор twosquares, 11 месяцев назад, По-английски
Good Bye 2025 Editorial We'd like to thank you all for participating in the contest, and hope you enjoyed it. Any feedback would be appreciated! <!-- You lost the game. --> <spoiler summary="Rate the contest"> - Great contest: - Good contest: - Average contest: - Bad contest: </spoiler> --- <spoiler summary="Did Franklin (from problem D) succeed in massacring a village of innocent elves like Frieren and Dilhan (from problem E)?"> The official lore is that he got lost in a forest of oddly colored Christmas trees (from problem F) and decided instead to write this editorial. </spoiler> <!-- ########### --> <!-- #PROBLEM A# --> <!-- ########### --> <h2>[problem:2178A]</h2> <spoiler summary="Did you like the problem?"> - Great problem: - Good problem: - Average problem: - Bad problem: - Did not solve: ...
(for the chain consisting of just $j$) , The input essentially just creates a graph, where cities are connected, ., they were once equal before being flattened into their state just before the final concatenate

Полный текст и комментарии »

Разбор задач Good Bye 2025
Теги sus
  • Проголосовать: нравится
  • +697
  • Проголосовать: не нравится

133.
Автор antontrygubO_o, 7 лет назад, По-английски
On setting D2A and D2B problems Disclaimer: as always, everything in this blog is just my opinion. Some problemsetters don't take easy problems seriously. One very popular opinion is that the D2A-B problems are just stupid implementation exercises intended for beginners to learn how to code. ![ ](https://i.imgur.com/ioTMeKL.png) ![ ](https://i.imgur.com/TJ2IPzb.png) It's true that D2A-B problems are mostly like this on most platforms. This is one of the reasons why a lot of people don't like combined rounds: they think that solving D2A-B problems can't be interesting and just takes time which could be spent on solving fascinating problems of higher level. From point of view of most participants, easy problems just can't be good, because if problem requires some thinking than it's not easy enough for D2A-B level. Easy problems can't be interesting, they say! ![ ](https://i.imgur.com/aRe2p6l.png) ![ ](https://i.imgur.com/wLKlixu.png) This situation really upsets me. This kind of attitude from the ...
interesting and just takes time which could be spent on solving fascinating problems of higher level. From, one $0$, we can perform the operation, so the answer is just the difference between amounts of $0$s, problems are just stupid implementation exercises intended for beginners to learn how to code., Disclaimer: as always, everything in this blog is just my opinion., just a waste of time?

Полный текст и комментарии »

  • Проголосовать: нравится
  • +515
  • Проголосовать: не нравится

134.
Автор andreyv, 12 лет назад, По-русски
Catching silly mistakes with GCC As you know, the C++ language assumes that the programmer is always correct. Therefore C++ compilers don't add additional checks to the program, such as checks for null pointer dereference or out-of-bounds array access. This is good, because C++ programs run as fast as possible, and this is bad, because sometimes we may spend a long time debugging some silly mistake. We would want that the compiler can find such mistakes automatically. And many compilers can! In this post I will show various GCC options that do this. Previously [user:zakharvoit,2015-01-02] already wrote about this [here](/blog/entry/13875). All options that will follow should be added to the GCC command line. In various IDEs you can do it in IDE or compiler settings. Many of the options can also be used with Clang (for example, in Xcode). For MSVC++, I think, there is nothing better than Debug mode and `/W4`. [cut]   GCC warnings ------------------ Of course, the first step to debugging is to enable compi...
on the compiler version and operating system, **not every option from this list will work** —just

Полный текст и комментарии »

  • Проголосовать: нравится
  • +899
  • Проголосовать: не нравится

135.
Автор mblazev, история, 7 лет назад, По-английски
Presenting TLE: the best Codeforces bot for Discord I would like to present to you an open-source competitive programming (primarily codeforces) discord bot written in python by [user:meooow,2019-08-05], [user:algmyr,2019-08-05], [user:Narut,2019-08-05], [user:Rahul,2019-08-05], [user:pajenegod,2019-08-05], [user:aryaman,2019-08-05], [user:keima915,2019-08-05], [user:chilli,2019-08-05], [user:c1729,2019-08-05], [user:cfalas,2019-08-05] and [user:mblazev,2019-08-05]. Source code is avaliable on [github](https://github.com/cheran-senthil/TLE). If you would like to try the bot without having to set it up yourself, enter this server: [discord.gg/2CJ6qvY](https://discord.gg/2CJ6qvY). The bot is still work in progress, but it is already 4 months old so it can already do quite a few cool things. Here is a showcase of a subset of its features: - It can plot rating distribution of either active or all codeforces users, in either normal or log scale, who have competed at least n times. For example, `;plot cfdistrib normal active 5` gives: <...
It also has a set of commands which we refer to as "gitgud". They are `;gitgud `, `;gotgud`, `;nogud

Полный текст и комментарии »

  • Проголосовать: нравится
  • +225
  • Проголосовать: не нравится

136.
Автор ko_osaga, история, 4 года назад, По-английски
[Tutorial] On Range LIS Queries, Part 1 Hello, Codeforces! At some point of life you want to make a new data structure problem with short statement and genius solution. LIS (Longest Increasing Subsequence) is a classic problem with beautiful solution, so you come up with the following problem: * Given a sequence $A$ of length $N$ and Q queries $1 \le i \le j \le N$, compute the length of Longest Increasing Subsequence of $A[i], A[i + 1], \ldots, A[j]$. But on the other hand this looks impossible to solve, and you just give up the idea. I always thought that the above problem is unsolved (and might be impossible), but very recently I learned that such queries are **solvable** in only $O(N \log^2 N + Q \log N)$ time, not involving any sqrts! The [original paper](https://arxiv.org/abs/0707.3619) describes this technique as *semi-local string comparison*. The paper is incredibly long and uses tons of scary math terminology, but I think I found a relatively easier way to describe this technique, which I will show in t...
**Proof.** Min-plus matrix multiplication is associative just like normal matrix multiplication, But on the other hand this looks impossible to solve, and you just give up the idea.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +372
  • Проголосовать: не нравится

137.
Автор Errichto, 8 лет назад, По-английски
Lecture #3 — Exchange arguments (sorting with dp) Hi. I'm back from USA! I will do a new lecture tomorrow (Thursday) at 2pm CEST on my Youtube channel: [https://www.youtube.com/watch?v=7hFWrKa6yRM](https://www.youtube.com/watch?v=7hFWrKa6yRM). Watch me live (and ask questions), or just watch the video later. This will be part 1, and I will do part 2 in a few days (maybe Tuesday). **UPDATE** &mdash; part 2 is coming on Thursday, same time. Link: [https://www.youtube.com/watch?v=gXxu-Cr4b4c](https://www.youtube.com/watch?v=gXxu-Cr4b4c). There are no prerequisites this time. I recommend reading the materials below in advance, and trying to solve problems 1 and 5. If you are strong, just read problems and see if you can't solve something (maybe problem 8?). ### Technique "Exchange Arguments" If we're given $n$ items and we should choose some of them and choose their order, we should sort them with some strange/tricky comparator, and then do $O(N^2)$ dynamic programming. The dp should be $dp[pref][used]$ &mdash; best po...
questions), or just watch the video later. This will be part 1, and I will do part 2 in a few days, trying to solve problems 1 and 5. If you are strong, just read problems and see if you can't solve, "Strange/tricky comparator" checks which of the two elements should be earlier, usuallyjust

Полный текст и комментарии »

  • Проголосовать: нравится
  • +478
  • Проголосовать: не нравится

138.
Автор chromate00, 22 месяца назад, По-английски
Codeforces Round 1000 (Div. 2) Hello Codeforces, and the legends of across $999$ and more rounds! ------------------------------------------------------------------ --- [user:wuhudsm,2024-12-25], [user:Yugandhar_Master,2025-01-15], and I are *beyond excited* to invite you to [contest:2063] at [contest_time:2063]. <b style="color:red;">Please note the unusual time of the round ($\color{red}{2.5}$ hours before the usual time)!</b> The contest contains $6$ carefully crafted tasks, one of them divided into two subtasks, to be solved in $2$ hours. You will solve tasks themed around Little John and his shenanigans aimed towards getting his own dream home (featuring, probably, galvanized square steel). This round could not exist without the thankful help of these so many people: - ~FairyWinx,2025-01-15 for <strike>rejecting more tasks than are used in the final problemset,</strike> coordinating the round and translating the problems; - ~rewhile,2025-01-15 for some very important "technical assistance"; - ...
— the first of its kind for Div.2! Please kindly take a look if you have some free time or arejust

Полный текст и комментарии »

  • Проголосовать: нравится
  • +679
  • Проголосовать: не нравится

139.
Автор ace5, 3 года назад, По-русски
It's unfair Today I got this message: <spoiler summary="Spoiler"> ![ ](/predownloaded/0a/0b/0a0bd878d9a61bd3ad9c646d5adddf6612a0ad51.png) </spoiler> When looking at the solutions of the listed participants on the problem [1951B](https://codeforces.me/contest/1951/problem/B) I saw that all these solutions completely (or with a change of variables) same as mine, so it's not just a coincidence, solutions copied from mine. Since I didn't give my solution to anyone, and didn't keep the code publicly available, this could only happen if one of the participants blocked this task, copied my code, and sent it to the others. Indeed, it turns out that in my room only one participant blocked task B &mdash; [user:_Untrackable_,2024-04-12](the nickname speaks for itself). He blocked this task at 1:44, and if you look at the submissions of participants from the list, you can see that many of them earlier sent code for this task that was completely different from mine (some even in other languages!), ...
) same as mine, so it's not just a coincidence, solutions copied from mine. Since I didn't give my

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1054
  • Проголосовать: не нравится

140.
Автор Errichto, 4 года назад, По-английски
Huawei IOI Camp 2022 Hi. I'm organizing an online IOI-preparation camp in collaboration with Huawei. Every day will be a 5-hour virtual contest, then my problem analysis, and sometimes a lecture. There will be at least 4 contests and 2 lectures. We will do some old IOI contests (2013?) from the [IOI archive](https://codeforces.me/blog/entry/104593), CEOI (2015-2016?), or maybe JOI/JOISC &mdash; to be decided this weekend. I don't want to do recent years like 2021 because most participants already covered it. The example lecture topics are those from Range Queries or Trees in [Usaco Guide Platinum](https://usaco.guide/plat). The camp is free for IOI 2022 participants. For everybody else, the video recordings will be posted on Youtube after the camp. By participating you get the live experience (Discord, asking questions, competing with others, leaderboards). **Dates**: 25.07-2.08 (updated) **Time** of every analysis/lecture: [14:00 UTC / 16:00 CEST](https://www.timeanddate.com/worldclock...
If you're a country team-leader, you can register a few extra students and just pay me. I will

Полный текст и комментарии »

  • Проголосовать: нравится
  • +448
  • Проголосовать: не нравится

141.
Автор Geothermal, история, 3 года назад, По-английски
Four Proposals Regarding FSTs While I very much enjoy Codeforces rounds overall, FSTs are by far my least favorite part of the Codeforces contest format. There are two reasons I dislike contests with weak pretests. The first is stylistic: I don't care very much about penalizing people who don't rigorously prove their solutions before submitting (which is the main justification for having weak pretests) and I think it's essentially impossible to FST these solutions without more frequently FSTing contestants who make minor mistakes in their code. (The vast majority of my FSTs are due to this sort of minor glitch rather than an error in the underlying idea). The second is that FSTs introduce an element of hidden information to Codeforces rounds. During a contest, you have no way of knowing whether the authors have written strong pretests. If you act as though the pretests are weak, you will be at a disadvantage if pretests are actually strong (because if you knew pretests are strong, you could have e.g. submit...
by the contest coordinator (and if possible, these problems should just have pretests = systests).

Полный текст и комментарии »

  • Проголосовать: нравится
  • +502
  • Проголосовать: не нравится

142.
Автор MikeMirzayanov, 3 года назад, По-английски
Polygon: Warnings for Packages — Incomplete Tests + Statement/Validator Mismatches Hello, Codeforces! If you're developing problems in Polygon, you might like this image to attract attention. <center> <img src="/predownloaded/b4/b6/b4b6e46dd5811c89440ee98bce405e54e3b905c6.png"/> </center> <i>For the new members of the community, I would like to remind you that Polygon (https://polygon.codeforces.com/) is a system developed and maintained by Codeforces for preparing programming problems. It is there that authors and coordinators develop all the problems for the rounds. Moreover, I believe a significant (large?) portion of the problems for other competitions is also developed there: various stages of ICPC, national competitions of different levels, educational problems for various courses, etc. <b>In 2023, more than 50000 problems were prepared in Polygon (only those for which a package was compiled are counted)!</b></i> We often implement such improvements in Polygon that make the process of preparing a problem more reliable. These often include var...
absolutely irrelevant. In any other case, just add a test of the required type, and this will make

Полный текст и комментарии »

  • Проголосовать: нравится
  • +733
  • Проголосовать: не нравится

143.
Автор MikeMirzayanov, 8 лет назад, По-русски
Codeforces: Results of 2018 Hi Codeforces! February 2019 is already on the calendar, which means that I was late with the report for 2018. Better late than never! Let's remember last year. In 2018, [user:_kun_,2019-02-05], [user:300iq,2019-02-05] and [user:arsijo,2019-02-05] joined the team of coordinators. The work of the coordinators is headed (and is the coordinator of the coordinators) [user:KAN,2019-02-05]. I really hope that a more measured schedule of preparing rounds by a large team of coordinators will give a better insight into the contests. The main innovations in the platform are implemented by me and the developers [user:kuviman,2019-02-05], [user:fcspartakm,2019-02-05], [user:MaximShipko,2019-02-05]. Great work on the organization of events and prizes mailing was done by [user:gKseni,2019-02-05]. Special thanks to the writers of the problems and testers. It is your content that charges the community with life and unites all of us. Thank you for the problems! And now let's summarize...
, the growth of key indicators hints that the end of 2018 could be celebrated bigger.Just look at

Полный текст и комментарии »

  • Проголосовать: нравится
  • +871
  • Проголосовать: не нравится

144.
Автор Radewoosh, история, 8 лет назад, По-английски
Should I start writing regular blogs? Hello codeforces! I want to share my idea with you. I've noticed that I know some nice tricks and some tasks with very educative solutions, which might be interesting, surprising or useful in other tasks. Recently I am considering starting my own blog, where I'd share chosen tasks with you and write about possible ways to solve them. I wanted to ask the community about it, cause I don't want you to hate this idea and write comments like "boooo, we already have Petr's blog, you are just copying his idea, you just want contribution, you are next [user:Swistakk,2018-08-12], go away". What do you think about this idea? I'd be able to change form of this blog as you wish and add additional sections. Should I write such blogs?
already have Petr's blog, you are just copying his idea, you just want contribution, you are next, you to hate this idea and write comments like "boooo, we already have Petr's blog, you arejust

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1083
  • Проголосовать: не нравится

145.
Автор codetiger927, история, 5 лет назад, По-английски
Introducing CF Stonks — A Virtual Stock Market Based on Your CodeForces Rating! **2/11/2023 Update**: There had been a month-long hiatus due to the CF name change magic (and my own laziness oops), but everything has been fixed now :D! However, I know a lot of people have gone inactive due to the month-long market closure, so I am hoping to **relaunch StonksCF** in the near future with some new mechanisms (dividends, automatic algorithm trading, etc.). Let me know if you have any ideas! In the meantime, feel free to continue exploiting the way-over-inflated economy and embrace your inner capitalism >:D **Final Update**: We now have our own **DISCORD SERVER**. Join us for the latest information and engage with the community at [https://discord.gg/AeH2GTwkF5](https://discord.gg/AeH2GTwkF5) All the announcements will be there instead of on this page Greetings Fellow CodeForces users! I am proud to introduce my latest project, [CF Stonks](https://codetiger.me/project/StonksCF) (aka StonksCF), which is a virtual stock market based on your CodeForces rating. ...
though this is just a game, you can use the website as a source of motivation since people depend on you

Полный текст и комментарии »

  • Проголосовать: нравится
  • +711
  • Проголосовать: не нравится

146.
Автор maomao90, 2 года назад, По-английски
Meta Hacker Cup... Why must you be so special?? _Disclaimer: This is a rant about Meta Hacker Cup and may not contain any useful information._ Meta Hacker Cup is one of the biggest annual programming competitions, but it has the strangest submission format, unlike any other online judge. Why does it have to be so different? Let’s take a look at how Meta Hacker Cup 2024 Round 1 went for [user:maomao90,2024-10-06] > The time now is 1:00 AM in Singapore. The contest starts, and maomao90 begins solving the problems. > The time now is 1:41 AM. maomao90 has solved problems A, B, and C without much trouble and starts working on problem D. After quickly coming up with a theoretical solution, maomao90 begins coding. > The time now is 2:05 AM. The code is ready and passes the sample tests. maomao90 proceeds to validate the solution. > The time now is 2:06 AM. Validation passes, and the input zip file is downloaded. > The time now is 2:07 AM. maomao90 runs the code on the final test. ![Image showing assertion failed](https...
does Meta Hacker Cup limit participants to just one try?

Полный текст и комментарии »

  • Проголосовать: нравится
  • +510
  • Проголосовать: не нравится

147.
Автор rembocoder, история, 5 лет назад, перевод, По-русски
Сompetitive programming tutoring – help me fulfil my dream Hi, everyone! My name is Aleksandr Mokin. I've been teaching competitive programming for 3 years as my main job. I was a winner of the All-Russian Olympiad in Informatics in 2012, an awardee in 2011 and 2013. In 2018 I became a finalist of the ICPC world programming championship. In 2019 I started teaching and have helped dozens of people to make progress and reach their goals ([see people's feedback](https://profi.ru/profile/MokinAB/)). Since then I've developed my own approach. I don't just guide people through notorious algorithms, but also teach concrete techniques on how to solve real problems and quickly write a working code. Now I've decided to try bringing it to another level. I want to reach the worldwide audience: feel free contacting me on [Facebook](https://www.facebook.com/rembocoder/), [Telegram](https://t.me/rembocoder), private messages or e-mail: [[email protected]](mailto:[email protected]). My base rate is **$50/h**. If I get enough feedback, I p...
approach. I don't just guide people through notorious algorithms, but also teach concrete techniques on

Полный текст и комментарии »

  • Проголосовать: нравится
  • +924
  • Проголосовать: не нравится

148.
Автор Sharon, история, 8 лет назад, По-английски
I am removing my contest proposal from Codeforces I am removing my contest proposal from Codeforces. Note: This is a serious blog post. Also, the opinions presented in this blog are my own and not of my friend [user:BiIIy,2018-12-26] who wrote the contest with me. Today I have removed my contest proposal from Codeforces. I should probably have done this a long time ago. The proposal was made in February, but the problems were written and finished by March, and that is when I opened the contest proposal for review and messaged [user:KAN,2018-12-26]. It is currently December and no progress or development has been made regarding my contest proposal since, so I will be removing it. I have multiple reasons for removing my contest proposal: - I have no motivation to host an online contest anymore. - I am involved in problem setting with two other high school programming contests in my university, and I write, host, and judge another contest for local high schools. - I have forgotten that I “was in the queue” for writing a...
- November 7th, [I get a comment on (just) one of the problems](https://i.imgur.com/XpxS6Tt.png

Полный текст и комментарии »

  • Проголосовать: нравится
  • +830
  • Проголосовать: не нравится

149.
Автор lior5654, 5 лет назад, По-английски
[Tutorial] Solving a 3300 | Codeforces Round #773 (Div. 1) Problem E — Special Positions Hello Codeforces! (Long Post!) Introduction ------------------ As I've recently solved my first ever $\ge$ 3000 rated problem (3300) on Codeforces &mdash; [Codeforces Round #773 (Div. 1) Problem E &mdash; Special Positions](https://codeforces.me/problemset/problem/1641/E) and the solution that I came up with is different than the one presented in the official editorial, I thought that it will be valuable to the community if I share my approach. ![ ](https://i.imgur.com/toIoJG4.jpeg) Note that problem solving is a complicated & creative process. In the editorial, I show clean steps to reach the final solution, but the jump between each step is not always trivial (and sometimes hard!). Reaching this solution involved a large amount of drawings, observations, calculations & mistakes. There's no magic trick (at least to my knowledge :) ). Alright, enough introduction, let's get started! (click "The Editorial" below this line in order to be able to view the editorial) ...
3. gitgud

Полный текст и комментарии »

  • Проголосовать: нравится
  • +123
  • Проголосовать: не нравится

150.
Автор kpw29, 6 лет назад, По-английски
Meet IT Codeforces Round Editorial Thank you very much for taking part in the contest! <spoiler summary="Contest timeline"> - -0:05. Starting the chat with the Questions Answering team: [user:tnowak,2020-11-15] and our beloved coordinator [user:antontrygubO_o,2020-11-15]. We hope that there won't be that many questions :) - -0:01. One minute to go! I hope that everything goes smoothly. I'm so afraid of posting the editorial accidentally that I moved this timeline into another blog... - 0:01. First blood in Div2! Congratulations to [user:majorro,2020-11-15]!. - 0:03. First blood in Div1 as well! Congratulations to [user:Errichto,2020-11-15], your knapsack is ready for a journey to win! - 0:04. [user:Sho10,2020-11-15] first to solve Div2B. Well done! - 0:05. We also have the first question. So far so good... - 0:06. [user:Um_nik,2020-11-15] gets the first pretests pass in Div1B. The cheaters are caught! - 0:09. [user:bandiaoz,2020-11-15] packs the first Knapsack in Div2! A difficulty spike is coming... - 0:12....
necessary to code a working solution (one can just check if there's a cheap move at the beginning,just

Полный текст и комментарии »

  • Проголосовать: нравится
  • +515
  • Проголосовать: не нравится

151.
Автор -is-this-fft-, история, 5 лет назад, По-английски
[Tutorial] The command line: how to read input from file without #ifdef and much more #### Introduction Instead of algorithms and math, I'll be doing something completely different here. There is something that has bothered me for a long time: people not understanding the tools they use to participate in contests and thus failing to take real advantage of them. And it all goes back to not understanding the command line. Some of you might say, "well surely, the command line is something obsolete and you're only clinging to it because you [insert ridiculous amateur-psychology here]?" No! The command line is not obsolete, and unless competitive programming becomes so mainstream that software vendors start writing professional-grade tools aimed specifically at us, it won't be. [cut] $~$ What is the command line? Any of these: ![ ](/predownloaded/bd/b6/bdb6c157b9b3ce5ae046c9064e469e0081f8c0fe.png) As you can see, it comes in many background colors and fonts, but the basic idea is always the same. It's a box you can type commands in, which it will ...
can, you may also just copy someone else's solution), just say that this is just how it is.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +443
  • Проголосовать: не нравится

152.
Автор Vladosiya, история, 9 месяцев назад, По-английски
Why we won't revoke AhmetKaan ban Hello, Codeforces! The situation involving [user:AhmetKaan,2026-03-11] has generated some discussion. I would like to summarize the information we have reviewed and explain the reasoning behind our final decision. #### About evidence First of all, it is important to note that we cannot have absolute proof in such cases. We cannot see private conversations with AI tools, chats with other people, or other external sources of help. The only reliable data available to us are the submissions. Because of this limitation, some decisions are based on some red flags we see rather than a single definitive proof. If we do not act this way, we will get overwhelmed by a wave of cheaters. Therefore, we believe this is the only effective way to respond to the recent increase in cheating. After the appeal, we reviewed the case and collected the following observations. #### 1. Codeforces Round 1085 - The submissions [submission:365891594], [submission:365892799], [submission:365894412] ...
Additionally, there are several more cheating cases from the past we just found:

Полный текст и комментарии »

  • Проголосовать: нравится
  • +483
  • Проголосовать: не нравится

153.
Автор errorgorn, 6 лет назад, По-английски
Tutorial on Permutation Tree (析合树) So my O level Chinese exam is in 2 days so I decided to learn a data structure that I can only find [resources](https://oi-wiki.org/ds/divide-combine/) for in Chinese. I thought I might as well write a tutorial in English. This data structure is called 析合树, directly translated is cut join tree, but I think permutation tree is a better name. Honestly, after learning about it, it seems like a very niche data structure with very limited uses, but anyways here is the tutorial on it. Thanks to [user:dantoh,2020-06-16] and [user:oolimry,2020-06-16] for helping me proofread. ### Motivation Consider this [problem](https://codeforces.me/contest/526/problem/F). We are given a permutation,$P$ of length $n$. A good range is a contiguous subsequence such that $\max\limits_{l \leq i \leq r} P_i - \min\limits_{l \leq i \leq r} P_i = r-l$. This can be thought of the number of contiguous subsequence such that when we sort the numbers in this subsequence, we get contiguous values. Count the...
described earlier. Every time we insert a new value, we just need to count the number of values which are

Полный текст и комментарии »

  • Проголосовать: нравится
  • +448
  • Проголосовать: не нравится

154.
Автор chromate00, 22 месяца назад, По-английски
Codeforces Round 1000 (Div. 2) — Anti-LLM Evaluation Report As the main problemsetter of [contest:2063], I know that a lot of you were somewhat disappointed to see that it was not a Div.1 contest. Though I am not the one who caused a lack of Div.1 contests, I understand your feeling. So I present to you the great surprise: The **Anti-LLM Evaluation Report** for [contest:2063], the first of its kind on a Div.2! In this blog we discuss about how the round combats against LLMs (especially focusing on OpenAI o1, the greatest of its kind while we prepared and tested the problemset), by looking at the timeline of how the problemset changed. --- So, let us begin with the initial problemset we had when the testing began. (The task names are anonymized, unless they are released to the public before or in the round) In the beginning, we had a problemset that looks like this: - **A' &mdash; B &mdash; C0 &mdash; D' &mdash; E' &mdash; F0** (If you are confused with the meanings, (letter)' means it was not used in the final problemset but exis...
- After this, I just changed A'' to **A**, which was much easier than A'' for humans. It **is

Полный текст и комментарии »

  • Проголосовать: нравится
  • +587
  • Проголосовать: не нравится

155.
Автор antontrygubO_o, 7 лет назад, По-английски
Are subtasks evil? Everything in this blog is only my opinion, motivated by the recent round. If you disagree with it, let's discuss in the comments! It's always hard to prepare a balanced problem set, and when the contest turns out to be unbalanced, an army of angry coders will destroy you in the comments section. But how can setters make Codeforces contests balanced? Before, authors usually had to spend more time coming up with new problems which would close a too large gap between some $2$ problems. But now we have an easier solution! Any time there is a big difficulty gap in a contest, add subtasks to it! [View](https://codeforces.me/blog/entry/67810?#comment-520212) on subtasks by [user:MikeMirzayanov,2019-11-24]: Subtasks became really widely used in Codeforces contests recently. I looked at last $30$ contests rated for Div1 users. In turns out that: Rounds $30 - 21$ had only $1$ subtasks in total, Rounds $20 - 11$ had $3$ subtasks in total, The last $10$ rounds already had $7...
**2. The strategy of solving the easy subtask before trying hard gives more points thanjust, just **nothing** good about this problem. It's clear that it was created just for balance, and it's

Полный текст и комментарии »

  • Проголосовать: нравится
  • +487
  • Проголосовать: не нравится

156.
Автор galen_colin, 3 года назад, По-английски
WF23 Luxor _(Long blog ahead. Reader discretion advised.)_ I feel we have a rather interesting WF story (note: we did the 47th finals, as the University of Maryland, <b><i>as 2 people</i></b>... explained below), so I figured I'd tell it. Exposition ---------- It actually starts way before WF, too. Our teams were decided on (some form of) merit based on an internal qualifier. My team for the regional and NAC (North America superregional) ended up as {me, [user:Navick,2024-04-24], [user:mr.banana,2024-04-24]}. We did [fairly](https://nasouth22d1.kattis.com/contests/nasouth22d1/standings) [well](https://nac.icpc.global/wp-content/uploads/2023/06/NAC23-scoreboard.pdf) in those. However, for WF, my two teammates only had single-entry visas for the US, meaning that if they left, they couldn't come back into our country. So they couldn't really go with me... Luckily, in such situations, ICPC lets you just replace your teammates. So we held another internal qualifier, and ended up with two ...
sure enough, that was a **10x** speedup. So I guess that just worked... really well. I boosted the

Полный текст и комментарии »

  • Проголосовать: нравится
  • +457
  • Проголосовать: не нравится

157.
Автор Zhtluo, история, 3 года назад, По-английски
All You Need is Randomly Guessing — How to Improve at Codeforces I hope [my previous blog](https://codeforces.me/blog/entry/126310) has convinced you that the best way to improve at Codeforces is to be more Russian, i.e. to improve your math capability. Unfortunately, humble mortals such as you and I are not gifted with the talent that esteemed Russian grandmasters such as 74TrAkToR had: _Surely, it is beneficial to have a code reference for many algorithms and data structures, but I also think that just superficially knowing the algorithm and maybe having implemented it once or twice before is sufficient to use it without a reference?_ _&mdash; Some other Codeforces grandmaster_ Therefore, in this blog I will explore the dark side of Russian-ness &mdash; randomly guessing &mdash; that is forsaken by every Russian grandmaster of the light side I know. However, it has been very helpful to me, and I hope that it serves you well, too. ## Example 1 I will start by using an example to demonstrate my thought process. This problem [1923C](h...
Now just start coding...

Полный текст и комментарии »

  • Проголосовать: нравится
  • +431
  • Проголосовать: не нравится

158.
Автор viktork, 12 лет назад, По-русски
ZeptoLab Code Rush 2015 Hello, Codeforces! <b><i>The problems were suggested by users [user:roosephu,2015-04-04] and [user:sunayuki,2015-04-04]. The great help in preparing was provided by [user:Aksenov239,2015-04-04], [user:GlebsHP,2015-04-04] and Codeforces team. ZeptoLab Team did its best while working on statements.</i></b> <b><i>The round will use smoother dynamic problem scores with 250 points steps.</i></b> In 2014 we hosted our [first programming contest](/zeptolab2014) together with Codeforces, and we liked it! Let me shortly remind you how it was. The contest consisted of 6 problems, 2.5 hours were given to solve (you can have a look at the problems of the previous year and try to solve them [here](/contest/436)). Of course, even on a purely coding event we stayed true to ourselves, so all problems were designed based on our games, and, of course, we illustrated them with care: <center> <img src="http://assets.codeforces.com/images/zepto2015/pics2014.jpg"/> </center> Zepto C...
[Somebody](/profile/WhiteCrow) got even luckier: they stayed for more than just a tour and they

Полный текст и комментарии »

  • Проголосовать: нравится
  • +886
  • Проголосовать: не нравится

159.
Автор ArshiaDadras, 2 года назад, По-английски
Rayan 2024 Selection Round (Div. 1 + Div. 2, Rated, Prizes!) &#128075; Salam, Codeforces! ------------------ <img src="/predownloaded/10/20/1020443c4ada8a8d0aeaa46f6dd4a34120fe8030.png" style="width: 30.0%;float: right;margin: 0 0.5em 0.5em 0.5em;max-width: 100.0%;max-height: 100.0%;"> We are thrilled to invite you to the [contest:2034]. The **Selection Round** is a rated contest for Div. 1 + Div. 2, taking place on [contest_time:2034]. The problems for this round were crafted and prepared by [user:ArshiaDadras,2024-11-19], [user:MohammadParsaElahimanesh,2024-11-19], [user:AmShZ,2024-11-19], [user:AmirrzwM,2024-11-19], and [user:Keshi,2024-11-19]. The **top 60 trusted participants** (with a maximum of three from each country) will qualify for the onsite **Final Round** in Tehran, in Spring 2025. An additional quota is reserved for the host country. Hotel accommodation, local transportation, and meals will be provided to all finalists. More details about the final contest will be available on the [Rayan](https://rayan.global/) website. ...
**📝 Note:** Editorial just published [here!](https://codeforces.me/blog/entry/136579

Полный текст и комментарии »

  • Проголосовать: нравится
  • +546
  • Проголосовать: не нравится

160.
Автор PrinceOfPersia, 12 лет назад, По-английски
Codeforces Round #305 Codeforces round #305 is gonna take place [soon](http://timeanddate.com/worldclock/fixedtime.html?day=26&month=5&year=2015&hour=19&min=30&sec=0&p1=166) and I'm the writer. After my previous contest that many people think it was a hard contest, I prepared an easy contest to cheer you up! I want to thank [user:Haghani,2015-05-18] for testing this round, [user:Zlobober,2015-05-18] for help me prepare this round and his great advises, [user:Delinur,2015-05-20] for translating problem statements into Russian, [user:mruxim,2015-05-18] and Yasser Ahmadi Phoulady (Rasta) for their advises and ideas, [user:Swift,2015-05-18] for helping me choose legends and graphics and [user:MikeMirzayanov,2015-05-18] for great Codeforces and Polygon platform and guys from Physics Olympiad that kept disturbing me while preparing this round. This is my second official round and I hope you enjoy it. The main character of this round is gonna be Mike (I didn't say [user:MikeMirzayanov,2015-05-18] :D). ...
**UPD3:** Contest has just ended. You can find the editorial [here](/blog/entry/18126).

Полный текст и комментарии »

  • Проголосовать: нравится
  • +622
  • Проголосовать: не нравится

161.
Автор Qingyu, 21 месяц назад, По-английски
The 2025 Universal Cup Finals — Wrap up We are excited to share that The 2025 Universal Cup Finals just successfully wrapped up in Dongguan, China! <center> <img src="/predownloaded/cf/81/cf81069734f8d9b6e994f27c84e2781ccbe20c38.jpg"> </center> What a wonderful week! In our five-day event, participants went to the city tour of Guangzhou, competed in the Challenge session, participated in the Conference for Competitive Programmers, and most importantly, our main competition &mdash; The 2nd Universal Cup Finals! <div class="row"> <img src="/predownloaded/f5/d8/f5d8cd3b6264dfe7de13433662a7a1fbe61293f0.jpg" style="height: 262.0px;max-width: 100.0%;max-height: 100.0%;"> <img src="/predownloaded/cb/40/cb4020f1b2f88fc7cd7e40f11ccda90c88df26ba.jpg" style="height: 262.0px;max-width: 100.0%;max-height: 100.0%;"> </div> <div class="row"> <img src="/predownloaded/88/82/88820a183af6e038ba219c5887674276cd29322d.jpg" style="height: 262.0px;max-width: 100.0%;max-height: 100.0%;"> <img src="/predownloaded/8d/ab/8daba...
We are excited to share that The 2025 Universal Cup Finals just successfully wrapped up in Dongguan

Полный текст и комментарии »

  • Проголосовать: нравится
  • +380
  • Проголосовать: не нравится

162.
Автор MikeMirzayanov, 6 лет назад, По-английски
Codeforces: Results of 2020 [Annual Report] Hi Codeforces! Yes, I know it's already April. Time flies so fast lately! Exactly a year ago we were just learning all the "delights" of lockdown. So let's remember this 2020! What was it like? I don't know about you, but we had a hell of a lot of work. I will now show you some graphs and you will be very surprised. Lockdown effect? Of course, but we did our best too. Many thanks to everyone who did not stand aside! In 2020, we celebrated our 10th anniversary and crowdfunding money helps us grow and move forward. You helped us and each other. Thank you. <a href="https://codeforces.me/10years/supporters">Thank you for your contribution!</a> We've been working hard all year to make this community a better place. Did it work out? It's up to you to judge. Many thanks to everyone who invested time and effort: * [user:geranazavr555,2021-04-09], [user:kuviman,2021-04-09], [user:cannor147,2021-04-09] helped a lot with development and new features; * [user:Una_Shem,2021-...
Yes, I know it's already April. Time flies so fast lately! Exactly a year ago we werejust learning

Полный текст и комментарии »

  • Проголосовать: нравится
  • +612
  • Проголосовать: не нравится

163.
Автор ko_osaga, история, 7 лет назад, По-английски
Story about edge coloring of graph You are given a graph $G$, and for each vertex $v$ you have to assign a positive integer **color** such that every adjacent pair of vertices (vertices directly connected by edge) have different color assigned. You have to minimize the maximum color assigned: In other words, you have to minimize the number of distinct assigned colors. But that's [graph coloring](https://en.wikipedia.org/wiki/Graph_coloring) (vertex coloring). It's hard. Ok, one more time: You are given a graph $G$, and for each **edge** $e$ you have to assign a positive integer **color** such that every adjacent pair of edges (edges sharing same endpoints) have different color assigned. You have to minimize the maximum color assigned: In other words, you have to minimize the number of distinct assigned colors. This is the edge coloring of graph, and I will talk about this now. *Note that this can be interpreted as "graph coloring (vertex coloring) of line graphs". In that sense, you can consider in a similar...
/graph_etc/edgecolor_vizing.cpp). Sometimes, people asks you to solve [just that exact same problem

Полный текст и комментарии »

  • Проголосовать: нравится
  • +361
  • Проголосовать: не нравится

164.
Автор kostka, 2 года назад, По-английски
Congratulations to the winners of the 2nd Universal Cup Semifinal! We’re excited to share that the **Universal Cup Summer Summit 2024**, sponsored by Huawei, just wrapped up in the beautiful Cancun, Mexico! ![ ](/predownloaded/2d/b9/2db998d0e500754097aab836010f4a903bf26bcf.jpg) ![ ](/predownloaded/d5/5f/d55f2cb20af1268fbb49cfde93c34a84fc93121d.jpg) ![ ](/predownloaded/8c/9b/8c9bda7ee471605ce6af0e80da5c9b979fd7d07e.jpg) The highlight of the event was the 2nd Universal Cup Semifinal, where 200 teams competed both onsite and online. A huge shoutout to all our onsite teams: **Gold Medal** * USA1 ([user:ecnerwala,2024-06-25], [user:ksun48,2024-06-25], [user:tourist,2024-06-25]) **Silver Medal** * Polish Mafia ([user:Swistakk,2024-06-25], [user:Radewoosh,2024-06-25], [user:Marcin_smu,2024-06-25]) **Bronze Medal** * HoMaMaOvO ([user:maroonrk,2024-06-25], [user:maspy,2024-06-25], [user:hos.lyric,2024-06-25]) **Honourable Mention** * 03 Slimes ([user:orzdevinwang,2024-06-25], [user:Rewinding,2024-06-25], [user:TLE,2024-06-25...
We’re excited to share that the **Universal Cup Summer Summit 2024**, sponsored by Huawei,just

Полный текст и комментарии »

  • Проголосовать: нравится
  • +411
  • Проголосовать: не нравится

165.
Автор Radewoosh, история, 6 лет назад, По-английски
Asking for help with problems from running contests - what's wrong with people? As you may know, Codechef long challenge is currently running. After the first one, I thought that I should just ignore it, but I've received a second ask for help with a problem from this contest... ![ ](https://i.ibb.co/mX65qTQ/cheat.png) Probably I'm not the only one being asked and that there may be more questions in the future. I'm always surprised by such questions. If you don't know how to solve a problem and you want to be able to solve it someday, then trying to cheat definitely won't make you such a person. What's their motivation if not just solving the problem (which makes no sense, because in this way you should just want to get better)? A bet with friends? Asking random people who are able to tell admins about this question is not a good idea then. Wanting to get a higher rating? Also stupid, you shouldn't get a rating to show that you are good, you should be good to show that you are able to get a rating. Also, note that one of them was saying that he didn't ask...
Should I show their nicknames? Should just this blog and discussion be a way to show them that they

Полный текст и комментарии »

  • Проголосовать: нравится
  • +556
  • Проголосовать: не нравится

166.
Автор DanAlex, история, 11 лет назад, По-английски
How to sweep like a Sir ### Cutting to the chase Clearly you don't need a PhD in Computing to sweep in the yard , but one might be useful in order to know linear and radial sweep algorithms. So , what's all about ? It's just what it sounds it is , sweeping linear ( up to down , for example ) or radial ( making a 360 degrees loop ). How this can help? [cut] Well... ### Linear sweep Suppose you a set of objects in an Euclidean plane. We need to extract information about some objects. The method of linear sweeping takes a line and moves it on a fixed direction. Usually the line taken would be vertical and the direction would be left to right or up to down. ![ ](https://upload.wikimedia.org/wikipedia/commons/2/25/Fortunes-algorithm.gif) Quite abstract for the moment , huh ? Let's go to a more specific example. #### Rectangle union area This example is well known. You have a set of rectangles with edges parallel to the OX and OY axes. What is their union area. Well , first of all , let'...
to know linear and radial sweep algorithms. So , what's all about ? It's just what it sounds it is

Полный текст и комментарии »

  • Проголосовать: нравится
  • +640
  • Проголосовать: не нравится

167.
Автор -is-this-fft-, история, 4 года назад, По-английски
[Tutorial] FFT If I was a YouTuber, this would be the place where I fill the entire screen with screenshots of people asking me to make this. Anyway, not so long ago I gave a lecture on FFT and now [user:peltorator,2023-01-11] is giving away [free money](https://codeforces.me/blog/entry/110840), so let's bring this meme to completion. In this blog, I am going to cover the basic theory and (competitive programming related) applications of FFT. There is a long list of generalizations and weird applications and implementation details that make it faster. Maybe at some point I'll write about them. For now, let's stick to the basics. **The problem.** Given two arrays $a$ and $b$, both of length $n$. You want to quickly and efficiently calculate another array $c$ (of length $2n - 1$), defined by the following formula. $$c_k = \displaystyle \sum_{i + j = k} a_i \cdot b_j.$$ Solve it in $O(n \log n)$. First of all, why should you care? Because this kind of expression comes up in combinatorics a...
Suppose that the strings just consist of "a" and "b". We show how to

Полный текст и комментарии »

  • Проголосовать: нравится
  • +436
  • Проголосовать: не нравится

168.
Автор Fefer_Ivan, 13 лет назад, По-русски
New year update: Mashup contests Hello, Codeforces. **UPD: Mashup feature is disabled until the end of the round. This is temporary and won't happen in the future.** Today we want to present you with our latest feature: mashup contests. ![ ](http://assets.codeforces.com/images/eng_create_mashup_frame.png) ![ ](http://assets.codeforces.com/images/ded-moroz.jpg) &nbsp;[cut]&nbsp; Such frame is available for all Codeforces users at [Gym](/gyms) page, who took part in at least three official rated Codeforces Rounds. When you press [Create Mashup](/mashup/new) Contest button, you are redirected to (SUDDENLY :) mashup creation page. On this page you can enter contest name and duration and find problems via problem search form. <img style="width: 700px" src="http://assets.codeforces.com/images/eng_edit_mashup_frame.png"/> Problem search form support search by the number of parameters including: - Problem code with format (contest id)(problem index). For example, 123C. - Problem name in both Engl...
If you want to enter not just name, but, for example, description, logo or start time, you can use

Полный текст и комментарии »

  • Проголосовать: нравится
  • +431
  • Проголосовать: не нравится

169.
Автор -is-this-fft-, история, 4 года назад, По-английски
PSA: don't use these functions unless you really, really need to When solving problems in competitive programming, it is almost never a good idea to use the following inbuilt C++ functions. You **will** be hacked or fail a pretest or worse, a systest. Why? Because they use floating-point numbers. They are designed to be used with a floating-point input and a floating-point output. The issue is that on a floating-point number, the result may not be exact. Worse, floating-point numbers may not be able to accurately encode the integer. ##### To calculate $\lfloor \frac{a}{b} \rfloor$ for positive integers $a$ and $b$: * **Don't** use `floor((double) a / (double) b)` or similar. * **Do** use `a / b`. It will round down. * **Warning:** be careful with negative numbers. The answer depends on whether we should round down or towards 0. ##### To calculate $\lceil \frac{a}{b} \rceil$ for positive integers $a$ and $b$: * **Don't** use `ceil((double) a / (double) b)` or similar. * **Do** use `(a + b - 1) / b`. * **Warning:** the same caveat ...
= 1$, in which case you can just return $a$.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +500
  • Проголосовать: не нравится