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

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

Результаты

1.
Автор parveen1981, история, 6 лет назад, По-английски
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.me/blog/entry/46620) - [Number of points on Convex hull with lattice points](https://codeforces.me/blog/entry/62183) - [FFT, big modulos, precision errors.](https://codeforces.me/blog/entry/48465) - [Number of ways between two vertices](https://codeforces.me/blog/entry/19078) - [Mathematics For Competitive Programming](https://codeforces.me/blog/entry/76938) - [FFT and NTT](https://codeforces.me/blog/entry/19862) - [Burnside Lemma](https://codeforces.me/blog/entry/51272) - [Number of positive integral solutions of equation 1/x+1/y=1/n!](https://codeforces.me/blog/entry/76836) - [On burnside (again)](https://codeforces.me/blog/entry/64860) - [Simple but often unknown theorems/lemmas/formula? Do you know?](https://codeforces.me/blog/entry/55912) - [Probabili...
Trick — Geometry being useful](https://codeforces.me/blog/entry/63823) - [Lecture #3 — Exchange, # Geometry - [Extremal Triangles](https://codeforces.me/blog/entry/17763) - [Preparing for, /blog/entry/22317) # Geometry - [Extremal Triangles](https://codeforces.me/blog/entry/17763

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

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

2.
Автор 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 - [...
- Convex hull in 3D - Halfplane intersection - Voronoi diagram / Delaunay triangulation, )$ - Suffix tree - Online convex hull in 2D - Convex hull in 3D - Halfplane intersection - Voronoi

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

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

3.
Автор rng_58, история, 6 лет назад, По-английски
AtCoder Library Recently, the number of algorithms and data structures we use in competitive programming are rapidly growing. It's a nice thing: by using more algorithms, the variety of possible problems gets wider, and we can enjoy more problems. On the other hand, before reaching adhoc, thinking-oriented part of this competition, we have to spend more and more time to learn algorithms. Sometimes a problem asks matching on general graphs; you have to find a paper describing it, read it, and implement its really complicated algorithm. Or sometimes you have to spend time tuning your library by a constant factor. Or sometimes you use multiple pre-written codes together, the variable names collide, and get annoyed. Until now, I basically rejected all problems that require pre-written codes of complicated algorithms because I don't like these things. For example, we never used segment trees with lazy propagation in our contests. However this way we can't use otherwise interesting problems and it ...
Java users. - What to do with geometry? Currently we are not sure what's the best way to handle, concern is the unfairness against Java users. - What to do with geometry? Currently we are not sure

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

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

4.
Автор 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...
=3061d07f6a4d7aa143f41c1f411909c0bf8ef116ba39d06317b95ff7b3fd77f9&X-Amz-SignedHeaders=host&response-content-disposition=filename%20% 3D, =filename%20%3D%22photo_2022-01-07%252020.14.28.jpeg%22&x-id=GetObject) , =filename%20%3D%22photo_2022-01-07%252020.14.34.jpeg%22&x-id=GetObject) , =filename%20%3D%22photo_2022-01-07%252020.14.38.jpeg%22&x-id=GetObject)

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

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

5.
Автор Radewoosh, история, 8 лет назад, По-английски
Blogewoosh #6 Hello, codeforces! Sorry for the long break, but the last weeks of holidays and the first weeks of academic year took my attention. I hope today's trick will make you forgive me. :P I invented this trick a few years ago, but for sure I wasn't first, and some of you already know it. Let's consider the following **interactive** task. There are $n$ ($1 \leq n \leq 10^5$) hidden integers $a_i$, each of them from range $[1, 10^{18}]$. You are allowed to ask at most $103000$ queries. In one query you can choose two integers $x$ and $y$ ($1 \leq x \leq n, 1 \leq y \leq 10^{18}$) and ask a question ''Is $a_x \geq y$?'' The task is to find the value of the greatest element in the hidden array. The checker **isn't** adaptive. Unfortunately, this task is only theoretical, and you cannot solve it anywhere, but it'll turn out, that solution can be handy in many other, much more complicated problems. [cut] $ $ Even beginners should be able to quickly come up with a solution which ask...
in most cases useful in geometry. It also reminds me how I discovered this trick: when I was solving, Experience tells me that this trick is in most cases useful in geometry. It also reminds me how I

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

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

6.
Автор Monogon, история, 6 лет назад, По-английски
Efficient 3D Convex Hull Tutorial _Warning: The following contains graphic depictions of geometry, precision errors, and degenerate cases. Viewer discretion is advised._ ### Prerequisites I assume the reader is familiar with: - 2D Convex Hulls - 3D Vector Operations (dot and cross products) ### Introduction Recall that in the 2D convex hull problem, you are given a set of 2D points, and you must compute the smallest convex polygon containing all the given points. By convex, we mean that for any two points $A$ and $B$ inside the polygon, the entire line segment $AB$ is also inside the polygon. The problem in 3D is completely analogous. You are given $n$ 3D points, and you must compute the smallest convex polyhedron containing all the given points. Similarly, a polyhedron is convex if for any two points $A$ and $B$ inside the polyhedron, the line segment $AB$ is also inside the polyhedron. In the 2D case, it is more obvious what the output is. We can simply output a circular list of vertices on the ...
Efficient 3D Convex Hull Tutorial, can we compute the 3D convex hull in the dumbest way possible?, examining the brute force case, we learned how to perform the most fundamental operation in any3D convex, - "Computational Geometry in C" (Second Edition) by Joseph O'Rourke - "Applications of Random, - 2D Convex Hulls - 3D Vector Operations (dot and cross products), 3D convex hull is that we get Delaunay triangulation for free. We can simply map each point $(x,y, A similar thing happens in the 3D case. If a point is already inside the polyhedron, we simply do, The problem in 3D is completely analogous. You are given $n$ 3D points, and you must compute the, There exist deterministic algorithms to compute the 3D convex hull in $O(n\log n)$ time. Most, _Warning: The following contains graphic depictions of geometry, precision errors, and degenerate

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

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

7.
Автор 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...
developed it by myself, so I consider it as my own. In particular, it's ** GEOMETRY TIME!!!**. But, 3D than in 2D. What with the described trick? It turns out that it still works! Function $f(z, In particular, it's **GEOMETRY TIME!!!**. But please, don't escape already. I also don't like this

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

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

8.
Автор defnotmee, 2 года назад, По-английски
Catching the Mole II(Hard Version) (Psychotic_D cheating case aftermath) This is a part 2 of [my other blog](https://codeforces.me/blog/entry/131821) on the [user:Psychotic_D,2024-07-23] situation. I highly recommend you see it before this one for context. If you don't care that much, here is a quick recap of what was covered in the other blog before we get started: [user:Psychotic_D,2024-07-23] had a ridiculously good performance on his friend's ([user:wuhudsm,2024-07-23]) round. This let many people become suspicious of whether he achieved this legitimately. Then multiple accusations were thrown around and I did my blog doing my own investigation and compiling the most compelling evidence I found. The takeaway was that [user:Psychotic_D,2024-07-23] was probably cheating along [user:EndlessDreams,2024-07-23], who would give him code for [user:Psychotic_D,2024-07-23] to copy. [user:Psychotic_D,2024-07-23] would alter them heavily to avoid plagiarism, but it was clear beyond a reasonable doubt that he was cheating. Well, I finished writing that blog, ...
![ ](/predownloaded/45/3d/453d81575f83b269923f45f3928d02db10965d99.png)

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

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

9.
Автор alexlikemath007, 4 года назад, По-английски
A proper tutorial for one of the craziest 3D-geometry problems Warning: This problem is like the warden of competitive programming. It is a force of nature &mdash; like a hurricane, and when you see a hurricane you don't fight it, you run. It is a big bad boss with a bunch of hitpoints, and deals big damage to your sanity. But when you kill it, it doesn't drop much loot, experience, or educational value compared to other problems. It would be wiser to go and solve some problems and learn how to use binary search. The problem: https://codeforces.me/gym/102452/problem/F It's tutorial says: Since n is small, $O(n^2)$ simulation is OK. Advanced 3-D geometry methods are highly required. The tutorial doesn't describe what the advanced 3-D geometry methods are. So, I have written this blog to remedy that gap. <spoiler summary="Chapter 1. Prologue"> You should create a `point` struct this makes things a bit easier. It has an `double x`, `double y`, `double z` coordinate. This point will be immensely useful, as we can define a line segment...
A proper tutorial for one of the craziest 3D-geometry problems, It's tutorial says: Since n is small, $O(n^2)$ simulation is OK. Advanced 3-D geometry methods are, The tutorial doesn't describe what the advanced 3-D geometry methods are. So, I have written this, geometry methods are highly required. The tutorial doesn't describe what the advanced 3-Dgeometry, geometry, and it is a good idea to package it compactly in a struct.

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

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

10.
Автор Monogon, история, 6 лет назад, По-английски
[Tutorial] Voronoi Diagram and Delaunay Triangulation in O(n log n) with Fortune's Algorithm What's a Voronoi Diagram? ------------------ Given a set $S$ of $n$ points in the 2D plane, the Voronoi diagram is a partition of the plane into regions. The region associated with a point $p\in S$ contains precisely the points $q$ such that $q$ is closer to $p$ than any other point in $S$. In other words, a point $q$ belongs to the region of its nearest neighbor. <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/54/Euclidean_Voronoi_diagram.svg/1024px-Euclidean_Voronoi_diagram.svg.png" width="300px" height="auto"/> The Voronoi diagram can be represented by the planar graph of boundaries between regions. A vertex in this graph is where three or more segments meet (or a point at infinity), and an edge is a segment connecting two of these vertices. The way the regions were defined, we see that a segment contains the points equidistant to two points in $S$, so it is part of their perpendicular bisector. Similarly, a Voronoi vertex is equidistant to three or more v...
Algorithms, Divide and Conquer Algorithm](https://cp-algorithms.com/geometry /delaunay.html), rotating all input points by $1$ radian and praying to the geometry gods., #### 3D Convex Hull Reduction, An interesting fact is that the problem of Delaunay triangulation can be reduced to3D convex hull, Because this is geometry, there are some degenerate cases I have hidden from you up to this point, My previous blog on [3D convex hull](https://codeforces.me/blog/entry/81768) gave an $O(n\log n

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

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

11.
Автор MikeMirzayanov, 5 лет назад, По-английски
Me Too <img src="/predownloaded/0b/d0/0bd07a471e12c5e207e2d6101207b72ab9fd4e7c.png"/> <img src="/predownloaded/ed/3d/ed3d4b037479ef0482507863eeb99c161dd70942.png"/>

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

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

12.
Автор rama_pang, история, 6 лет назад, По-английски
[Tutorial] Li Chao Tree Extended Hello everyone! I discovered a new (?) trick on how to apply lazy propagation on the Li Chao Tree and decided to write a blog about it. I've personally never seen it before (outside of myself), nor have I seen a problem that needs the Extended Li Chao Tree specifically, but it *can* overkill some problems. Of course, I might not be looking hard enough... You can learn about the basics of Li Chao Tree from [cp-algorithms](https://cp-algorithms.com/geometry/convex_hull_trick.html) or [this simple blog](https://robert1003.github.io/2020/02/06/li-chao-segment-tree.html). The Extended Li Chao Tree can do the following problems (and other variations): ## Problem 1 There is an array $A$ of size $N$. There are $Q$ online operations: - Range Line Insertion. Given $l$, $r$, $a$, $b$, do $A_i = \max(A_i, a \cdot i + b)$, $\forall i \in [l, r]$ in $O(\log^2 N)$ - Range Line Addition. Given $l$, $r$, $a$, $b$, do $A_i += a \cdot i + b$, $\forall i \in [l, r]$ in $O(\log^2 N)$. - Po...
/geometry/convex_hull_trick.html) or [this simple blog](https://robert1003.github.io/2020/02/06/li-chao

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

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

13.
Автор 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...
Implementation mostly refers to problems that take a lot of time to implement, such asgeometry

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

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

14.
Автор vlecomte, история, 9 лет назад, По-английски
Original Gym contest: Geometry Special 2018 Hi Codeforces, As I mentioned before, as part of my Master's thesis, besides my [book](https://vlecomte.github.io/cp-geo.pdf) I am organizing a contest with exclusively geometry problems to showcase some types of problems or techniques that I think could be cool to see in the future in ICPC and other contests. It will take place this Sunday 08:00 UTC in the Gym (the link will be [http://codeforces.me/gym/101793](http://codeforces.me/gym/101793), registration should open 6h before and remain open during the contest). There will be 4 problems to solve in 3 hours. The problem should be particularly relevant for students participating to the ICPC. But the problems will be _very hard_, so I think they can be interesting to everyone with a sufficient level in geometry. The problems will be roughly sorted by estimated difficulty, but please read all the problems, as you might find that you feel more interested by one of the "harder" problems. The statements will be given all tog...
Original Gym contest: Geometry Special 2018, /cp-geo.pdf) I am organizing a contest with exclusively geometry problems to showcase some types of, geometry.

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

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

