You can use several words in query to find by all of them at the same time. In addition, if you are lucky search understands word forms and some synonyms. It supports search by title and author. Examples:

  • 305 — search for 305, most probably it will find blogs about the Round 305
  • andrew stankevich contests — search for words "andrew", "stankevich" and "contests" at the same time
  • user:mikemirzayanov title:testlib — search containing "testlib" in title by MikeMirzayanov
  • "vk cup" — use quotes to find phrase as is
  • title:educational — search in title

Results

 
 
 
 
1.
By Radewoosh, history, 4 months ago, In English
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. ...
Also, one last tip: I've noticed it observing all the top people on Codeforces/Atcoder. None

Read more »

 
 
 
 
  • Vote: I like it
  • +1899
  • Vote: I do not like it

 
 
 
 
2.
By Golovanov399, 18 months ago, In English
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...

Read more »

 
 
 
 
  • Vote: I like it
  • +756
  • Vote: I do not like it

 
 
 
 
3.
By zscoder, history, 16 months ago, In English
[Tutorial] Generating Functions in Competitive Programming (Part 1) Hi everyone! Inspired by the recent [Codeforces Round 641](https://codeforces.com/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.com/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...
Tip: Try looking for common sequences and see if you can derive the formula for their OGFs from

Read more »

 
 
 
 
  • Vote: I like it
  • +1297
  • Vote: I do not like it

 
 
 
 
4.
By dutinmeow, history, 5 months ago, In English
Top 5 Optimizations, Tips, and Tricks LGMs Don't Want YOU To Know About ! Hello all! If you're like me and want to become good at coding, but don't want to put in the effort, just follow this simple guide. Guaranteed LGM within 3 weeks or your money back! ### 1. Time Travel Have you heard of using "vectorization" or "pragmas" to allow brute force solutions to pass (from for example, [here](https://codeforces.com/blog/entry/66279))? There's no need to include this rather confusing block of code in your template: there's a much simpler and more effective method ~~~~~ #include <iostream> #include <chrono> #include <thread> int main() { using namespace std::chrono_literals; std::this_thread::sleep_for(-9999999999999ms); } ~~~~~ Sleeping/stalling for a negative amount of time tricks the system into giving you extra time for your submission. Simply using this in front of all your code makes any solution pass (albeit, in a long time). ### 2. Better Hash Current top-rated LGM Benq recommends using the following hash function c...

Read more »

 
 
 
 
  • Vote: I like it
  • +707
  • Vote: I do not like it

 
 
 
 
5.
By parveen1981, history, 4 months ago, In English
I compiled a list of almost all useful blogs ever published on Codeforces [update: till 09.06.2021] <h3 style="color:red">If there are any blogs that I have missed, please tell in the comment section. Thank you.</h3> # Mathematics Stuff - [Number Theory in Competitive Programming [Tutorial]](https://codeforces.com/blog/entry/46620) - [Number of points on Convex hull with lattice points](https://codeforces.com/blog/entry/62183) - [FFT, big modulos, precision errors.](https://codeforces.com/blog/entry/48465) - [Number of ways between two vertices](https://codeforces.com/blog/entry/19078) - [Mathematics For Competitive Programming](https://codeforces.com/blog/entry/76938) - [FFT and NTT](https://codeforces.com/blog/entry/19862) - [Burnside Lemma](https://codeforces.com/blog/entry/51272) - [Number of positive integral solutions of equation 1/x+1/y=1/n!](https://codeforces.com/blog/entry/76836) - [On burnside (again)](https://codeforces.com/blog/entry/64860) - [Simple but often unknown theorems/lemmas/formula? Do you know?](https://codeforces.com/blog/entry/55912) - [Probabili...

Read more »

 
 
 
 
  • Vote: I like it
  • +1500
  • Vote: I do not like it

 
 
 
 
6.
By Tet, 13 months ago, In English
Blog formatting tips Hi everyone! Since a ton of blogs are being posted everyday and let's say not all of them are worth reading ●︿● , I decided to write this blog so that we could agree on some proper formatting or at least get some advice from experienced users. <spoiler summary="this is aimed to be a discussion"> Well, of course as a person who is writing his second blog, I'm not qualified for writing this. </spoiler> Points that I find important while writing a blog ( not that my opinion matters anyway (¬_¬) ): * use: - A proper title (using ["I'm stuck on test 69!!!!"](https://codeforces.com/blog/entry/82183) won't get you anywhere) - Italics for Titles, Foreign Words, and Proper Names. ( _not just for making your text look better_ ) - Simple English ( maybe some users aren't as good as you are ) - Your brain to figure out if your text can be misinterpreted ( [this blog](https://codeforces.com/blog/entry/82177) is a good example ) - A fresh topic as m...

Read more »

 
 
 
 
  • Vote: I like it
  • +207
  • Vote: I do not like it

 
 
 
 
7.
By kfx, history, 6 years ago, In English
Python performance tips Python is a great programming language: simple, expressive, compact. In Codeforces, Python is often the best choice for Div 2 A and B problems. For example, problem [problem:600A] is very easy to write in Python: first tokenize the string with the built-in `split()` function, then try to parse the integers with the built-in `int()`, then output the comma-separated strings of results with `",".join(lst)`. For the more complex problems, writing fast-enough Python code is often a challenge. Here is a list of tips to improve performance. - Use PyPy instead of the standard Python interpreter. According to [20 offical benchmarks](http://speed.pypy.org/) it is on average 7 times faster than Python 2. PyPy2 is in my opinion the best option at the moment for competitive programming. - Append to an existing string with "+=" instead of concatenating **more than two** strings with "+" and storing the result with "=". (With two strings, both ways work fine. `s1 = s1 + s2` is fast becaus...

Read more »

 
 
 
 
  • Vote: I like it
  • +124
  • Vote: I do not like it

 
 
 
 
8.
By unreal.eugene, 4 weeks ago, In English
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 ...

Read more »

 
 
 
 
  • Vote: I like it
  • +1013
  • Vote: I do not like it

 
 
 
 
9.
By rng_58, history, 5 years ago, In English
Tips for writers: What requires a proof? If you are a contestant, you can be relaxed and you can do anything (except for cheating). It's perfectly fine if you just guess the solution and submit it without knowing why (though personally I don't find it very beautiful). However, if you are a writer, you need to prove your solution. Here is the list of things you have to prove: #### 1. Correctness. Does your solution always return correct answers for all possible valid inputs? - GOOD: Strict proof. - BAD: _My intuition tells that this is correct!_ - BAD: _I tried really hard to come up with counterexamples, but I couldn't. It must be correct!_ #### 2. Time Complexity. Does your solution always run in time for all possible valid inputs? - GOOD: It's $O(n^2)$ and the constraints say $n \leq 1000$. It should work. - GOOD: For this problem we can prove that the slowest case is xxx. Experimentally, my solution works for the input xxx under the given TL. - BAD: _I tried really hard to generate various testcases, and ...

Read more »

 
 
 
 
  • Vote: I like it
  • +367
  • Vote: I do not like it

 
 
 
 
10.
By low_, 3 years ago, In English
Codeforces contests performance improving tips ^^ _Recently, I've successfully promoted to become a candidate master on Codeforces, which is one of my target this year. And to celebrate this, here is my first blog on Codeforces._ **Climbing ranks on Codeforces takes time** _(unless if you known the platform and the contests well in the first place)_. During that time, by pushing yourself to climb to your target ratings, you might find out that you learned a lot. E.g.: more efficient coding skills and strategies, more cohesive thinking and more creative algorithms or uses of data structures,.... That's why I always tell myself [cut] that decreasing of ratings is okay, as long as you learned something after _\*that\*_ contest. That's the first tips on climbing: **To have a positive mindset**. I heard some avoids rating decrease by violating contest rules (for example: submitting others' codes) and get a _"skip"_ after the system calculating rating changes. I think this is not showing the sportsmanship and fairness when partici...

Read more »

 
 
 
 
  • Vote: I like it
  • +44
  • Vote: I do not like it

 
 
 
 
11.
By Sammarize, 6 years ago, translation, In English
Short instruction of formulas writing (translation) In this post I want to describe in short how to write a formulas on Codeforces. In fact it is short introduction to the markup language $\TeX$ used on Codeforces. Three important rules. ---------------------- Foremost rule: formula me place in dollars (`$`), as well as in parentheses. Another important rule: if you want to apply some operation to some group of symbols it is necessary to form the block using the curly braces. For instance, `2^x+y` = $2^x+y$, but `2^{x+y}` = $2^{x+y}$. Third rule &mdash; for perfectionists. For traffic economy Codeforces print simple formulas by usually text. Sometimes it is not very pretty: `C_{x_i+y_i-2}^{x_i-1}` = $C_{x_i+y_i-2}^{x_i-1}$. Is this case you can add command `\relax` at the beginning of the formula. Then the formula is guaranteed to be beautiful: `\relax C_{x_i+y_i-2}^{x_i-1}` = $\relax C_{x_i+y_i-2}^{x_i-1}$. Arithmetic operations. ---------------------- Addition and subtraction can be written ordinary symbols + and -. Mu...

Read more »

Tags tex
 
 
 
 
  • Vote: I like it
  • +380
  • Vote: I do not like it

 
 
 
 
12.
By ReaLNero, 14 months ago, In English
Tips on Constructive Algorithms Constructive algorithms are a common sight in both olympiads and online programming contests. If you’re looking for some examples, check out the CodeForces problemset, filtering for “constructive algorithms”. Definition ------------------ What’s a constructive algorithm, exactly? I think it’s most helpful to give an example problem: _Let $1 \leq N \leq 10^5$ and $1 \leq K \leq log_2(N)$ be fixed. Imagine performing a binary search on the values $1...N$. Give a value X, $1 \leq X \leq N$ which would be found in exactly K steps using binary search._ There's a bunch of variations on binary search, so assume I chose a particular one in this example. We’re supposed to generate an example number which satisfies the above condition (found in exactly K steps of a binary search). Of course, contests add parameters to these conditions, so that multiple test cases can be given. In almost all constructive algorithm problems, there are a lot of possible solutions, and usually any ex...

Read more »

 
 
 
 
  • Vote: I like it
  • +59
  • Vote: I do not like it

 
 
 
 
13.
By jjang36524, history, 13 months ago, In English
Tutorial and tips to reach Expert. Before the start of the blog, I'd like to thank [this blog](https://codeforces.com/blog/entry/53341) for motivating me to write it. However, this blog is quite outdated in many factors like the rating system, and people starting cp in 2020 may have trouble following these. Therefore, I would like to write new tips for doing well in codeforces. The goal is getting to expert, or rating 1600. I would write this in 3 steps, but the most important thing here is **Practicing hard**. You won't get to 1600 if you don't practice, you don't have to do it on the blog's way, but you should practice. Step 1: from 1000(grey) to 1200(green) ------------------ First, read [introduction to the new rating system](https://codeforces.com/blog/entry/77890) and judge your skill. Note that you'll need to take part in about 5 contests to judge your skill. If your rating is under 1200, read the next part and practice. If you use div3, you'll need to solve 3 problems in 30 minutes. That means you...

Read more »

 
 
 
 
  • Vote: I like it
  • +28
  • Vote: I do not like it

 
 
 
 
14.
By mouse_wireless, history, 3 years ago, In English
Performance tip : using std::deque as a memory cache If you've been doing competitive programming for a while, you're probably aware by now that dynamically allocating memory (i.e. using `new` or `malloc`) is pretty expensive in terms of computation time (both because of slow allocation and potential cache misses). What many people do to avoid dynamically allocated memory is implement a "memory cache": a pre-allocated array of elements, from which you can fetch elements at will. In code, this might look like this: ~~~~~ elem elemCache[MAX_NUMBER_OF_ELEMENTS]; int nxtElemCache = 0; elem *fetchElement() { return &elemCache[nxtElemCache++]; } ~~~~~ And instead of using the `new` operator, you just use the `fetchElement` function (you can also override the `new` operator itself, but it's slightly less readable for the purposes of this thread, so we'll leave it at that). The problem arises when you do not know what `MAX_NUMBER_OF_ELEMENTS` is. For example, let's say that you are implementing a data structure (maybe a p...
Performance tip : using std::deque as a memory cache

Read more »

 
 
 
 
  • Vote: I like it
  • +175
  • Vote: I do not like it

 
 
 
 
15.
By dragonslayerintraining, 2 years ago, In English
Codeforces Round #584 (Dasha Code Championship Elimination Round) (div. 1 + div. 2) Editorial [1209A &mdash; Paint the Numbers](https://codeforces.com/contest/1209/problem/A) ================== Author: [user:MikeMirzayanov,2019-09-14] Consider the smallest element $x$ in the array. We need to paint it in some color, right? Observe, that we can paint all elements divisible by $x$ in that color as well. So we can perform the following while the array is not empty: * find the minimum element $x$, * assign new color and remove all elements divisible by $x$ Complexity: $\mathcal{O}(n^2)$. [1209B &mdash; Koala and Lights](https://codeforces.com/contest/1209/problem/B) ================== Author: [user:FieryPhoenix,2019-11-28] Because each individual light flashes periodically, all the lights together are periodic as well. Therefore, we can simulate the lights up to the period to get the answer. The actual period can be calculated as follows: <spoiler summary="Spoiler"> * If a light toggles every $t$ seconds, its period is $2t$. * The overall per...

Read more »

 
 
 
 
  • Vote: I like it
  • +124
  • Vote: I do not like it

 
 
 
 
16.
By DankCommenter, history, 20 months ago, In English
Dating tips for men Dating can be a tricky business. What should you wear? Where should you meet? How much should you say? Who should pay? How soon after your date should you call? With so many questions, it’s hard to focus on actually getting to know your date. Here you’ll find some top dating tips for men on how to date women (if that’s what you’re into). 1. First impressions are always important Your ripped jeans may be lucky, but remember, this will be the first impression your date gets of you. Yes, you should never pretend to be someone that you’re not, but a girl might like to see that you take pride in your appearance. Don’t worry, this doesn’t mean you need to wear a full tuxedo, but having a shower, a shave and putting on something suitable will help you impress your date and get you off to a good start. Now all you have to worry about is turning up on time. 2. Make date plans for somewhere you’ll feel comfortable Dating can be a daunting experience. If she’s asked you to pick ...

Read more »

 
 
 
 
  • Vote: I like it
  • -17
  • Vote: I do not like it

 
 
 
 
17.
By EnumerativeCombinatorics, history, 5 years ago, In English
Youtube channel: Tips for programming contests Hello coders, Today I'll introduce my new YouTube channel: [Link](https://www.youtube.com/channel/UCwsapfci2p1oDVO4Q2sJOQw) In this channel, I'll introduce many little tips that is not on textbooks but useful for problem solving. I've solved 4000+ programming problems overall and I got a lot of practical knowledge from that, so I want to explain various kind of educational approaches from my experiences. I'm not explaining how typical ones (such as segment trees or flow algorithms) work because a lot of better videos are already on YouTube, and I'm focusing on tricky techniques (and I'm sure that many redcoders know about these techniques). I think that most of those can be applied for only specific several problems, but those tips are very important to get higher places. **However, I'd like you to know that I began this channel for improving my English, so I'm sorry for my (currently) very poor English. I hope that I'll be better soon.** Feel free to comment about my video...

Read more »

 
 
 
 
  • Vote: I like it
  • +370
  • Vote: I do not like it

 
 
 
 
18.
By lnishan, 6 years ago, In English
An awesome list for competitive programming! This is a project I started from late January 2016. My motive is that: Although there's fantastic information out there, I think they're still spread all over the place. Therefore, in my opinion it would probably be cool if there's an [awesome list](https://github.com/sindresorhus/awesome) for competitive programming! ( *It's now featured on the main list!* ) I'm actively updating the list here: [https://github.com/lnishan/awesome-competitive-programming](https://github.com/lnishan/awesome-competitive-programming) # Awesome Competitive Programming [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) A curated list of awesome `Competitive Programming`, `Algorithm` and `Data Structure` resources. Created with a view to connecting people to information, this list below contains a complete collection of all the fantastic resources I've collected over the course of my 11...