15.
Автор vlecomte, история, 9 лет назад, По-английски
Writing a book on geometry — Update Hi, I've updated my geometry book over at [https://vlecomte.github.io/cp-geo.pdf](https://vlecomte.github.io/cp-geo.pdf). I hope you like the new content, and I would really appreciate any feedback: suggestions, comments, typos you found, etc. :) The changes I made: - Finished the chapter on "basics" and made some changes based on your feedback from last time. - Added a whole chapter on precision issues and how to deal with them. I think some of the problems and ideas in this chapter are not obvious to all and I think they can be useful for people who don't feel very confident in geometry. The codes are mostly untested for now so take them with a grain of salt (and tell me about the mistakes you find). In a few weeks, I will hold a Gym contest showcasing geometry techniques/concepts that are not very common at the moment but could help make interesting problems and add some variation to geometry in ICPC-style or online contests. There will be 5 problems for 3-4 hours...
Writing a book on geometry — Update, chapter on 3D geometry. As usual, feedback of any kind is very appreciated. It's probably full of errors. :), feel very confident in geometry., **UPD**: I added a chapter on 3D geometry. As usual, feedback of any kind is very appreciated. It's, I've updated my geometry book over at [https://vlecomte.github.io/cp-geo.pdf](https, In a few weeks, I will hold a Gym contest showcasing geometry techniques/concepts that are not very

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

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

16.
Автор adamant, история, 10 лет назад, По-русски
Quaternion algebra and geometry Hi everyone! As you may already know (if you don't then I advice you to [learn](http://codeforces.me/blog/entry/22175) it), in 2D geometry it is convenient to use complex numbers to handling points operations and rotations. Now I would like to tell you about similar construction, which allows you to work efficiently with 3D geometry, in particular to use vectors and linear operations on them, calculate many popular operations (like dot or cross products) and maintain rotations in 3D space. [cut] <br> Let $\vec r_1 = (x_1, y_1, z_1), \vec r_2 = (x_2, y_2, z_2)$ &mdash; are vectors in 3D space. Following notation from analytical geometry will be used: 1. Dot product: $(\vec r_1, \vec r_2) = x_1 x_2 + y_1 y_2 + z_1 z_2 = |\vec r_1| \cdot |\vec r_2| \cos \varphi$, where $\relax \varphi$ &mdash; is the angle between $\vec r_1$ and $\vec r_2$ in their common plane, $|\vec r_1|$ &mdash; length of vector $\vec r_1$. 2. Cross product: $[\vec r_1, \vec r_2] = \begin{vmatrix} \vec ...
Quaternion algebra and geometry, $\relax x$, $\relax y$ and $\relax z$ axes. In 3D space cross product is a vector having length $|\vec, in 3D space. From now on we will consider vectors to be quaternions with zero scalar part. Let's, to work efficiently with 3D geometry, in particular to use vectors and linear operations on them, $ — is vector of 3D space with unit vectors $\relax i, j, k$. Components $\relax s$ and $\vec v, Let $\vec r_1 = (x_1, y_1, z_1), \vec r_2 = (x_2, y_2, z_2)$ — are vectors in 3D space

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

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

17.
Автор Um_nik, 8 лет назад, По-английски
How to read problem statements But [user:Um_nik,2018-10-26], we all know how to read, we have our whooping 2 month of experience! Oh, my sweet summer child, my experiments show that many people with kinda cool achievements like medals on ROI don't know how to read statements. But don't worry, I'll teach you. Well, probably you won't understand anything, because you didn't try to understand anything in your life, you expect all hard work to be done for you by someone else. Let's start! Basic rules ================== - The result of reading the statement is usually pure math model. If story helps to build correct understanding, you can keep it, but still try to discard as many unnecessary details as possible. - Imagine you want to tell the problem to someone else. What parts you want to tell? (According to my PM, this rule won't help you). - Shorter = better. - Simpler = better. - Limitations are part of problem statement. Especially small limitations, because for small data you can try all the possib...
a metric, it is some fixed metric. And we have geometry. We can measure angles, for example, circles and check all the intersections in $O(n)$ time). It is geometry, operations are heavy, we can, )) \ne 1$. Wow, it is not geometry, it is number theory problem?! Who would know! Except, like, anyone, , and rotation, and magic, and... WHAAAT. This is certainly some magical geometry, not linear algebra

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

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