Read more »

 
 
 
 
  • Vote: I like it
  • +438
  • Vote: I do not like it

 
 
 
 
19.
By -B1nary-, history, 21 month(s) ago, In English
Tips on reading input from UVA problems. Hello, I was solving some classical problems in UVA, now I am stuck on this task. ~~~~~ 315 Network A Telephone Line Company (TLC) is establishing a new telephone cable network. They are connecting several places numbered by integers from 1 to N. No two places have the same number. The lines are bidirectional and always connect together two places and in each place, the lines end in a telephone exchange. There is one telephone exchange in each place. From each place it is possible to reach through lines every other place, however, it need not be a direct connection, it can go through several exchanges. From time to time the power supply fails at a place and then the exchange does not operate. The officials from TLC realized that in such a case it can happen that besides the fact that the place with the failure is unreachable, this can also cause that some other places cannot connect to each other. In such a case we will say the place (where the failure occurred) is cr...

Read more »

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

 
 
 
 
20.
By peltorator, history, 7 months ago, translation, In English
Tips and tricks for solving permutation problems I've never been good at solving problems about permutations. I find it really hard to illustrate and solve in mind (or on paper) even small examples. Of course, I know that it's a good idea to split a permutation into a set of cycles, but it doesn't really help! I think you understand what I'm talking about. You have these elements that are not in their original positions and you want them to be in the right places. But when you start to make swaps, you should always draw a new picture for every swap to track what's going on. Yesterday's global round featured [this problem about permutations](https://codeforces.com/contest/1491/problem/G). And it wasn't that hard, but I spent a lot of time trying to figure out what's going on. And this case is even harder because you don't only have a permutation, but also its elements are being flipped every time. **So I'd like to ask you how do you represent permutations and work with them while solving problems?** I personally found out a p...

Read more »

 
 
 
 
  • Vote: I like it
  • +162
  • Vote: I do not like it

 
 
 
 
21.
By ivan100sic, history, 2 years ago, In English
On Cache Friendliness The pattern of memory accesses plays a **huge** role in determining the actual running time of an algorithm. Many of you already know this fact, but do you know how big the difference can be? Take a moment to study this code: ~~~~~ #include <bits/stdc++.h> using namespace std; using namespace chrono; vector<int> generate_random(int n) { mt19937 eng; vector<int> a(n); iota(a.begin(), a.end(), 0); shuffle(a.begin(), a.end(), eng); return a; } vector<int> generate_cycle(int n) { vector<int> a(n); iota(a.begin(), a.end(), 1); a[n-1] = 0; return a; } int main() { int n, t, q, z = 0; cin >> n >> t >> q; auto a = (t ? generate_cycle(n) : generate_random(n)); auto start = high_resolution_clock::now(); while (q--) { int x = q % n; for (int i=0; i<n; i++) x = a[x]; z += x; } duration<double> dur = high_resolution_clock::now() - start; cout << "Time: " << dur.count() << '\n'; cout << z << '\n'; } ~~~~~ The program perform...

Read more »

 
 
 
 
  • Vote: I like it
  • +135
  • Vote: I do not like it

 
 
 
 
22.
By ramchandra, 15 months ago, In English
Compilation and debugging tutorial In this tutorial I'm going to share some useful compilation and debugging tips. These tips can save you a ton of time debugging and make compilation and debugging convenient. ### Useful compilation flags G++ has many useful warning flags such as - `-Wall` enables all warnings. I highly recommend using this flags. - `-Wextra` enables extra warnings. - `-Wno-sign-conversion` silences sign conversion warnings for code like `x < vec.size()` - `-Wshadow` enables shadowing warnings, so that if you define another variable with the same name in a local scope, you will get a warning. Using these flags can save you time debugging silly mistakes like forgetting to return a value in a function or doing a comparison like `x < vec.size()-1` where `vec.size()-1` can underflow into `SIZE_MAX-1`. #### Precompiled headers You can use precompiled headers to substantially speed up the compilation of your code. Note that the precompiled header is only used if it is compiled with the ...

Read more »

 
 
 
 
  • Vote: I like it
  • +208
  • Vote: I do not like it

 
 
 
 
23.
By dhiraj-01, 7 weeks ago, In English
Why TLE :( + Tips on how to avoid TLE :) problem: https://codeforces.com/contest/1132/problem/C TLE solution: https://codeforces.com/contest/1132/submission/124402631 n, q <= 5000 we can skip 2 painters, so just iterate through all pairs (i, j) ignore i and jtn painter, and maximize the answer. time complexity: O(2 * n + q * q * 3) space complexity: O(3 * n) please help if you can find why I am getting TLE :) thank you. **update** AC https://codeforces.com/contest/1132/submission/124404923 creating a vector in each iteration cause TLE :( **how to avoid TLE** - check time complexity will fit in the problem - C++ &mdash; use FAST IO, use `'\n'` instead of `endl`, use `int` (if needed) - make sure your debug statement will not print anything on judge - recursive dp sometime gives TLE, try iterative - creating `vector`, `vector.push_back()` in nested loop is scary (check [this comment](https://codeforces.com/blog/entry/93377?#comment-823603) for better understanding) <br...

Read more »

 
 
 
 
  • Vote: I like it
  • +31
  • Vote: I do not like it