18.
Автор -is-this-fft-, история, 2 года назад, По-английски
PSA on Meta Hacker Cup (must read if its your first time!) Meta Hacker Cup is upon us again. Along with it comes the unique format where we have to run our code on large test cases ourselves. Unfortunately, past experience shows that not everyone knows how to do this reliably. Usually, after the first round, many people lose points as a result of an unreliable workflow. This time, let's try to prevent that from happening. Sorry for the somewhat self-important title, but I really do wish that everyone understood this and that no one will fail the contest because of this. ### Don't EVER copy-paste huge files A lot of people's workflow to run a solution is the following: - Click some green button in the IDE - A box comes up, copy-paste the input into that box - The output shows up somewhere This may work well for running your solution on small sample test cases. It is **terrible** for running your solution on the huge test cases in Meta Hacker Cup. In last year's Round 1, the full test case for [problem C](https://www.facebook.com...
![ ](/predownloaded/3d/8e/3d8e2f07e8847c9191a524fc79a11fe1d74a4b77.png)

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

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

19.
Автор jeroenodb, 3 года назад, По-английски
12 Cool Geometry problems Cool and geometry in the same sentence? You must be mad! Well, no. I think there are lots of interesting geometry problems, only the average geometry problems people know happen to be implementation-heavy (and frankly not that cool) problems from ICPC contests. Here is a list to show off some actually cool problems. I included some problems to have some variation in the different kinds of problems on the list. The stars indicate approximate difficulty (not coolness per se). 1. ⭐⭐⭐⭐⭐[NCPC 2023 Interwined](https://open.kattis.com/contests/ncpc23open/problems/intertwined) For this problem there is unfortunately a solution with a complicated datastructure (decremental convex hulls). The coolness is from the fact that it can be solved with just normal convex hull algorithms. Can you figure it out? 2. ⭐⭐⭐★★ CEOI 2020 [problem:1402B]. I remember this problem fondly as CEOI was my first big onsite competition, and this was my first encounter with geometry problems (I couldn't solve it, b...
12 Cool Geometry problems, CEOI was my first big onsite competition, and this was my first encounter with geometry problems (I, Cool and geometry in the same sentence? You must be mad! Well, no. I think there are lots of, Do you agree with this list? Do you have more interesting geometry problems, let me know!

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

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

20.
Автор Endagorion, история, 6 лет назад, По-английски
Codeforces Global Round 8: editorial Thank you for waiting! I hope you've enjoyed the problems. Let me know what you think in the comments! **UPD**: I almost forgot but here are some notes, as well as challenges for all problems. For a lot of them I don't have a solution and would be happy to hear your ideas. [tutorial:1368A] <spoiler summary="Challenge (awful)"> Find a closed formula for the answer. For simplicity assume $a \leq b$, </spoiler> [tutorial:1368B] <spoiler summary="Challenge (?)"> As mentioned above, the problem is not that easy in general case when there are a lot of repeated letters. Still, is it possible to do? Any solution faster than brute-force would be interesting, or even some ideas or observations. </spoiler> <spoiler summary="Notes"> I find it much harder to create a good easy problem than a good hard problem. This position in paricular gave me a lot of trouble, we had to scratch three or four other versions. Not to say the result is very inspiring, but the previous ones were...
Can you solve the same problem in 3D? The

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

Разбор задач Codeforces Global Round 8
  • Проголосовать: нравится
  • +335
  • Проголосовать: не нравится

21.
Автор Geothermal, история, 3 года назад, По-английски
A Highly Experimental Training Plan for Beginners Very loosely inspired by some comments on [Thoughts on Reaching Cyan?](https://codeforces.me/blog/entry/101561) and [my recent AMA](https://codeforces.me/blog/entry/118845). Until now, I've avoided telling beginners to practice math before working on competitive programing problems because I haven't figured out a helpful way of doing so. This post is my attempt at telling grays to train math first in a way that might lead to improvement without an absurd time commitment. ## Introduction This section is largely motivation for why I'm proposing this training plan. If you just want to see the instructions for the training plan I'm proposing, you can skip this part. The first subsection in particular is not especially relevant to the rest of the post, but I wanted to have some documentation explaining why I still think the traditional "just solve problems" advice is good. ### The Conventional Advice on Improvement I'm frequently asked for advice on how to improve at co...
You can ignore all topics in Geometry, Intermediate Algebra, and Precalculus., geometry.

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

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

22.
Автор -is-this-fft-, 4 года назад, По-английски
[Tutorial] My way of understanding Dinitz's ("Dinic's") algorithm **Part 1: [Tutorial] My way of understanding Dinitz's ("Dinic's") algorithm** [Part 2: [Tutorial] Minimum cost (maximum) flow](https://codeforces.me/blog/entry/105330) [Part 3: [Tutorial] More about minimum cost flows: potentials and Dinitz](https://codeforces.me/blog/entry/105658) #### Introduction My philosophy on writing blogs is that I only write blogs when I feel that I have something new and interesting to contribute. This is usually not the algorithm itself, of course, but it can be that I recently found or heard of a new perspective or I figured out a way to explain something in a new way. This is in contrast to my dear colleagues at GeeksForGeeks who write the most low-effort (and often wrong) tutorial on everything and then sit at the top of Google results using their somehow world-class SEO. This is one such case. I have an idea how to explain Dinitz's algorithm in a way I haven't heard of before (but it is not very hard to come up with, so this is...
![ ](/predownloaded/3d/d5/3dd5efc2c4115bfd1b89b32757a17e8bdba61c15.png)

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

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

23.
Автор -Morass-, история, 9 лет назад, По-английски
Problem Topics Good Day to you! I've been asked to make some topic-wise list of problems I've solved. Even though I couldn't involve all problems, I've tried to involve at least "few" problems at each topic I thought up (I'm sorry if I forgot about something "easy"). I've alredy made such list once anyway I've tried to include more problems now &mdash; so here it is: <spoiler summary="aho"> http://www.spoj.com/problems/ADAJOBS/ URI 2226 (5) //[NICE][NUMBERS][DP] http://www.spoj.com/problems/SUB_PROB/en/ http://codeforces.me/contest/696/problem/D 8 http://www.spoj.com/problems/AHOCUR/ 5 //Aho-Corassic + DP https://www.codechef.com/problems/LYRC (5) //Sample aho-brute-force http://codeforces.me/problemset/problem/346/B //Proposed by [user:bradyawn,2019-08-03] </spoiler> <spoiler summary="automat"> 6861 [LA] //CYK UVA 10679 //Suffix Automat http://www.spoj.com/problems/STRMATCH/ //Suffix Automat &mdash; trie might do too http://www.spoj.com/problems/NSUBST...

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

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

24.
Автор -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 ...
geometry problems, sometimes probability). There are also some algorithms where you need to work with

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

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

25.
Автор pseudocoder10, 6 лет назад, По-английски
Lockout Bot for codeforces Hello everyone, I'm sure many of you have been watching and enjoying the recent [lockout streams](https://www.youtube.com/watch?v=bBNIIg8REUU&feature=youtu.be) organized by [user:ecnerwala,2020-06-08] and [user:scott_wu,2020-06-08] and would be wanting to compete with your friends in a similar format. I have made a discord bot that does exactly the same. The source code for the bot can be found [here](https://github.com/pseudocoder10/Lockout-Bot). The bot gives a set of 5 problems with ratings from [x, x+400], where x is chosen by you and the point distribution is [100, 500]. The first person to solve a problem gets the points for it. The match ends when someone has >= 800 points or 45 minutes have been elapsed. The bot automatically updates the status when someone solves a problem but you can also do it manually. To invite the bot to your discord server, click [here](https://discord.com/oauth2/authorize?client_id=669978762120790045&permissions=0&scope=bot). If you don't wanna ...
![ ](/predownloaded/3d/6c/3d6c10be71579cdb84014935389293a3affd9c13.png

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

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

26.
Автор Al.Cash, 10 лет назад, По-английски
Geometry: 2D points and lines [Tutorial] I get an impression that a lot of coders struggle with geometric problems and prefer to avoid them. That's not much of a surprise, considering that I couldn't find a good writing explaining the basics and giving useful advice how to proceed. Moreover, some resources obfuscate this beautiful area to the point it's despised by the readers. I'll try to change that, but first I'll mention some of the better resources: [geomalgorithms.com](http://geomalgorithms.com/points_and_vectors.html) This is where you can start if you don't have a basic notion of a vector. Also there are more detailed explanations for some examples I'll list, but I dislike the implementations. [This post in Russian](http://codeforces.me/blog/entry/6642) has a link to the code that's most similar to mine, with some comments (unfortunately, also is Russian)[cut]. ### Point structure and operations Without further ado, I'll start with my code for the `Point` structure. Explanations are below, so don't rush t...
Geometry: 2D points and lines [Tutorial], main building blocks for all the computational geometry algorithms, one cannot understate their, product.** They are the main building blocks for all the computational geometry algorithms, one cannot, the code to work with them. It's easy, but I believe it helps to improve geometry understanding, when you're experienced at geometry, for optimization purposes.

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

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

27.
Автор zscoder, история, 4 года назад, По-английски
[Contest] Statement Not Found: Season 2 #### Do you think you can solve CP problems without reading the problem statements? Let's find out! On [August 28, 2022 (Sunday) 19:30-22:00 GMT+8](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Statement+Not+Found+-+Season+2&iso=20220828T1930&p1=122&ah=2&am=30), I will hold an unofficial fun contest called Statement Not Found. As you can deduce from the title, there will be no problem statements (except title and samples). Your goal is to collect as many points as possible within 2.5 hours :) Obviously, this round is **unrated**. It is somewhere between April Fools contest and a legitimate contest. The contest will be OI-style, meaning there will be no time penalty. You are allowed to use any resources online to help solve the problems. There will be **12** problems. **Scoring Distribution:** 200-400-700-700-700-800-800-900-1100-1100-1100-1500 (Total: 10000) **Please read all problems** as problem difficulty is very subjective and a 1100-point problem might b...
It's a geometry problem.

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

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

28.
Автор meooow, 8 лет назад, По-английски
[Tutorial] Convex Hull Trick — Geometry being useful ### The problem Let us consider the problem where we need to quickly calculate the following over some set $S$ of $j$ for some value $x$. $$\max_{j \in S} \{m_j \cdot x + c_j\}$$ Additionally, insertion of new $j$ into $S$ must also be efficient. This will most likely be encountered with DP problems. For example, the recent problem [problem:1083E] from Round #526 has the following DP formulation after sorting the rectangles by $x$. $$f(i) = x_i \cdot y_i - a_i + \max_{1 \le j < i}\{-x_j \cdot y_i + f(j)\}$$ The problem requires quick calculation of the above define maximum for each index $i$. How can this be done? ### The idea Notice the special form of $m_j \cdot x + c_j$. This is identical to the equation of a straight line with slope $m_j$ and Y-intercept $c_j$. So the problem is equivalent to being given a set of lines and asked for the maximum $y$ value any of those lines can give at a particular $x$. If you draw a bunch of straight lines on a plane, you'll...
[Tutorial] Convex Hull Trick — Geometry being useful, exists a nice tutorial for it on [cp-algorithms](https://cp-algorithms.com/ geometry, )](https://cp-algorithms.com/geometry/convex_hull_trick.html) - [Algorithms Live — Convex Hull, -algorithms.com/geometry/convex_hull_trick.html). This page also contains an alternate interpretation of CHT

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

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

29.
Автор Al.Cash, 10 лет назад, По-английски
Geometry: Polygon algorithms I decided to share my implementations for the basic polygon algorithms. I see almost no problems on this topic and I hope this will change in the future. First, let's remind the definitions we will use: 1. **Polygon** is a plane figure that is bounded by a finite chain of straight line segments closing in a loop to form a closed chain or circuit. These segments are called its edges or sides, and the points where two edges meet are the polygon's vertices or corners ([wiki](https://en.wikipedia.org/wiki/Polygon)). 2. Polygon is **convex** if a line segment connecting any two points on its boundary lies inside the polygon. Equivalently, all its interior angles are less than or equal to 180 degrees. 3. Polygon is **strictly convex** if in addition no three vertices lie on the same line. Equivalently, all its interior angles are less than 180 degrees. 4. Polygon is **simple** if its boundary doesn't cross itself. I will present two algorithms for each problem: one for **ar...
Geometry: Polygon algorithms, [Computational Geometry in C (2nd Edition)](http://cs.smith.edu/~orourke/books/compgeom.html) by [Joseph, 2. I highly recommend reading [Computational Geometry in C (2nd Edition)](http://cs.smith.edu

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

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

30.
Автор ifsmirnov, история, 9 лет назад, По-русски
Jngen: generic library for generating testcases Two years ago I came up with an [idea](http://codeforces.me/blog/entry/20108) (Russian only) of making a generic library for creating testcases. Months have passed, thoughts circulated in my mind over and over, and finally I sculpted something in code. Far many things are yet not implemented, but I already frequently use ones which are. Here it is: https://github.com/ifsmirnov/jngen. You can download the library itself (its single header jngen.h) [here](https://raw.githubusercontent.com/ifsmirnov/jngen/master/jngen.h). Jngen works with arrays, graphs and trees. It also can generate some strings and geometry and provides command-line options parser and cool SVG drawer. Here are some working examples. ~~~~~ cout << Array::id(10).shuffled().add1() << endl; // permutation of elements from 1 to 10 cout << Tree::random(100000, 20) << endl; // "long" tree with elongation 20 pair<string, string> test = rnds.antiHash({{mod1, base1}, {mod2, base2}}, "a-z", 10000); // should be s...
Jngen works with arrays, graphs and trees. It also can generate some strings and geometry and

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

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

31.
Автор Radewoosh, история, 11 лет назад, По-английски
VK Cup 2016 — Round 3 — Editorial Editorial was created by [user:Errichto,2016-05-07], but he said that he has enough contribution, so I'm posting it for you. ;) #1 [problem:673A] (invented by [user:GlebsHP,2016-05-07] &mdash; thanks!) You are supposed to implement what is described in the statement. When you read numbers $t_i$, check if two consecutive numbers differ by more than $15$ (i.e. $t_i - t_{i-1} > 15$). If yes then you should print $t_{i-1}+15$. You can assume that $t_0 = 0$ and then you don't have to care about some corner case at the beginning. Also, you can assume that $t_{n+1} = 91$ or $t_{n+1} = 90$ (both should work &mdash; do you see why?). If your program haven't found two consecutive numbers different by more than $15$ then print $90$. If you still have problems to solve this problem then check codes of other participants. [submission:18286606] #2 [problem:673B] (invented by [user:Errichto,2016-05-07]) Some prefix of problems must belong to one division, and the remaining suf...
http://www.wolframalpha.com/input/?i=1+-+(1-(1%2F2)%5Ed)%5E(N%2Fd)+for+N+%3D +500000+and+d+%3D+30

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

Разбор задач VK Cup 2016 - Раунд 3
  • Проголосовать: нравится
  • +109
  • Проголосовать: не нравится

32.
Автор rng_58, история, 10 лет назад, По-английски
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 ...
#### 4. Precision. Especially in geometry problems, we sometimes use epsilons. However writers

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

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

33.
Автор orz, история, 4 года назад, По-английски
Northern Eurasia Finals 2022 has concluded Two days ago Northern Eurasia Finals 2022 [took place](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Northern+Eurasia+Finals+2022&iso=20221207T1015&p1=352&ah=5), mirror of which was on Codeforces: [contest:1773]. In the next few hours the [standings](http://nerc.itmo.ru/archive/2022/standings.html) got unfrozen, thereby we know the list of the teams that qualified to the ICPC Finals this year: **1<sup>st</sup> place &#127942;** [MIPT](https://codeforces.me/ratings/organization/38): Yolki-palki ([user:Pechalka,2022-12-09], [user:Kapt,2022-12-09], [user:Tikhon228,2022-12-09]) **2<sup>nd</sup> place &#129351;** [HSE](https://codeforces.me/ratings/organization/250): FFTilted ([user:Kirill22,2022-12-09], [user:teraqqq,2022-12-09], [user:Ormlis,2022-12-09]) **3<sup>rd</sup> place &#129351;** [SPb SU](https://codeforces.me/ratings/organization/16): Urgant Team ([user:sava-cska,2022-12-09], [user:74TrAkToR,2022-12-09], [user:orz,2022-12-09]) **4<sup>th</sup> place &#...
?AWSAccessKeyId=cloudconvert-production&Expires=1670681504&Signature=9wRmjxntaoVcTQyCoPTJZhSvOm4% 3D

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

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

34.
Автор adamant, 15 месяцев назад, По-английски
OCPC 2025 Summer season — wrap Hi everyone! <center><a href="https://ocpc.camp"><img src="https://ocpc.camp/images/ocpc_light.svg" height="100px"></a> <a href="https://icpc.foundation/"><img src="/predownloaded/43/08/43086529a28ccb5c9f2f2eec560ffa85e09c6881.svg" height="100px"></a></center> Just recently, the last mirror of the summer season of OCPC 2025 has concluded. I would like to take this moment to share some of the details and statistics on how it went with the community &#128522; [cut]<br> ### ICPC award Okay, this happened last chronologically, but it's probably most relevant, so I will start with it! <center> <a href="/predownloaded/43/df/43dfc0edaaa29db59b2b5ba6afbd4f033c8b535f.jpg"><img src="/predownloaded/43/df/43dfc0edaaa29db59b2b5ba6afbd4f033c8b535f.jpg" height="200px"></a> <a href="/predownloaded/b9/25/b9256e789a31ab2d1b3858bfa984ea1341dbc6c5.jpg"><img src="/predownloaded/b9/25/b9256e789a31ab2d1b3858bfa984ea1341dbc6c5.jpg" height="200px"></a> <a href="/predownloaded/c5/21/...
<>

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

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

35.
Автор Hikari9, история, 11 лет назад, По-английски
Easy geometry using std::complex It's always a hassle to define our 2D Geometry library during a contest. Is there a way to make our computational geometry lives easier in any way? Fortunately for us, there is, at least in C++, using complex numbers. **Complex numbers** are of the form a + bi, where a is the real part and b imaginary. Thus, we can let a be the x-coordinate and b be the y-coordinate. Whelp, complex numbers can be represented as 2D vectors! Therefore, we can use complex numbers to define a point instead of defining the class ourselves. You can look at std::complex reference [here](http://www.cplusplus.com/reference/complex/). <hr> #### Defining our point class We can define our point class by typing `typedef complex<double> point;` at the start of our program. To access our x- and y-coordinates, we can macro the `real()` and `imag()` functions by using `#define`. Of course, don't forget to `#include <complex>` before anything. ~~~~~ #include <iostream> #include <complex> using namespac...
Easy geometry using std::complex, It's always a hassle to define our 2D Geometry library during a contest. Is there a way to make our

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

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

36.
Автор adamant, история, 5 лет назад, По-английски
Some rotational invariants in geometry Hi everyone! Today I'd like to write about some polynomials which are invariant under the rotation and relabeling in euclidean spaces. Model problems work with points in the 3D space, however both ideas, to some extent, might be generalized for higher number of dimensions. They might be useful to solve some geometric problems under the right conditions. I used some ideas around them in two problems that I set earlier. #### Congruence check in random points You're given two set of lines in 3D space. The second set of lines was obtained from the first one by the rotation and relabeling. You're guaranteed that the first set of lines was generated uniformly at random on the sphere, find the corresponding label permutation. Actual problem: [problem:102354F]. ##### Solution Let $P_4(x, y, z) = \sum\limits_{l=1}^n \left((x-x_l)^2+(y-y_l)^2 + (z-z_l)^2\right)^2$. It is a fourth degree polynomial, which geometric meaning is the sum of distances from $(x, y, z)$ to all points i...
Some rotational invariants in geometry, relabeling in euclidean spaces. Model problems work with points in the 3D space, however both ideas, to some, rotation and relabeling in euclidean spaces. Model problems work with points in the3D space, however both, You're given two set of lines in 3D space. The second set of lines was obtained from the first one

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

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

37.
Автор adamant, история, 21 месяц назад, По-английски
Geometric meaning of LP duality Hi everyone! Recently, linear programming (LP) duality was brought up in a Discord server, and it made me think again about how, whenever it is introduced, it's most often _very_ poorly motivated. Some examples that I've seen include: - Directly deriving it from general Lagrange duality (which I did myself in the past, and I like this method, but it's not best for LP); - Giving some vague economics-based explanation in terms of goods quantities and costs; - Making a very handwavy argument about approximating the target function with constraints; - Simply proving it symbolically without giving a good explanation to what and why we're doing. After some thinking, I would like to share a geometric interpretation to LP duality, that I think should very intuitively and directly explain what's the meaning of our actions, and why does it actually deliver the same result (and not just an upper bound) as the primal problem. **Tl;dr**. Both primal and dual LP problems find the **su...
#### Geometry of the dual problem, #### Geometry of the primal problem

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

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

38.
Автор pakhomovee, 6 лет назад, По-русски
Mo's algorithm and 3D Mo Mo's algorithm ================== <spoiler summary="Problem 1"> ### the number of distinct elements on a segment of an array Given an array $A$ of length $n$ and $q$ queries. Queries: - Find the number of distinct elements on the segment [l; r] of the array $A$. </spoiler> <spoiler summary="Problem 2"> ### the number of distinct elements on a segment of an array + changing an element Given an array $A$ of length $n$ and $q$ queries. Queries: - Find the number of distinct elements on the segment [l; r] of the array $A$. - Change an element </spoiler> Let's solve the first problem. We can solve it using persistent data structures, but we want to be able to solve problem 2 as well. ### Algorithm 1 Let's solve the task offline. We need to sort the queries using the <$\frac{l}{k}$, r> comparator, where k is a fixed integer. It is quite obvious that we can easily add/delete one integer (we can do that using another array B, $B_{i}$ equals to the number...
Mo's algorithm and 3D Mo, 3D Mo ==================

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

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

39.
Автор errorgorn, 5 лет назад, По-английски
[Tutorial] Knapsack, Subset Sum and the (max,+) Convolution **Edit**: I have realized that this blog has been sent quite a lot on discord servers, so I am adding a content page at the start to help organize this blog better. ## Prerequisites Let us first define the classical knapsack, unbounded knapsack and subset sum problems. #### Subset Sum There are $N$ items. The $i$-th item has weight $w_i$. Find a set $S$ such that $\sum\limits_{i \in S} w_i = C$. #### Knapsack There are $N$ items. The $i$-th item has weight $w_i$ and value $v_i$. Find a set $S$ such that $\sum\limits_{i \in S} w_i \leq C$ and $\sum\limits_{i \in S} v_i$ is maximized. #### Unbounded Knapsack There are $N$ items. The $i$-th item has weight $w_i$ and value $v_i$. Find a **multiset** $S$ such that $\sum\limits_{i \in S} w_i \leq C$ and $\sum\limits_{i \in S} v_i$ is maximized. You should know how to do both versions of knapsack in $O(NC)$ and subset sum in $O(\frac{NC}{32})$ before reading this blog. In this blog post, I will just show some res...
/blog/entry/98334 7. https://cp-algorithms.com/geometry/convex_hull_trick.html 8. http

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

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

40.
Автор MikeMirzayanov, история, 11 лет назад, По-русски
Списки пользователей (User Lists) Добрый день. В режиме ранней беты мы запускаем новую фишку Codeforces, которая будет полезна многим активным пользователям сайта. Теперь вы можете создавать, управлять и использовать "списки пользователей". ![ menu ](http://codeforces.me/predownloaded/5b/59/5b59b7ebcec52e013e061b99c3c09d453c1dac66.png) В некотором роде это своеобразное и более функциональное обобщение концепции "друзей". Вы можете создать список интересных вам пользователей (а можете создать 100 таких списков) и, используя список, фильтровать результаты раундов, быстро анализировать какие задачи решены в архиве, а какие нет. Эта функциональность хорошо подходит для организации тренерской работы &mdash; я сам ее использую. Собрав в список всех тренирующихся студентов, легко подбирать задачи, которые не были решены (и даже просто не сделаны попытки) всеми студентами одновременно. У списка есть название и два относительно секретных ключа &mdash; один для его просмотра/использования, а второй для редактирова...
![ ](http://codeforces.me/predownloaded/05/3d /053d73973a27313df4c4673bd1c65b8ec203af62.png)

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

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

41.
Автор -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...
. You must remove the geometry and topology, you need to find and prove some equivalent condition

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

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

42.
Автор Errichto, 10 лет назад, По-английски
Good Bye 2016 — hints and codes You can download my codes to all problems [here](http://www.filedropper.com/codes_1). I will write a full editorial in the next few days. Now you can read hints and short solutions. [problem:750B] <spoiler summary="hint"> Create a variable that will denote your current distance from the North Pole. What are allowed values of this variable? When can't we go West or East? </spoiler> [problem:750C] <spoiler summary="hint1"> Let $x$ denote the initial rating (or his final rating, whatever is easier for you to think about). The information that Limak is in some division in the $i$-th contest gives us some inequality for $x$. Can you see it? </spoiler> <spoiler summary="hint2"> For every contest we know that the current rating is $x$ increased by some prefix sum of c_i (changes of rating). If Limak is in the division 1, we have inequality x+prefSum >= 1900 so we have x >= 1900-prefSum. If Limak is in the division 2, we have inequality x_prefSum <= 1899 so it is ...
change the latitude (equivalently: the distance from Poles) and this problem is hard3d geometry

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

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

43.
Автор MladenP, история, 5 лет назад, По-английски
Best of COCI #1 Since a new season of COCI (Croatian Open Competition in Informatics) started [last saturday](https://codeforces.me/blog/entry/96022), here is the first in a series of COCI appreciation posts (I will post one after each COCI round, so six in total!). For my coaching, I went through all COCI contests since 2006 to gather tasks and selected some of my favorite ones. ### Notes - I skipped a lot of the really hard tasks because they weren't useful for my students. I kept a list of these tasks, if someone wants it, they can PM me. Also, I only considered COCI, not COI. This current season is not being considered. - There are many great tasks outside of the 48 shown (throughout the series), so it's worth it to go through other tasks as well. I have selected just my favorite ones. - These tasks are maybe not always the most innovative, I have selected the tasks that are most useful for coaching and learning new ideas, so for people who already know the idea, the difficulty might be mu...
mst, 3d-points

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

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

44.
Автор Iura_Shch, история, 2 года назад, По-русски
3D — Mo (online). Hello, Codeforces! I really enjoy working with square roots, so I started thinking in that direction and came up with a 3D Mo's algorithm in an (almost) online format. Problem: Given an array of N numbers and Q queries (in online mode) to this array, along with a number K. Each query belongs to one of two types: 1. update pos val — assign the value val to a[pos]. 2. get L R — find out how many numbers appear at least K times in the segment from L to R. Solution: (the symbol / will be used to denote integer division) Let's define a "bucket" as a structure with the following elements: indices L and R (start and end of the current half-interval, using 0-based indexing), a counting array (if needed), and a result (res). Let C be the cubic root of N. Now, let's create C^2 buckets and set their boundaries as follows: for bucket i (0-based), let L = (i / C) * (N / C) and R = (i % C) * (N / C). If R <= L, simply ignore this bucket. Create a count array cnt for this array and com...
3D — Mo (online)., a 3D Mo's algorithm in an (almost) online format.

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

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

45.
Автор skywalkert, история, 5 лет назад, По-английски
2019 Summer PtzCamp, Day 8: XIX Open Cup Onsite, Editorial This editorial corresponds to [contest:103652], a.k.a "Jingzhe Tang Contest 2", held on Sept. 1st, 2019. Moreover, this problem set is a selection of "CCPC-Wannafly Winter Camp 2018, Day 2 (Div. 1 & Div. 2)" held on Jan 30th, 2019. Feel free to comment on the tutorials listed in the following (with some follow-up questions left to readers). Hope you enjoy solving these problems. --- [problem:103652A] <spoiler summary="solution"> The number of updates can be counted as the number of ordered pairs $(u, v)$ such that when $u$ is going to be removed, there exists at least one path between $u$ and $v$. If the path between $u$ and $v$ is unique in the original graph, we can conclude that pair exists if $u$ is the first removed node on the path with respect to an order, and $\frac{1}{cnt(u, v)}$ of all possible orders would meet this condition, where $cnt(u, v)$ is the number of nodes on the unique path between $u$ and $v$ (inclusive). In other cases, there exist exactly tw...
This is a typical 3D geometry problem. One thing you need to know is

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

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

46.
Автор DrSwad, история, 7 лет назад, По-английски
A Beautiful Technique for Some XOR Related Problems ## Inspiration I'm very excited about this blog, as it took me quite a lot of effort and scavenging through the internet to completely grasp the concept of this technique(That's probably because I have almost zero knowledge in Linear Algebra or I'm just plain dumb). So I feel like I genuinely conquered a challenge, and I really want to share it with someone. But there's no way my CP friends circle will believe it, they'll think I'm just trying to show off :P So here I am, sharing it on CF. I also created a [personal blog](https://drschwad.github.io/), so that if I ever feel like sharing something again(not only about CP), I can write a blog there. I also added this same post [there](https://drschwad.github.io/2019-08-06-z2-space-xor-trick/), you can read it there if you prefer dark theme. I'll be pleased to hear any thoughts on the blog or if I can improve it in some way ^\_^ ## Introduction Since it concerns Linear Algebra, there needs to be a lot of formal stuff going on ...
}.$ $\mathbb{Z\_2^3}$ would be a small $3d-$plane with only $2^3 = 8$ points, all coordinates taken

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

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

47.
Автор Sol1, 4 года назад, По-английски
Unofficial tutorial to Codeforces Round 844 (A-G) Seems like the official editorial has not been released for a long time, I'll try to provide an unofficial one for those who are tired of waiting. But I'm too weak to understand the solution to H by reading others' code :(. If you know the solution, I'll appreciate it if you can explain it to me. Implementation can be seen in my [submissions](https://codeforces.me/submissions/Sol1/contest/1782). This is the first time I write an English editorial like this. If there's anything inappropriate, kindly point out. A ------------------ Note that you have to move from the bottom to the top no matter what, so we can consider the following problem: Given 2 points $A,B$ in a $w\times d$ rectangle, find one path from $A$ to $B$ that moves parellel to the edges of the rectangle and touch the edges at least once. After we get the answer to this problem, we can add $h$ to it to get the answer of the original. This problem is easy to solve: iterate over which edge to touch, and the d...
calculate the answer for all of them, resulting in the $O(n^3d(10^9))$ solution which can pass.

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

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

48.
Автор adamant, история, 15 месяцев назад, По-английски
CP-Algorithms: Discord server, donation campaign and more Hi everyone! <img src="/predownloaded/82/15/821540e8f87d8a2b2d468377aacbba80b0aa1623.png" style="float:right;" width=100px> It was a while since I [posted](https://codeforces.me/blog/entry/135081) last update about **[CP-Algorithms](https://cp-algorithms.com)**. As a general reminder, it is a community project that [started off](https://codeforces.me/blog/entry/13198) in 2014 by [user:RodionGork,2025-08-23] as a translation of [e-maxx](http://e-maxx.ru/), a Russian go-to resource at the time by [user:e-maxx,2025-08-23] for learning core competitive programming algorithms. Since then, CP-Algorithms grew quite a lot (which also prompted a rename from original project name `e-maxx-eng`) and includes a lot of new, original articles, and a lot of translated articles were enhanced and/or extended or even completely rewritten. In this blog, I would like to share a bunch of updates about the site, to make sure it's still in the collective memory &#128517; ### New maintainers ...
- [Minimum Enclosing Circle](https://cp-algorithms.com/geometry /enclosing-circle.html

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

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

49.
Автор maomao90, история, 5 месяцев назад, По-английски
Why is std::deque, std::stack, and std::queue slow and memory inefficient? ## Sidetrack It has been two years since I wrote an educational blog. I've been inactive in the CP community recently as I've shifted my focus to internships. Recently, I observed some interesting behaviour with `std::queue` while profiling an application during my internship, which led me to writing this blog. Most of the images below are taken from the C++ standard https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4950.pdf ## Queues and stacks Queues and stacks do not actually provide any new implementations... They are just wrappers around a container (which is `std::deque`) by default. ![C++ standard std::queue 1](https://codeforces.me/predownloaded/3d/63/3d63990fec1b19722e82b6e01b85679b548b831f.png) ![C++ standard std::queue 2](https://codeforces.me/predownloaded/f4/b3/f4b315a2b12be6525865df61b31aa71bc1b8bbd6.png) ![C++ standard std::stack 1](https://codeforces.me/predownloaded/c0/64/c06407b9c38d964cf8444bb75ed33853e9ffd20b.png) ![C++ standard st...
![C++ standard std::queue 1](https://codeforces.me/predownloaded/3d/63

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

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

50.
Автор rabaiBomkarBittalBang, 5 лет назад, По-английски
Codeforces Round #724 — Editorial We hope you liked the problems! If you’re curious about the two different problem formats, initially [user:Tlatoani,2021-06-06], [user:golions,2021-06-06], [user:qlf9,2021-06-06] and I were working on Omkar 3 with [user:antontrygubO_o,2021-06-06] while [user:hu_tao,2021-06-06] was working on a separate round with [user:isaf27,2021-06-06]. We eventually decided to join forces and combine the rounds, resulting in the current Omkar 3. <h1>[problem:1536A]</h1> Idea: [user:rabaiBomkarBittalBang,2021-06-06] Preparation: [user:rabaiBomkarBittalBang,2021-06-06], [user:Tlatoani,2021-06-06], [user:qlf9,2021-06-06] [Video editorial](https://www.youtube.com/watch?v=GZeihS2xTSc) <spoiler summary="Hint"> Consider what happens when $a$ contains a negative number. </spoiler> <spoiler summary="Solution"> We first claim that if any negative number exists in $a$, then no solution exists. Denote $p$ as the smallest number in $a$ and $q$ as another arbitrary number in the array (as $n...
Turn into geometry problem

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

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

51.
Автор Misuki, история, 18 месяцев назад, По-английски
Möbius function, Möbius inversion explaination from a combinatorics perspective When I first learn Möbius function, all the resources I found just explain everything algebraically (e.g. substitute $[\gcd = 1]$ using the identity $\sum\limits_{d | \gcd}\mu(d) = [\gcd = 1]$ when solving certain kind of gcd counting problem, then start to do a bunch of algebra and boom! the problem is solved, and I don't know why it works lol) which is not very motivated in my opinion. But after rethinking about it after solving [this problem](https://codeforces.me/problemset/problem/2045/K), I think I can shed some light on the motivation behind Möbius function, from a combinatorics perspective. #### Definition of Möbius function $$\mu(n) = \begin{cases}(-1)^c & \text{ if } n \text{ is square-free and } n \text { have } c \text{ different prime divisors}\\ 0 & \text{ if } n \text{ is not square-free}\end{cases}$$ What a weird function? Why do we want to define something based on number of prime divisors and why do we want to let everything not square-free to be zero? Yo...
(I can't find a 3D graphic renderer draws better than this, sorry. But you got the idea.), And again, you can refer above 3D block picture, rotate it by $180$ degree to convience yourself

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

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

52.
Автор PersistentLife, история, 3 месяца назад, По-английски
As an CNOI Gold Medalist: How I Train CNOI Gold Medal Winning Competitive Programmers UPD: [Curated Problem Set #1](Thhttps://codeforces.me/blog/entry/156427) is released. Please join our Discord server to receive the latest updates: https://discord.gg/DsHSfmVgG UPD: Curated problem set #1 (both normal and advanced) **for subscribers** is ready! Feel free to join our Discord server and subscribe! This post is about: 1. The Main Two Abilities You Need in Competitive Programming 2. How to Choose Problems of an Appropriate Difficulty 3. How Should You Work on a Problem 4. When You Should Learn New Knowledge (Like New Algorithms) 5. How to Train Before an Important Contest 6. Free Content, Personalized Subscription Services, and Potential Opportunity for One-to-One Coaching 7. Survey About the Services I won a gold medal at NOI 2024 in my second year of high school and was admitted to the Turing Class at Peking University. After securing my admission, I continued pursuing competitive programming: I began studying new material at university in advance whi...
Relatively uncommon topics such as computational geometry and number theory may be included in a

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

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

53.
Автор kiwii, 3 года назад, По-английски
Luvliest Lub Lub Dynamic Diameter and Euler Tour?? ωeecently, I've encountered this pωoblem in a local contest in my coωountωy and I find this pωobωem has a ωeeeaωy cuωul tωick, i aωso found out that this has a s-s-similar idea, and the pωoblem can be fuωuωutheω be ωeduced to &#10024; **Dynamic Diameter** &#10024; [https://oj.uz/problem/view/CEOI19_diameter](https://oj.uz/problem/view/CEOI19_diameter) ## Pωobωem S-S-Statement (,,> &#7447; <,,) Ur given a&#127795; with $N$ n-n-nodes and $N - 1$ e-edges connecting each of the nodes. Each edge is a tu&omega;u&omega;u&omega;uple $(u[i], v[i], c[i])$, connecting node $u[i]$ and $v[i]$ with weight $c[i]$ $(0 \leq i \leq n - 2)$. &#127968;&#127947;&#65039; You're given $Q$ quewees: - `1`, output the RAWWRGESTTT &#129409;&#129409;&#129409;&#129409; diameter of the t&omega;ee, fo&omega;o&omega;ed with T&omega;o&#9996;&#65039; nodes $x$ and $y$ de-de-denoting the endp&omega;oints of the diameterr. &#128726; - `2 x`, output the distance between $x$ and $y$, where $y$ is the node w...
- ![image-20231004122149867](/predownloaded/3d /1d/3d1df801cb00031e547dc7d458031995d4f1f6ee.png)

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

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

54.
Автор tch1cherin, история, 10 месяцев назад, По-английски
[Tutorial] On Applications of CDQ Divide & Conquer _This tutorial is nominated for the [blog posts competition](https://codeforces.me/blog/entry/149422) from [user:cadmiumky,2026-02-07]. Thanks to him for this initiative!_ _Also thanks to [user:Ghos007,2026-02-08], [user:dima210121012101,2026-02-08], [user:dmitryAdams,2026-02-08] and ChatGPT for proofreading this post and giving useful feedback._ --- CDQ Divide & Conquer is an interesting algorithmic technique that nobody talks about (at least in Russian CP community). However, it is quite powerful, as it often provides unexpectedly clean solutions to seemingly tedious problems. In this tutorial, I will discuss different contexts where this method is useful. I also want to collect what I have seen about this technique on the Internet in one place and add my own insights. Credit to [robert1003's blog](https://robert1003.github.io/2020/01/31/cdq-divide-and-conquer.html) where I first learned this method. The main idea of this technique is to calculate the **influence/contr...
, but the 3D case seems tedious. With CDQ, however, it becomes much simpler., 3D Queries ----------, I am not aware of any problems in which you can use the 3D algorithm. Here are some problems where, Moreover, we can solve even the 3D version:

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

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

55.
Автор kpw29, 5 лет назад, По-английски
New Year wishes from participants — "Cyan Rebellion 2022" survey results Hi! Two weeks ago I made a survey [link here:](https://codeforces.me/blog/entry/98424) about making Codeforces better. In this blog I am sharing the results. Consider reading the previous blog first, but this one should be self-contained as well. TLDR ------------------ The quality of Codeforces problems has increased over time, and people are mostly happy. Participants would probably be even happier with a greater variety of problem topics. It's important for setters to consider the contest as a whole, including the target audience of a given task. Some users wrote essays longer than the entire survey. How to access the results ------------------ Before we start, I would like to invite everyone to take a look at the raw data. If you are keen on showing off your data analysis skills, please do so! I hope that some of us will manage to find more interesting insights taking into account preferences of users from various skill groups. [Raw results](https://docs.google.com/...
![ ](/predownloaded/f2/3d

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

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

56.
Автор vaibhav1997, история, 9 лет назад, По-английски
All the good tutorials found for Competitive Programming Here is the list of some of the good tutorials written by codeforces users :- **C++** - [C++ Tricks](http://codeforces.me/blog/entry/15643) by [user:Swift,2018-01-22] - [C++ STL: map and set](http://codeforces.me/blog/entry/9702) by [user:adamant,2018-01-24] - [C++ STL: Policy based data structures](http://codeforces.me/blog/entry/11080) by [user:adamant,2018-03-05] - [Competitive C++ Manifesto: A Style Guide](https://codeforces.me/blog/entry/64218) by [user:Swift,2019-03-04] - [Catching silly mistakes with GCC](https://codeforces.me/blog/entry/15547) by [user:andreyv,2019-03-04] - [About a general reader / writer for STL-Structures,](https://codeforces.me/blog/entry/71075) by [user:Arturgo,2020-12-20] - [Blowing up unordered_map, and how to stop getting hacked on it](https://codeforces.me/blog/entry/62393) by [user:neal,2020-12-20] - [C++ tips and tricks](https://codeforces.me/...
**Geometry**, - [Quaternion algebra and geometry](http://codeforces.me/blog/entry/46744) by [user:adamant,2018

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

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

57.
Автор BledDest, 5 лет назад, перевод, По-русски
Kotlin Heroes 8 Announcement <img src="/predownloaded/dc/3d/dc3d601ff391e638c1f2b20ec167083978099bbe.png" style="width:500px;float:right;margin:0 1em 1em 1em;"/> Hello, Codeforces! First and foremost, we would like to say a massive thank you to everyone who entered and submitted their answers to the seven Kotlin Heroes competitions which were held previously: [Episode 1](https://codeforces.me/contests/1170), [Episode 2](https://codeforces.me/contests/1211), [Episode 3](https://codeforces.me/contests/1297), [Episode 4](https://codeforces.me/contests/1346), [Episode 5: ICPC Round](https://codeforces.me/contest/1431), [Episode 6](https://codeforces.me/contest/1488), and [Episode 7](https://codeforces.me/contest/1533). Ready to challenge yourself to do better? The [contest:1571] competition will be hosted on the Codeforces platform on [contest_time:1571]. The contest will last 2 hours 30 minutes and will feature a set of problems from simple ones, designed to be solvable by anyone, to hard ones, to mak...

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

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

58.
Автор vsb, 8 лет назад, По-английски
Level 5 Engineer Story <img src="/predownloaded/ef/06/ef06711388a4a67082905886a52d4842593bed73.jpg" style="width:400px;float:right; margin: 0 1em 1em 1em;"/> I'm Viktor Barinov (vsb), and I'd like to share a little about my experience with coding competitions and working at Level 5, Lyft's self-driving division. I graduated from [Taurida National University](https://en.wikipedia.org/wiki/Tavrida_National_V.I._Vernadsky_University), and have been an avid competitor in programming contests since high school. My first introduction to ACM ICPC problems was at [Timus](http://acm.timus.ru) in 2003. I was intrigued by math and algorithmic problems with tricky edge cases. Then I became hooked, solving a few problems from the archive daily. I later discovered UVA Online and started participating in local Ukrainian competitions, trying to advance to all-Ukrainian Finals and ACM ICPC SEERC. I then started competing at TopCoder and Codeforces. After a long path of learning, coding, and debugging, I became red o...
We build 2D and 3D maps from camera and LIDAR data that is used in realtime to improve precision of

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

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

59.
Автор dreamoon_love_AA, история, 11 лет назад, По-английски
Codeforces Round #320 [Bayan Thanks-Round] Editorial ## [Problm 1 : Raising Bacteria](http://codeforces.me/problemset/problem/579/A) Write down $x$ into its binary form. If the $i^{th}$ least significant bit is $1$ and $x$ contains $n$ bits, we put one bacteria into this box in the morning of $(n+1-i)^{th}$ day. Then at the noon of the $n^{th}$ day, the box will contain $x$ bacteria. So the answer is the number of ones in the binary form of $x$. [code of author's friend: this](http://codeforces.me/contest/579/submission/13053439) ## [Problem 2 : Finding Team Member](http://codeforces.me/problemset/problem/579/B) Sort all possible combinations from high strength to low strength. Then iterator all combinations. If two people in a combination still are not contained in any team. then we make these two people as a team. [author's code: this](http://codeforces.me/contest/579/submission/13053526) ## [Problem 3 : A Problem about Polyline](http://codeforces.me/problemset/problem/578/A) If point ($a$,$b$) is located on t...
Now here give people geometry viewpoint of this problem:

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

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

60.
Автор BledDest, 3 года назад, По-английски
Kotlin Heroes Episode 9 Returns! Greetings Codeforces! <img src="/predownloaded/dc/3d/dc3d601ff391e638c1f2b20ec167083978099bbe.png" style="width:500px;float:right;margin:0 1em 1em 1em;"/> We are thrilled to announce the **return of Kotlin Heroes**! As we resume this competition, we're eager both to welcome back some familiar names and meet new participants. Let's make Kotlin Heroes: Episode 9 an occasion to remember! We would like to thank everyone who participated in the previous eight Kotlin Heroes competitions: [Episode 1](https://codeforces.me/contests/1170,1171), [Episode 2](https://codeforces.me/contests/1211,1212), [Episode 3](https://codeforces.me/contests/1297,1298), [Episode 4](https://codeforces.me/contests/1346,1347), [Episode 5: ICPC Round](https://codeforces.me/contests/1432,1431), [Episode 6](https://codeforces.me/contests/1488,1489), [Episode 7](https://codeforces.me/contests/1533,1532), and [Episode 8](https://codeforces.me/contests/1571,1570). Kotlin Heroes is a great way to play ...

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

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

61.
Автор kuviman, история, 11 лет назад, По-русски
Showing local times on Codeforces Hello everyone! Up to this day Codeforces showed local server time everywhere, and programmers all around the world knew exactly what 19:35 Moscow time corresponds to in their time zone. Now it will be much harder for you to make a mistake and skip another round, since you are going to see time in your time zone. This is what a usual London programmer sees waiting for Codeforces Round #337 (Div. 2): ![ ](http://codeforces.me/predownloaded/8f/3d/8f3d3d43fe4445028d649ba6db82fec68657e112.png) The problem was not that easy to implement, since many parts of the site are heavily cached, and we had to manipulate time directly in browser using JavaScript. Thanks for your attention, good luck to all at the next round!
://codeforces.com/predownloaded/8f/3d /8f3d3d43fe4445028d649ba6db82fec68657e112.png)

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

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

62.
Автор BledDest, история, 9 лет назад, перевод, По-русски
Educational Codeforces Round 32 Hello Codeforces! On [November 09, 18:05 MSK](https://www.timeanddate.com/worldclock/fixedtime.html?day=9&month=11&year=2017&hour=18&min=5&sec=0&p1=166) Educational Codeforces Round 32 will start. Series of Educational Rounds continue being held as [Harbour.Space University](https://harbour.space/) initiative! You can read the details about the cooperation between [Harbour.Space University](https://harbour.space/) and Codeforces in the <a href="http://codeforces.me/blog/entry/51208">blog post</a>. The round will be **unrated** for all users and will be held on extented ACM ICPC rules. After the end of the contest you will have one day to hack any solution you want. You will have access to copy any solution and test it locally. You will be given **7 problems** and **2 hours** to solve them. The problems were prepared by Mikhail [user:PikMike,2017-11-08] Piklyaev and me. Good luck to all participants! UPD: [Editorial](http://codeforces.me/blog/entry/55701). I a...
``Geometry is the key to success in modern contests'' states Andrey Stankevich, coach of 7 ACM-ICPC

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

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

63.
Автор Lewin, 9 лет назад, По-английски
Good Bye 2017 Editorial Here's the editorial. Hope you have a happy new year! Code can be found here: https://www.dropbox.com/sh/i9cxj44tvv5pqvn/AACQs7LLNyTZT-Gt_AMf7UQFa?dl=0 <spoiler summary="New Year and Counting Cards"> Let's start off a bit more abstractly. We would like to know if the statement "if P then Q" is true, where P and Q are some statements (in this case, P is "card has vowel", and Q is "card has even number"). To do determine this, we need to flip over any cards which could be counter-examples (i.e. could make the statement false). Let's look at the truth table for if P then Q (see here: http://www.math.hawaii.edu/~ramsey/Logic/IfThen.html). The statement is only false when Q is false and P is true. Thus, it suffices to flip cards when P is true or Q is false. To solve this problem, we need to print the count of vowels and odd digits in the string. <spoiler summary="stats"> First solve: [user:ksun48,2017-12-29] at 00:01:01 Breakdown of results for submissions that passed...
This is another simulation problem with some geometry. As we push a disk, we can iterate through

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

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

64.
Автор BledDest, история, 3 года назад, По-английски
Kotlin Heroes 10 Announcement Greetings Codeforces! <img src="/predownloaded/dc/3d/dc3d601ff391e638c1f2b20ec167083978099bbe.png" style="width:400px;float:right;margin:0 1em 1em 1em;"/> First things first, we would like to thank everyone who participated in the previous nine Kotlin Heroes competitions: [Episode 1](https://codeforces.me/contests/1170,1171), [Episode 2](https://codeforces.me/contests/1211,1212), [Episode 3](https://codeforces.me/contests/1297,1298), [Episode 4](https://codeforces.me/contests/1346,1347), [Episode 5: ICPC Round](https://codeforces.me/contests/1432,1431), [Episode 6](https://codeforces.me/contests/1488,1489), [Episode 7](https://codeforces.me/contests/1533,1532), [Episode 8](https://codeforces.me/contests/1571,1570) and [Episode 9](https://codeforces.me/contests/1911,1910). Kotlin Heroes is a great way to play around with Kotlin’s features, learn something new, and practice using the language by solving fun problems. It is great for programmers of any level! We invi...

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

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

65.
Автор BledDest, 5 лет назад, По-английски
Kotlin Heroes 9 Announcement <img src="/predownloaded/dc/3d/dc3d601ff391e638c1f2b20ec167083978099bbe.png" style="width:500px;float:right;margin:0 1em 1em 1em;"/> **Given the current circumstances, we have decided to postpone Kotlin Heroes until further notice. Thank you for your understanding.** Hello, Codeforces! First and foremost, we would like to say a massive thank you to everyone who entered and submitted their answers to the eight Kotlin Heroes competitions which were held previously: [Episode 1](https://codeforces.me/contests/1170), [Episode 2](https://codeforces.me/contests/1211), [Episode 3](https://codeforces.me/contests/1297), [Episode 4](https://codeforces.me/contests/1346), [Episode 5: ICPC Round](https://codeforces.me/contest/1431), [Episode 6](https://codeforces.me/contest/1488), [Episode 7](https://codeforces.me/contest/1533), and [Episode 8](https://codeforces.me/contest/1571). Ready to challenge yourself to do better? The [contest:1643] competition will be hosted on the Codef...

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

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

66.
Автор nika-skybytska, 5 лет назад, По-английски
March Summary ## Ratings _It's always nice to see them growing._ - codeforces: 2311 + 21 = 2332 - atcoder: 2024 + 29 = 2053 - leetcode: 2701 + 81 = 2782 - dmoj: 2161 + 197 = 2358 - prepbytes: 1853 + 79 = 1932 ## Contests _A contest a day keeps mental health away._ - rated: 11 - unrated: 14 - fullsolve: 12 ## Problems _One downside of many contests is that you don't have time to upsolve properly._ - solved: 145 - upsolved: 5 - todo: 23 **Hardest problems that I solved in-contest:** - [CF #779 E &mdash; Gojou and Matrix Game](https://codeforces.me/problemset/problem/1658/E) - [ABC 245 G &mdash; Foreign Friends](https://atcoder.jp/contests/abc245/tasks/abc245_g) - [CC Start 32 &mdash; Avoid Alternating](https://www.codechef.com/problems/AVOIDALT) - [PB PT P5 &mdash; Kevin and his Operation](https://mycode.prepbytes.com/problems/bit-manipulation/KVOP) **Easiest problems that I failed to solve in-contest:** - [ARC 137 C &mdash; Distinct Numbers](https://atc...
![something](/predownloaded/3d/a0/3da038321dc99a87ce049b303116e858d524a2f3.jpeg)

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

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

67.
Автор asdasdqwer, 2 года назад, По-английски
[Tutorial] Rotating calipers technique and its applications Hello Codeforces, Before we start: Thanks to [user:bashkort,2024-09-16] for hosting this year's [Codeforces Month of Blog Posts Challenge](https://codeforces.me/blog/entry/133806) and giving me some motivation to actually finish this series. This blog is going to be about the rotating calipers technique. Apparently, it's a basic technique that can be used to solve various problems on convex polygons, however, I couldn't find a codeforces blog about it, so I just decided to write one. ### General idea behind the algorithm For the following, we are going to assume that $P$ is a convex polygon in the 2D plane with a non-negative area. Furthermore, we are going to assume that no three points of the polygon are collinear, meaning that the angle at each vertex of the polygon is smaller than $180^{\circ}$. We call a line $l$ a _line of support_ if it intersects the boundary of the polygon, but not its interior. Suppose that we have two parallel lines of support, $l_1$ and $l_2$...

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

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

68.
Автор Monogon, история, 5 лет назад, По-английски
[Tutorial] Solving Interval Problems with Geometry There are a lot of programming problems where a collection of intervals comes up, either directly or indirectly. In this tutorial, I want to present a nice way to visualize a collection of intervals, and how you can solve problems with it. An interval $[l, r]$ is just a pair of integers $l$ and $r$ such that $l\le r$. Let's make a 2D plot where the horizontal axis is $l$ and the vertical axis is $r$. Then our interval will be represented by the 2D point $(l, r)$. But an interval is more than just a pair of numbers: it describes the set of points $x$ such that $l\le x\le r$. How can we visually tell whether a number $x$ is covered by an interval? Well, we can represent it by a point $(x, x)$ in the plane. Then we can imagine that the interval's 2D point can see down and right, and the interval covers all the points it can see. Here's an example where we see how the interval $[2, 4]$ covers the points $2$, $3$, and $4$. <center> <img src="/predownloaded/60/b8/60b8b63a2b9682f...
[Tutorial] Solving Interval Problems with Geometry

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

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

69.
Автор dmkozyrev, история, 8 лет назад, По-русски
[Tutorial] Rolling hash and 8 interesting problems [Editorial] **UPD**: while I was translating this post from Russian to English, [user:dacin21,2018-07-06] wrote his post, more advanced, [link](http://codeforces.me/blog/entry/60442). I hope that my post will help beginners, but in my post more rough estimates. And in Russia we call **rolling hashes** as a **polynomial hashes**. Hello, codeforces! This blogpost is written for all those who want to understand and use polynomial hashes and learn how to apply them in solving various problems. I will briefly write the theoretical material, consider the features of the implementation and consider some problems, among them: 1. Searching all occurrences of one string of length $n$ in another string length $m$ in $O(n + m)$ time 2. Searching for the largest common substring of two strings of lengths $ n $ and $ m $ $(n \ge m) $ in $O((n+m \cdot log(n)) \cdot log(m))$ and $O(n \cdot log(m))$ time 3. Finding the lexicographically minimal cyclic shift of a string of length $ n $ in $ O(n \cdo...
We can get hash on prefixes, but what we should do with sum of geometry progression?

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

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

70.
Автор jeroenodb, 3 года назад, По-английски
The 2nd Universal Cup. Stage 21: Delft Hello everyone! I'm happy to announce the 21th stage of the 2nd Universal Cup. It will be held from February 3 to February 4. You can choose between one of seven possible time windows. Problems were authored and prepared by me. This means there will be $>0$ geometry problems. I also guarantee that there will be $>0$ non-geometry problems. I would like to thank [user:errorgorn,2024-01-31] and [user:Um_nik,2024-01-31] for testing and useful feedback, as well as all of the Universal Cup staff for hosting the contest. This contest was originally used in the Osijek Competitive Programming Camp Fall 2023. If you participated, please refrain from participating in this stage of the Universal Cup. I would also like to thank [user:adamant,2024-01-31] and [user:-is-this-fft-,2024-01-31] for organizing the camp and helping me with many small things. <spoiler summary="About Universal Cup"> Universal Cup is a non-profit organization dedicated to providing trainings for competitive program...
Problems were authored and prepared by me. This means there will be $>0$ geometry problems. I also

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

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

71.
Автор andr1y, 4 года назад, По-английски
Ukrainian Teams on IOI, BOI, EJOI, EGOI A few days ago, from 8th to 20th May, Ukrainian Selection Camp for the IOI (International Olympiad in Informatics), BOI (Balkan Olympiad in Informatics), EJOI (European Junior Olympiad in Informatics) and EGOI (European Girls Olympiad in Informatics) were held in Wrocław, Poland. Thanks to University of Wrocław and especially to [user:gawry,2023-05-22] for help in organising the selections. Contestants were very happy to visit one of the biggest Polish cities and to solve problems in one of the most modern spots for OI's in Poland. Also, I would like to thank [user:wasvlad,2023-05-22] for helping me in preparing problems for IOI and BOI selections, and to thank [user:oleh1421,2023-05-22] and [user:timreizin,2023-05-22] for preparing problems for EJOI and EGOI selections, Maryna, Sofiia and Nastya for looking after the participants and Federation of Olympic Programming of Ukraine presented by [user:BanRussiaAtIOI,2023-05-22] for coordinating the entire process. So, on **IOI**...
![ ](/predownloaded/3d/d5/3dd53c8be09077429e3cec5722a4c639a2e5c020.jpg)

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

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

72.
Автор Nakagawa.Kanon, история, 4 месяца назад, По-английски
IOI 2026 day 1 — My solutions for them ![ ](/predownloaded/77/c3/77c355894f49137e2eda44b44cc2e53a9fd7371e.png) Since there is not much discussion going on I decided to make a post about my solution for the problem, be aware that I will go straight to the full point solution and won't discuss the partial score to save time for you. I'm quite busy lately so I don't have enough time to implement the code and submit to the online judge. Please give your opinion with your comments **P1** Putting ball with a value in the leaves, it will ascend to the root as much as possible and only stop when another ball blocking them, then harvest from them the dfs order of the vertices based on the value of the ball on each vertex, then discard all the balls and begin anew. There is a limit on how many different value you can use (B) and number of them you harvest (K) that seems quite low compared to number of vertices (N ~ 1000) and leaves (M ~ 200) (B + K <= 44) An unga bunga experiment you will urge to try is simply to c...
![ ](/predownloaded/3d/e0/3de06979da97dc8a4ed4c6d0a41f478066e16133.png)

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

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

73.
Автор pani.natalia, 6 лет назад, По-английски
700 contests. ruban's interview Please meet my today's guest Anatoly [user:ruban,2021-05-17], PhD in Physics and Mathematics, who yesterday participated in his 700th contest on Codeforces. ![ ](/predownloaded/7c/d8/7cd88780306e8b25e1ac72a6e7b5b2b47914f0d0.jpg) [cut] _._ _-Hello Anatoly_ -Hello Natalia _-Were you surprised by my message that you had taken more contests on Codeforces than anybody else?_ -No, I wasn’t. I knew it for sure. There have been only several occasions when I missed rounds because of high rating, I think, not many than 20-30. _-Do you feel something special about contests with the round number like 500th, 600th or this one 700th?_ -No, I wouldn't pay any attention if there were no interview. _-How did you start on Codeforces?_ -Since 2001 (long before Codeforces) I have coached the competitive programming team of [SibSUTIS](https://sibsutis.ru/en/) &mdash; Siberian State University of Telecommunications and Information Science and created problems for All...
_-What type of contest problems do you like more?_ -My favorite topics are geometry, physics and

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

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

74.
Автор brunomont, 6 месяцев назад, По-английски
Introducing tgen: a testcase generation library <center> <img src="/predownloaded/72/82/7282f22a0748c711b1964af0315893578b0d32d5.png" style="width: 350.0px;max-width: 100.0%;max-height: 100.0%;"> <br> <i>Testcase generation for random inputs.</i> </center> Hello, Codeforces! Here I introduce **tgen**, a single-header C++ library (similar to [jngen](https://codeforces.me/blog/entry/53081)) for generating random and adversarial testcases for competitive programming problems. <center style="margin: 2em;"> <a href="https://github.com/brunomaletta/tgen" style=" display: inline-block; text-decoration: none; font-size: 18px; font-weight: 600; color: #000; background: #99ccff; padding: 0.75em 1.5em; border: 2px solid #000; border-radius: 8px; box-shadow: 2px 2px 0 #000; transition: all 0.15s ease; " > Open tgen on GitHub </a> <br><br> <a href="https://github.com/brunomaletta/tgen/blob/main/single_include/tgen.h"> ...
::print(tgen::geometry::random_simple_polygon(200, 0, 2000), '\n') << std::endl; ~~~~~, Tgen supports lists, permutations, graphs, trees, strings, math, geometry, and more. Here are some

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

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

75.
Автор OleschY, история, 5 лет назад, По-английски
Inconsistent times and TLE with C++17 (64bit) vs. C++17 Hi, while submitting [problem:1535F] for the previous educational round I did observe a strange behaviour. I submitted the **absolutely same** code several times: ![image](/predownloaded/3d/c3/3dc3326be5e1efc1f497c1a36164e8cb4958f941.png) As you can see, submitting with **C++17** was AC every single time. Submitting with **C++17 (64bit)** lead to timeouts on different testcases, like 18, 27 or 32 but also to several AC with all testcases 18,27,32 only needing <300ms in 64bit. I read my code about 20 times now checking for out of bounds errors or stupid mistakes. I have no random numbers generated. I also did several tests by generating a big number of random testcases with both 64bit and 32bit locally, but I couldn't reproduce this behaviour. I got consistent times all around. Now I'm clueless and want to ask whether someone has an idea why this happens. - AC 32bit: [submission:118502792] - AC 64bit: [submission:118503021] - TLE Testcase 18 64bit: [submission:118502885]...
![image](/predownloaded/3d/c3/3dc3326be5e1efc1f497c1a36164e8cb4958f941.png)

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

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

76.
Автор Egor, 12 лет назад, По-английски
Yandex.Algorithm Finals Hello from Berlin! Get ready for some action as participants are ready to battle for Grand Prize of 300000 russian roubles and coveted title of Yandex.Algorithm champion Stay tuned for live commentaries If you have any questions about the competition feel free to ask. Competition starts at 11:30 CET, about an hour from now. Currently participants set up their PCs -0:33 &mdash; We have quite tough field this year including ACM ICPC World Champions, TCO, GCJ and IOI winners. ~snarknews,2014-08-01 had provided some info on finalists [here](http://yandex2014.snarknews.info/index.cgi?data=yandex/2014/finalists&year=2014&contest=yandex&class=yandex2014) -0:10 &mdash; Contest is delayed for 10 minutes -0:09 &mdash; You can follow live results [here](http://contest.yandex.ru/contest/507/standings/) -0:05 &mdash; Currently contest area is filled with several journalists and cameramen 0:01 &mdash; Contest had been started, participants reading problems atm 0:11 &mdash;...
1:07 — Seems like polish participants have good 3D imagination — ~pparys,2014-08-01

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

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

77.
Автор Errichto, 17 месяцев назад, По-английски
DP Group Class in August 2025 _The blog publish date is incorrect, should be around 12.07.2025. CF saved the draft date._ Hi, I'm organizing paid group classes on Dynamic Programming in August. Last year, I did something similar with general problem-solving ([link](https://codeforces.me/blog/entry/129878)). There will be two groups of different style and difficulty. Each group gets 8 lessons of 1h30m each, from 28.07.2025 to 24-31.08.2025. Group size up to 12 people. You get access to recordings and problems from both groups, but you should actively attend only one. There's a lot of homework, some to be discussed next lesson. I will create new original CF/Polygon problems, especially for the easy group. These problems will eventually be published for everybody! **Price**: 250 EUR with a small country-based discount. **Registration**: You should pay via [link (Stripe)](https://buy.stripe.com/7sY3cx2nD5Oh8CQ7w96wE03) and choose the group there. I will send you the Discord invite link via e-mail. Co...
. I'm not sure about CHT and Aliens/Parametric search as it's more about geometry. We'll discuss it and

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

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

78.
Автор adamant, история, 2 года назад, По-английски
OCPC 2024 Fall — wrap Hi everyone! <center><a href="https://ocpc.mathos.unios.hr"><img src="https://ocpc.mathos.unios.hr/images/ocpc.svg" height="100px"></a> <a href="https://icpc.foundation/"><img src="https://ocpc.mathos.unios.hr/images/ICPC.svg" height="100px"></a></center> <center> <b>Sponsored by</b><br> <a href="https://www.janestreet.com/join-jane-street/open-roles/?type=students-and-new-grads&location=london"> <img src="/predownloaded/ee/f2/eef26616a3661c658d1545f18ed21fabb14d5871.svg" height="50px" style="margin: 5px 5px 5px 5px;"> </a> <a href="https://pinely.com/"> <img src="/predownloaded/0a/0f/0a0f3f67435d1f6e467bc7203d4a2090ba8f92cc.svg" height="50px" style="margin: 5px 5px 5px 5px;"> </a> <a href="https://quantco.com/"> <img src="/predownloaded/5d/d5/5dd574cd921167d19fb0907b542835e09e6490f4.svg" height="50px" style="margin: 5px 5px 5px 5px;"> </a> </center> Last Sunday marked the conclusion of the fourth [Osijek Competitive Programming Camp](https://codeforces.me/blog/...
-11], [user:kostia244,2024-09-11]). Prize: WEEFUN Upgraded Tina2 3D Printers! 2

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

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

79.
Автор MohammadParsaElahimanesh, история, 16 месяцев назад, По-английски
Geometry Tricks for a 5‑Year‑Old #### Hey everyone! Geometry problems can seem a bit intimidating at first $-$ with all the floating-point errors, tricky trigonometric functions, and things like dot and cross products. But don’t worry! In this short blog, I’ll show you a simple and reliable way to handle many geometry challenges using just basic integer math. No fancy templates or advanced techniques needed $-$ just a clean, straightforward approach that makes these problems much easier to manage. #### Quick review on functions: - `area2(A,B,C)`: Twice the area of triangle ABC. Equals 0 if A, B, and C are collinear. It's the basis of other functions. - `area2(P)`: Twice the area of polygon P calculated by summing triangle areas. - `in(p,P)`: Checks if point p lies inside polygon P. Compares polygon area with the sum of triangles formed with p. - `dis2(A,B)`: Squared distance between points A and B, useful for length comparisons without the square root. - `dis(l,o)`: Distance between point o and line l. Us...
Geometry Tricks for a 5‑Year‑Old, Geometry problems can seem a bit intimidating at first $-$ with all the floating-point errors

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

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

80.
Автор Lyde, история, 3 года назад, По-английски
random quotes Oh hi! Welcome to 24 random quotes! I'm a competitive programmer, but I'm also pretty much a fan and often visit here to see some recent actions. I have a pretty unusual hobby: Collecting some sentences from blogs and comments and saving them as pictures, which I could use later for memes. Later I realized that I couldn't use it that much and after 4 years, it became a collection of well, memories. So I had the idea of sharing some of it with you guys for nostalgia! Most of them are light-hearted, and all of them are pretty memorable in my mind. If you are an experienced member here you might realize some of them, so I will make it a challenge: Guess where this is from! (No prizes sadly) The spoiler to the link of the comment/blog and my personal opinion (or s/p) will be right below the quote. Anyways, enjoy. > If newcomers find it confusing, then that's their bugaboo <spoiler summary="s/p"> [Link](https://codeforces.me/blog/entry/91480#comment-800196) Still rem...
> Tourist can't compete against benq in this round, but he can make some crazy geometry problems to

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

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

81.
Автор Errichto, 8 лет назад, По-английски
After-stream thoughts Hello again. Next stream will start tomorrow (Wednesday) at 2pm CEST ([your timezone](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Errichto+Stream+%233&iso=20181003T14&p1=262)), solving problems from POI 22, round 1 ([link](https://szkopul.edu.pl/p/default/problemset_eng/oi/22)). It will be on my [Youtube channel](https://www.youtube.com/channel/UCBr_Fu6q9iHYQCh13jmpbrg). I did two streams this weekend that you can now find on my youtube [channel](https://www.youtube.com/channel/UCBr_Fu6q9iHYQCh13jmpbrg). The first with quite easy Codeforces problems that I solved from scratch (I haven't seen them before), also implementing them. The second one with a bit harder Topcoder problems that I've solved before, but I didn't necessarily remember the solution now &mdash; and for those I only described the solution, without implementation. The streams were fine but there are a lot of things to improve. I wanted to see two things: 1. Can I stream? Am I able to try to sol...
problems from POI or maybe giving a lecture about geometry. If I want to solve new problems and explain

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

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

82.
Автор ilyakrasnovv, 4 года назад, По-русски
Codeforces Round #816 (Div. 2) editorial Hello, Сodeforces! We are very grateful for Your participation in our round. Thanks to [user:Qwerty1232,2022-08-12] for the help with this editorial. [problem:1715A] <spoiler summary="Advice #0"> _Just to it. The testing system is here for the testing. Send your solution._ </spoiler> <spoiler summary="Hint #1"> If $(n; m) \neq (1; 1)$, then: - Stanley should teleport at most once - Megan shouldn't use portals at all </spoiler> <spoiler summary="Hint #2"> Stanley and Megan gonna move only toward their destinations (Stanley will increase $x$ and $y$, Megan will decrease $x$ and increase $y$. </spoiler> <spoiler summary="Hint #3"> Megan can move along one route, which is the same regardless of board size. </spoiler> <spoiler summary="Solution"> ### [problem:1715A] _For convenience let's define going upward as decreasing $x$ coordinate, downward &mdash; increasing $x$, left &mdash; decreasing $y$, right &mdash; increasing y._ One of the optimal...
. If You think of something complicated such as advanced geometry, You are probably doing something

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

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

83.
Автор LinkinPony, история, 5 лет назад, По-английски
The most disgusting contest I participated in: The 2021 ICPC Asia Regionals Online Contest (I) Just a few hours ago, The 2021 ICPC Asia Regionals Online Contest (I) was held on https://pintia.cn/. This contest(and the next on 26th) will determine the WHOLE Asia-East Division‘s quota. And how fantastic(according to some coaches) of these problems in this online contest? I upload the statement on GDrive and you can preread it here: [aec-online-i-2021.pdf](https://drive.google.com/file/d/1g5AfTLL8-9JtxbpKGv9VtO-h2_kAWqUs/view?usp=sharing) I should clarify something here: This contest doesn't have a clarification function, and some problems are from Huawei. Guess which they are! <spoiler summary="Some fantastic part of problems"> Health tips: If you just participated in this contest and your blood pressure is high, please don't continue reading. <spoiler summary="A"> What is exactly the finish time of one request? `arrival_time + processing_time` or `arrival_time + processing_time + 1`? As there is no clarification, you can only enumerate it. Enumerate question meaning ma...
, but my teammate wasted 40 minutes on geometry. Then I passed it by some stupid code. Just ignore

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

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

84.
Автор SecondThread, 6 лет назад, По-английски
SecondThread vs. galen_colin Lockout Duel (ft. neal, stevenkplus) SecondThread vs. galen_colin Lockout Duel (ft. neal, stevenkplus) ================== Good morning everyone! There are three great unsolved questions on Codeforces that every pupil dreams to one day know the answer to: - What's the best opening move when playing the Epsilon Guessing Game against a geometry problem? - How many cyans is [user:Um_nik,2020-11-27] worth, modulo $10^9+7$? - Who is *really* the 229th best programmer on Codeforces: [user:SecondThread,2020-11-27] or [user:galen_colin,2020-11-27]? While we may never know the answer to the first two, Colin and I will settle the third question once and for all this Sunday in a 1v1 duel! Don't miss it! ![ ](http://wumbogames.github.io/cfPictures/yugi.jpg) Join us at [this time on Sunday](https://www.timeanddate.com/worldclock/fixedtime.html?msg=SecondThread+vs.+galen_colin+Lockout&iso=20201129T0830&p1=234&ah=1) where we will compete head-to-head in a 1v1 lockout at https://www.twitch.tv/nealwu, with live commen...
- What's the best opening move when playing the Epsilon Guessing Game against a geometry problem

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

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

85.
Автор lnishan, 11 лет назад, По-английски
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...
floating point numbers. A must read especially for geometry topics. | | ★★☆ | [Object-Oriented C Style

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

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

86.
Автор Himalaya_, история, 10 месяцев назад, По-английски
I built a simple Grid Visualizer because I hate wasting paper Hello Codeforces! Like many of you, I struggle to visualize grid/coordinate geometry problems when I don't have a pen and paper handy. Debugging DFS/BFS paths or complex geometry on a blank screen is painful. I couldn't find a simple, lightweight tool that did exactly what I wanted, so I built CP Grid Visualizer. It's a single-file, browser-based tool to instantly plot points and lines on an infinite grid. Link: https://himalaya-pahar.github.io/cp-grid-visualization/ github repo: https://github.com/himalaya-pahar/cp-grid-visualization Features: - Infinite Grid: Handles negative coordinates and large ranges easily. - Fast I/O: Left-click to add points. Click any two points to draw a line. - Interactive: Click points to connect them with lines. - Precision Control: Switch between Snap-to-Grid (Integers) and Decimal Mode (Floats) instantly. - Safe Mode: Toggle "Allow Adding Points" OFF to lock the board and prevent accidental clicks. - Fast Edit: Right-...
Like many of you, I struggle to visualize grid/coordinate geometry problems when I don't have a pen

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

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

87.
Автор canine, история, 2 года назад, По-английски
yet another CP extension for VSCode hello all -- if you happen to be in the market for a new competitive programming extension and use VSCode, may i humbly suggest my new [extension](https://purduecpu.com/extension)? i think it is relatively feature complete, but it's still in alpha (especially for languages other than C++) and may have some kinks that need working out. it theoretically supports C++, Java, Python, and Rust (and it's very easy to add more). i created this because i was dissatisfied that most existing solutions can't import a bunch of test cases from a directory then run them in parallel. i also believe it has a cooler UI than other extensions. as usual, i didn't think it would take this long when i started... if you encounter any difficulties, please let me know on [github](https://github.com/canislupaster/cpu-vscode). **thanks for taking a look!** ![hero image](/predownloaded/f1/90/f190d6993497b2e6a93a505706e36189f5fd0200.jpg) ### Realtime Input/Output unlike other test runners for VSCode, w...
) ![Interactive Test](/predownloaded/3d /1e/3d1e440ed0628c03e3bfba1c9e214b2091d7401d.png)

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

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

88.
Автор Arpa, история, 4 года назад, По-английски
Ten years of competitive programming 3 Hey Codeforces! I’m AmirReza PourAkhavan, the former Codeforces Contest Coordinator. I let the story become complete and I’m sharing it now. The story is about a 16-year competitive programmer, who left his family and migrated to another city alone to follow competitive programming. After seven years, he advanced to the International Collegiate Programming Contest World Finals, twice. Read the previous post [here](https://codeforces.me/blog/entry/108838). **Read the Persian version** [**here**](https://docs.google.com/document/d/e/2PACX-1vSUoFC9tLgDCji6rSCYy-RYoUG1_6uOQnHz_LlLKe6KksWBYWO4r6clDly5YxIgzu1g3Tj31weDxgWz/pub). What happened previously === I was a lone programmer, in a small city, trying to learn CP and prepare for the Iran national olympiad. It was not as successful as I expected. I tried to change my school and I migrated to Tehran, alone. I entered AE high school to learn from its inspiring teachers. 11th grade === First day of school. I got to ...
class, I managed to solve a nice geometry problem, while no one else managed. Great start! But

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

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

89.
Автор Error_Yuan, 4 года назад, По-английски
Codeforces Round 896 (Div. 1, Div. 2) Editorial [problem:1869A] Author: [user:Error_Yuan,2023-09-03] <spoiler summary="Hint 1"> Indeed at most $\bf 4$ operations will be used. </spoiler> <spoiler summary="Hint 2"> If $r-l+1$ is even, and you do the operation on $[l,r]$ twice, then the subarray $a[l;r]$ will all become $0$. </spoiler> <spoiler summary="Solution"> [tutorial:1869A] </spoiler> <spoiler summary="Implementation"> ```cpp #include <bits/stdc++.h> #define all(s) s.begin(), s.end() using namespace std; using ll = long long; using ull = unsigned long long; const int _N = 1e5 + 5; int T; void solve() { int n; cin >> n; vector<int> a(n); for (int i = 0; i < n; i++) cin >> a[i]; if (n & 1) { cout << "4" << '\n'; cout << "1 " << n - 1 << '\n'; cout << "1 " << n - 1 << '\n'; cout << n - 1 << ' ' << n << '\n'; cout << n - 1 << ' ' << n << '\n'; } else { cout << "2" << '\n'; cout << "1 " << n << '\n'; cout << "1 " << n << '\n'; } return; } int main() ...
This problem is somehow related to geometry.

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

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