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

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

Results

1.
By cjj490168650, history, 4 years ago, In English
[Repost] "Justice may be delayed, but it cannot be absent": New Evidence on NXIST's Cheating Scandal _Original post: [「正义可以迟来但不能缺席」:关于 NXIST 的一些新证据](https://zhuanlan.zhihu.com/p/620297880)_ _Translated by GPT-4 with some adjustment. Please inform me if there are any mistakes._ _All links to the invalid repository have been redirected to the backup repository._ **This article provides a logically complete set of evidence, which does not involve any non-public internet resources, regarding the "suspected cheating" incident involving the ICPC Yinchuan Station and ICPC Shenyang Station in 2021. By discovering the suspected GitHub account ([NaokiLH](https://github.com/NaokiLH), renamed to https://github.com/brokenTarget) of a team member from Ningxia Institute of Science and Technology (NXIST) TS 1 team, Lan Hao, two years ago, and by mining and analyzing the commit records of his algorithm competition repo, we have obtained direct evidence that at least 4 questions from the 2021 Yinchuan regional contest set and at least 6 questions (including scrapped questions) from the 2021 Sh...

Full text and comments »

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

2.
By Alexdat2000, 5 years ago, translation, In English
Codeforces Round #770 (Div. 2) Greetings to all humans and robots on this site! [user:sevlll,2022-01-23], [user:crazyilian,2022-02-03], [user:Mangooste,2022-02-03], [user:imachug,2022-02-03] and me ([user:Alexdat2000,2022-02-03]) invite everyone to participate in the [Codeforces Round #770 (Div. 2)](https://codeforces.me/contests/1634), which will take place this [contest_time:1634]. **This round will be rated for all participants with a rating of strictly less than 2100.** You will have **2 hours and 30 minutes** to solve 6 problems. There will be an interactive problem in the round, so we recommend all new participants to read [Interactive Problems Guide](https://codeforces.me/blog/entry/45307). The traditional thank-you list: - Thanks to [user:antontrygubO_o,2022-02-03] for coordinating us for a very long time and helping to improve one of the tasks - Thanks to [user:alexxela12345,2022-02-03] for tasks that did not survive till the final version of the round - Thanks to [user:Pechalka,2022-02-03], [u...
- I can definitely solve, > - I can definitely

Full text and comments »

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

3.
By Um_nik, 8 years ago, In English
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...

Full text and comments »

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

4.
By Errichto, 8 years ago, In English
ROI 2018 in GYM Hi. On Wednesday at [9:05 CET / 8:05 UCT](https://www.timeanddate.com/worldclock/fixedtime.html?day=27&month=3&year=2019&hour=11&min=5&sec=0&p1=166) you can participate in the GYM version of the finals of 2017-2018 Russian Olympiad in Informatics (ROI), Day 1. And on Thursday there will be day 2, same time. Links to GYM contets: [day1](https://codeforces.me/gym/102147) and [day2](https://codeforces.me/gym/102154). 5 hours, 4 problems, IOI-style scoring with subtasks. Statements will be available in three languages: English, Russian, Polish. We wanted to use those problems in a camp in Warsaw so we had to import the problems to some system anyway. Then why not Polygon+Codeforces and thus allowing everybody to participate? Huge thanks to [user:MikeMirzayanov,2019-03-25] for helping me with using GYM. And credits to problem authors: [user:Andreikkaa,2019-05-21] for Radium, [user:Endagorion,2019-05-21] for Viruses, [user:pashka,2019-05-21] for Innophone, Георгий Корнее...
The case $p = 1$ is easier. To minimize the place of robot $i, minimize the place of robot $i$, we should put one active device there and nowhere else. Any other, of any robot relatively to robot $i$ (the difference between starting times)., situation of robot $i$., In version A with the device on track 1, robot $i$ will be beaten by all $j$ that $a_j + j < a_i, Now we move to the case $p = 2$. To maximize the place of robot $i$, the intuition is we should, Robot $i$ will lose against all robots $j < i$ that $a_j - j < a_i - i$. To count such indices $j

Full text and comments »

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

5.
By -Morass-, history, 9 years ago, In English
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...

Full text and comments »

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

6.
By IgorI, history, 6 years ago, In English
Codeforces Round #696 Editorial Thank you for participating in the contest! I hope you enjoyed the tasks. Here is an editorial with hints. [problem:1474A] <spoiler summary="Hint 1"> Hint $1$: Should we always make first digit of $d$ not equal to $0$? How can we do it? </spoiler> <spoiler summary="Hint 2"> Hint $2$: Try to choose such $a$ that $d$ will have $n$ digits. </spoiler> <spoiler summary="Editorial"> [tutorial:1474A] </spoiler> <spoiler summary="Solution"> [104840922](https://codeforces.me/contest/1474/submission/104840922) </spoiler> [problem:1474B] <spoiler summary="Hint 1"> Hint $1$: Integer have exactly $4$ divisors, if it is of form $pq$ or $p^3$ for some primes $p$ and $q$. In the first case it have divisors $1$, $p$, $q$, $pq$. In the second case it have divisors $1$, $p$, $p^2$, $p^3$. </spoiler> <spoiler summary="Hint 2"> Hint $2$: Instead of finding integer with at least $4$ divisors, find integer with exactly $4$ divisors. </spoiler> <spoiler summar...
Hint $1$: How many operations will robot make in the worst case, Hint $2$: How many times can robot spend $(n - 1)^2$ time on $1, Hint $3$: How many times can robot spend $(n - 2)^2$ time on $1, operations will robot make in the worst case? Hint $2$: How

Full text and comments »

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

7.
By EmeraldBlock, history, 3 years ago, In English
IOI 2023 Robot Contest in Z* = 5 [IOI 2023 Robot Contest](https://ioi2023.hu/tasks/#:~:text=robot%20%E2%80%93%20Robot%20Contest) is a great task that reminds me of Turing machines and cellular automata. <spoiler summary="If the task statement is too intimidating..."> Your goal is to program the robot _Pulibot_ to label a shortest path between the northwest and southeast corners of a 2D grid with obstacles, which are guaranteed to be reachable from each other. However, Pulibot is short-sighted and has no memory. Knowing only the colors of the cell it is at and the 4 adjacent cells (including special "colors" for out-of-bounds cells and obstacles), it has to decide what to recolor its current cell and which direction to move in (including not moving, as well as terminating). Pulibot cannot move out-of-bounds or into obstacles. Initially, all empty cells are colored "blank", and Pulibot starts at the northwest corner. After Pulibot terminates, the cells colored "path" must form a shortest path, while th...
IOI 2023 Robot Contest in Z* = 5, Your goal is to program the robot, [IOI 2023 Robot Contest](https://ioi2023.hu/tasks/#:~:text=robot %20%E2%80%93%20Robot%20Contest) is

Full text and comments »

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

8.
By ToxicPie9, 8 months ago, In English
April Fools Day Contest 2026 Editorial Thanks for participating! ### [2214A &mdash; Odd One Out](https://codeforces.me/contest/2214/problem/A) Idea: [user:flamestorm,2026-04-01] <spoiler summary="Solution"> You just need to output the arrow that only appears once. That arrow is **C2**. </spoiler> <spoiler summary="Code (Python)"> ~~~~~ print("C2") ~~~~~ </spoiler> <spoiler summary="Feedback"> - I liked it! </spoiler> ### [2214B &mdash; Are You Smiling?](https://codeforces.me/contest/2214/problem/B) Idea: [user:prvocislo,2026-04-01] <spoiler summary="Solution"> One unusual thing about the statement is the presence of a emoji. More precisely, a smiling, emoji. Okay, let's try to print a smiling emoji. However, the output should be a string of characters and numbers, so we cannot do it directly. There's one more suspicious thing in the statement &mdash; the $U+?=HAPPY$ equation. If we should print ?, what is the meaning of U? U+ often indicates that an unicod...
Because you are a robot, you must follow the [three laws of robotics, Remember, you are a robot. , all robots share a unified mind, so damage to any robot affects you as well., of robot casualties. We can compute these values using dynamic programming on the tree., ### [2214I — You Are a Robot](https://codeforces.me/contest/2214/problem/I) Credits, - $x$ is the minimum number of human casualties, - $y$ is the minimum number of robot casualties, 1. A robot may not injure a human being or, through inaction, allow a human being to come to harm., 2. A robot must obey the orders given it by human beings except where such orders would conflict, 3. A robot must protect its own existence as long as such protection does not conflict with the, If you've played the Robot game on neal.fun you should recognize what's happening pretty fast. If, This problem's source code can be found [here](https://github.com/ToxicPie/are-you-a-robot-3)

Full text and comments »

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

9.
By Error_Yuan, 15 months ago, In English
Codeforces Round 1046 (Div. 1, Div. 2) Editorial <spoiler summary="Rate the Contest!"> - Amazing round: - Good round: - Average round: - Bad round: - Horrible round: </spoiler> [problem:2136A] Idea: [user:Alan_dong,2025-08-25] Preparation: [user:Register,2025-08-25] <spoiler summary="Hint"> If one team got a score of $x$ in the first half, what is the maximum score the other team could get? </spoiler> <spoiler summary="Solution"> We can consider the first half and the second half separately. The dream might come true if and only if the scores in both halves are possible. In the second half, the RiOI team scored $(c - a)$ goals, while the KDOI team scored $(d - b)$ goals. Suppose the RiOI team scored $x$ goals in some half. Denoting the score of the KDOI team as $y$, one can see that the maximal value of $y$ is $2\cdot x + 2$, under the goal order $\tt{\color{red}K\color{red}K\color{black}RK\color{red}K\color{black}R...RK\color{red}K\color...
Try to move the robot to the top-left corner.

Full text and comments »

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

10.
By Geothermal, history, 7 years ago, In English
AtCoder Beginner Contest 158 English Solutions It's been a while since I've done one of these! --- #A &mdash; Station and Bus After parsing the problem statement, we see that we simply need to determine whether the two companies each operate at least one station, since if this is the case, those stations will be connected, and otherwise, if one company operates every station, no connections will be built. This is now a fairly easy task---one way to do it is to check whether every character in the string is the same, printing No if this is the case and Yes otherwise. Alternatively, we can directly compare $S$ to "AAA" and "BBB", rejecting if the input is one of these strings and accepting otherwise. There are a wide variety of approaches, but they're all essentially equivalent. Runtime: $O(1)$. [Click here for my submission.](https://atcoder.jp/contests/abc158/submissions/10587980) --- #B &mdash; Count Balls Given the large limits on $N, A,$ and $B$, a brute force simulation will be vastly too slow---we need...
consider adding given robot, we have two possible choices. We could avoid activating thisrobot, sorting the robots by position. Realize that each robot $i$, either directly or through a chain, Start by sorting the robots by position. Realize that each robot $i$, either directly or through a

Full text and comments »

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

11.
By nik_exists, 10 months ago, In English
Codeforces Round 1074 (Div. 4) Editorial Thank y'all so much for participating in my first Codeforces round! Special thanks to [user:AksLolCoding,2026-01-19] for suggesting a major change to problem D and [user:Intellegent,2026-01-19] for helping to rewrite the statement of problem F. [problem:2185A] <spoiler summary="Hint 1"> Fix an integer $x$, how could you find out the value of $y$? </spoiler> <spoiler summary="Hint 2"> Square both sides of the equation, for what values of $x$ is $x^2$ an integer? </spoiler> <spoiler summary="Editorial"> [tutorial:2185A] </spoiler> <spoiler summary="Code"> ~~~~~ #include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; for (int i = 0; i < n; i++) cout << i+1 << " "; cout << "\n"; } } ~~~~~ </spoiler> [problem:2185B] <spoiler summary="Hint 1"> If we were to change the problem such that you could perform as many swaps as you wanted, th...
To figure out when a robot dies, we don't need to care about the, We only care about the left-most a robot has been and the right-most a, the robot, if they exist.

Full text and comments »

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

12.
By darkkcyan, 5 years ago, In English
Codeforces Round #763 (Div. 2) Editorial In my opinion, all of the problems have a very simple solution and actually require no special data structure at all. To demonstrate the point, I will also use EvErYoNe'S fAvOrItE lAnGuAgE: **Pascal**. I will also include some notes, which are not related to the solution at all, but I find them interesting, so I will also include them in. ## [A. Robot Cleaner](https://codeforces.me/contest/1623/problem/A) Obviously, the problem is solvable using simulation. But it is solvable in $O(1)$ time as well, and I will discuss it. <spoiler summary="Tutorial">[tutorial:1623A]</spoiler> <spoiler summary="Problem note"> - Yes, I purposely make the constraint small. Firstly, the simulation solution is straightforward to think of, and I think everyone should be able to do it. But secondly, I wanted to see high-rated people suffering from going too fast :). - I hope that you like the animation! If you didn't know it yet, I use the library called [Manim](https://www.manim.community/), ...
interesting, so I will also include them in. ## [A. Robot Cleaner](https://codeforces.me/contest, ## [A. Robot Cleaner](https://codeforces.me/contest/1623/problem/A) Obviously, the problem is, ## [D. Robot Cleaner Revisit](https://codeforces.me/contest/1623/problem/D)

Full text and comments »

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

13.
By GlowCheese, 2 years ago, In English
Editorial of Codeforces Round 963 (Div. 2) [problem:1993A] <spoiler summary="Hint"> What is the pattern of Tim's answer sheet that can give him maximum score? </spoiler> <spoiler summary="Solution"> Let's say there are $n$ problems take $A$ as the answer, therefore he can only get $n$ points with the answer $A$. The same is correct for $B$, $C$ and $D$. Therefore, the maximum score can be achieved is $min(n, A) + min(n, B) + min(n, C) + min(n, D)$. Time complexity: $O(4n)$ </spoiler> <spoiler summary="Code (python)"> ~~~~~ t = int(input()) for _ in range(t): n = int(input()) s = input() print(sum(min(n, s.count(c)) for c in "ABCD")) ~~~~~ </spoiler> [problem:1993B] <spoiler summary="Hint 1"> Find a way to make all the elements even. Then odd. </spoiler> <spoiler summary="Hint 2"> In the worst case, the number of operations required is the number of even elements + 1. Why? </spoiler> <spoiler summary="Solution"> First, if all elements already have the same parity, we don'...
So apparently, we need to calculate the number of times the robot, The new path of the robot is the "mirrored" version of how the robot, keeps going without modifying the script). Then, you follow the path of each robot that is moving, the robot moves freely (no modification on the script). , , the position of the robot must be $(x, y)$ where $x$ is a multiple of $2W$, and $y$ is a multiple, Let's call $t_k = (x_k, y_k)$ how much the robot moves (in direction) after executing the first $k, The robot will execute the script $k$ times and the script contains $n$ commands, so we have $nk

Full text and comments »

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

14.
By Geothermal, history, 7 years ago, In English
Codeforces Round #575 Solutions Hi all! As I've done several times in the past, I've written up an unofficial set of solutions to Codeforces Round 575 so that some solutions will be available before system testing completes. If my code gets hacked, I'll update the appropriate problem's solution as soon as I can. --- #A &mdash; Three Piles of Candies We claim that the answer is always $\lfloor \frac{a+b+c}{2} \rfloor$. We clearly can't do any better: if Alice and Bob could each get more candies than this, then in total, they would have more than $a+b+c$ candies, which is impossible. To prove that this is always doable, let Alice take the smallest pile and Bob take the second-smallest pile. Then, distribute enough candies from the largest pile so that Alice has as many candies as Bob (which is always possible because the largest pile must contain more candies than the difference between the other two piles). Then, distribute the remaining candies from the large pile as evenly as possible. Runtime: $O(...
we process each robot, for each disabled action, we update the appropriate maximum or minimum. If, #C — Robot Breakout, Notice that for each robot individually, disabling action one means that the resulting $X$ cannot

Full text and comments »

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

15.
By employed, history, 2 months ago, In English
Editorial of DeepInfra Round 1 (Codeforces Round 1126, Div. 1 + Div. 2) thanks to [user:nifeshe,2026-10-10] for making my life easier with templates [problem:2271A] <spoiler summary = "Hints"> <spoiler summary = "Hint 1"> After performing $z$ operations, the robot's $x$-coordinate is exactly $z$. </spoiler> <spoiler summary = "Hint 2"> After completing any operation, the $x$-coordinate and $y$-coordinate always have the same parity. </spoiler> <spoiler summary = "Hint 3"> Try to find a construction to reach any point $(x,y)$ where $y\le x$ and $x$ and $y$ have the same parity. </spoiler> </spoiler> <spoiler summary = "Solution"> Notice that after performing $z$ operations, the robot's $x$-coordinate will be exactly $z$, while its $y$-coordinate cannot exceed $z$. We will first consider the case $b\le a$, then handle the special case $b=a+1$. Notice that the robot can reach any point $(x,y)$ where $0\le y\le x$ and $x$ and $y$ have the same parity in exactly $x$ operations. To do so, we can first move up until reaching $y$...
is $a+1$. - If $b>a+1$, reaching $(a,b)$ is impossible, since the robot can make at most $a+1, Notice that the robot can reach any point $(x,y)$ where $0\le y\le x$ and $x$ and $y$ have the same, Now, recall that in each operation, the robot moves vertically **before** moving horizontally, The robot visits $(x,y)$ during this operation, so the answer is $x+1$.

Full text and comments »

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

16.
By flamestorm, 3 years ago, In English
April Fools Day Contest 2024 Editorial Thank you for participating in our contest! We hope you enjoyed it. Please let us know what you thought of the problems by voting! [problem:1952A] Idea: [user:flamestorm,2024-03-31] <spoiler summary="Hint"> Have you seen the "are you a robot" boxes on websites? </spoiler> <spoiler summary="Solution"> [problem:1952A] ------------------ If you select all the squares with traffic lights and read the corresponding letters from left-to-right, top-to-bottom, you get the text "$\texttt{print safety}$". So all you need to do is print the word $\texttt{safety}$. </spoiler> <spoiler summary="Feedback"> - Based problem - Based problem - Based problem </spoiler> [problem:1952B] Idea: [user:willy108,2024-03-31] <spoiler summary="Hint"> Can you interpret the question in the title another way? </spoiler> <spoiler summary="Solution"> [problem:1952B] ------------------ You just need to check if there ...
Have you seen the "are you a robot" boxes on websites?

Full text and comments »

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

17.
By AlperenT, 4 years ago, In English
Editorial of April Fools Day Contest 2023 Thank you for participating in our contest! We hope you enjoyed it. Please let us know what you thought of the problems by voting! [problem:1812A] Idea: [user:ToxicPie9,2023-04-01] Preparation: [user:flamestorm,2023-04-01] <spoiler summary="Hint"> Have you seen the "are you a robot" boxes on websites? </spoiler> <spoiler summary="Solution"> [tutorial:1812A] </spoiler> <spoiler summary="Video Editorial"> [Video Editorial](https://www.youtube.com/watch?v=dQw4w9WgXcQ) </spoiler> <spoiler summary="Feedback"> - Amazing problem - Amazing problem - Amazing problem </spoiler> [problem:1812B] Idea: [user:BucketPotato,2023-04-01] Preparation: [user:BucketPotato,2023-04-01] <spoiler summary="Hint"> **Was** it rated? </spoiler> <spoiler summary="Solution"> [tutorial:1812B] </spoiler> <spoiler summary="Feedback"> - Amazing problem - Amazing pro...
Have you seen the "are you a robot" boxes on websites?

Full text and comments »

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

18.
By tryingoutcp, history, 11 months ago, In English
Stop Looking at Standings Story Time ------------------ It's been about a year since I started CP and reached Expert pretty fast. However, for some reason or the other, I couldn’t reach CM. I got pretty close multiple times but lost rating as soon as I was one contest away. It felt like I was collecting every 18xx rating lmao. ![LoL](/predownloaded/73/b3/73b30cc6f51728448c82e0c2d02b44b6aedb0255.png) At least in the beginning, the reason I wasn’t CM was, well, I genuinely wasn’t at that level yet. However, towards the end of the year, I felt like I was of that strength, but for some reason couldn’t convert that into the rating jump I needed. I think some of you would be able to relate to this &mdash; you feel stronger than your current rating, but can’t reach there, and maybe there’s something holding you back psychologically. Beating Psychological Pressure During a Contest ------------------ I tried to do something different in the last 2 contests I wrote to deal with pressure. Firstly, I stopped...

Full text and comments »

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

19.
By PvPro, history, 18 months ago, translation, In English
Codeforces Round 1026 (Div. 2) ### Hello, codeforces! We are glad to invite you to [contest:2110], which will start at [contest_time:2110]. This round will be rated for all participants with a rating below 2100. You will have 2 hours to solve 6 problems. The problems were prepared by [user:XaRDKoDblCH,2025-05-20] and [user:PvPro,2025-05-20]. We would like to thank everyone who made this round possible: - [user:FairyWinx,2025-05-20], for coordinating our round and preparing the problems. - [user:MikeMirzayanov,2025-05-20], [user:KAN,2025-05-20] for the Codeforces and Polygon systems. - Our army of testers: [user:N_z__,2025-05-21], [user:BurnedChicken,2025-05-20], [user:triple__a,2025-05-20], [user:makrav,2025-05-20], [user:Noobish_Monk,2025-05-20], [user:mainyutin,2025-05-20], [user:k1r1t0,2025-05-20], [user:Nil2007,2025-05-20], [user:zhiganov_v,2025-05-20], [user:sputn1k,2025-05-20], [user:lewc,2025-05-20], [user:larionov_kirill,2025-05-20], [user:Kmes,2025-05-20], [user:Dimozavr,2025-05-20], [user:po...

Full text and comments »

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

20.
By awoo, history, 8 years ago, translation, In English
Educational Codeforces Round 50 [Rated for Div. 2] On [contest_time:1036] Educational Codeforces Round 50 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>. This round will be **rated for the participants with rating lower than 2100**. It will be held on extented ACM ICPC rules. The penalty for each incorrect submission until the submission with a full solution is 10 minutes. After the end of the contest you will have 12 hours 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 invented and prepared by Vladimir [user:Vovuh,2018-09-06] Petrov, Roman [user:Ajosteen,2018-09-06] Glazov, Ivan [user:BledDest,2018-09-06] Androsov, Maxim [user...
- Knowledge understanding of robot control interface with ancillary equipment - Use ofrobot, sector - Knowledge understanding of robot control interface with ancillary equipment - Use of, the automotive manufacturing sector - Knowledge understanding of robot control interface with

Full text and comments »

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

21.
By Lewin, history, 11 years ago, In English
Wunder Fund Round 2016 Editorials I hope you enjoyed the contest! Let me know if you find any errors below. Thanks for participating. Short solutions: - Slime Combining: You can just do what's described in the statement. Or, maybe you can do something with the binary representation of the number. - Guess the permutation: Find out where 1 should go. Then, find out where 2 should go, and so on. - Constellation: Start with a triangle and break it up. Or, choose a point and look at angles. Or, sort by x coordinate. - Hamiltonian Spanning Tree: Two cases: X > Y and X <= Y. For X > Y we can almost always avoid the spanning tree edges. For X <= Y we can do something greedy. - Robot Arm: Make a segment tree on segments. A segment is basically just a linear transformation, which can be described with three numbers. - Double Knapsack: Make the problem harder. Let's say I want a consecutive sublist of both lists that have equal sums. Then use pigeonhole principle to get an answer. - Combining Slimes: Use conditional e...
we can do something greedy. - Robot Arm: Make a segment tree on segments. A segment is basically, [Robot Arm](http://codeforces.me/contest/618/problem/E) ----------------------- We can view a

Full text and comments »

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

22.
By Ahmad1, 9 years ago, In English
My graduation project: Badminton Playing Robot Hello everyone, I have been a permanent participant in competitive programming for many years now. I have been participating in ACM-ICPC for 3 years now, and managed to qualify for the world finals 2017. Now that I have graduated from the department of Computer and Automation Engineering in Damascus University, I want to share with you my graduation project: badminton playing robot. In this project I used many algorithms that I learned from competitive programming (such as BFS, LIS and of course a lot of geometry). We used LIS to filter noise data of shuttle detection and BFS,DFS to implement Indoor Location System for robot tracking and queries like sum of sub-rectangle in an array, and we didn't use any libraries for image processing. I’m so glad that I managed to use the techniques I learned from competitive programming in my project. I'm also delighted that I was able to prove wrong those who say that competitive programming isn’t applicable in practical life, since I w...
My graduation project: Badminton Playing Robot, Damascus University, I want to share with you my graduation project: badminton playingrobot. In this, System for robot tracking and queries like sum of sub-rectangle in an array, and we didn't use any, University, I want to share with you my graduation project: badminton playing robot. In this project I, our robot. Please feel free to write comments. I will be more than happy to answer any of your, **UPD:** My new robot for WRO competition: [WRO](https://youtu.be/akM8H4mN5KU), Badminton playing robot: Flying object detection, tracking and interception in real time [project

Full text and comments »

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

23.
By Errichto, 11 years ago, In English
Good Bye 2015 Editorial [problem:611A] There are two ways to solve this problem. The first is to hard-code numbers of days in months, check the first day of the year and then iterate over days/months &mdash; [http://ideone.com/4TYPCc](http://ideone.com/4TYPCc) The second way is to check all possible cases by hand. The 2016 consists of 52 weeks and two extra days. The answer for "x of week" will be either 52 or 53. You must also count the number of months with all 31 days and care about February. [http://ideone.com/Bf9QLz](http://ideone.com/Bf9QLz) [problem:611B] Each number with exactly one zero can be obtained by taking the number without any zeros (e.g. $63_{10} = 111111_{2}$) and subtracting some power of two, e.g. $63_{10} - 16_{10} = 111111_{2} - 10000_{2} = 101111_{2}$. Subtracting a power of two changes one digit from '1' to '0' and this is what we want. But how can we iterate over numbers without any zeros? It turns out that each of them is of form $2^x-1$ for some $x$ (you can c...
**CHALLENGE FOR PROBLEM F (CLEANING ROBOT)** — I was considering an alternative version of

Full text and comments »

Tutorial of Good Bye 2015
  • Vote: I like it
  • +184
  • Vote: I do not like it

24.
By wuhudsm, history, 22 months ago, In English
[Plan] Rewrite of Some Editorial Due to my poor understanding ability, I can't totally understand official editorials of some problems, even after got AC. So I plan to rewrite some of the editorials. Some principles: 1. Divide and conquer. Divide a large, hard problem into several smaller, easier problems. 2. For ease of understanding, use visual expressions as much as possible. 3. The shorter the better. If you have any other problems you'd like me to rewrite the editorial for, feel free to let me know in the comments. Also, I believe writing an editorial with your own understanding is a great way to make progress. Let's go. [1.CF #749 F](https://codeforces.me/contest/1586/problem/F) Rating: $2500$ <spoiler summary="Attempt and Insight"> Assume that the number of colors $c$ is fixed. Let $mx[i][j]$ represent the length of the continuous path ending at node $i$ with color $j$. How do we construct $mx$? Let's try some approaches. For the connected component formed by the first $k$ ...
- Robot B can follow behind Robot A. That is, Return to $(1,1)$ in two steps, then "track" A. So

Full text and comments »

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

25.
By Shayan, 21 month(s) ago, In English
Codeforces Educational Round 175 (Div 2) — Video Tutorial **Note: The text editorials will be provided by the authors of the round. This video tutorial acts as an additional resource for those who prefer video over text, not as a substitute for the text editorial.** ### [2070A &mdash; FizzBuzz Remixed](https://codeforces.me/contest/2070/problem/A) <spoiler summary="Video"> <iframe width="800" height="450" src="https://www.youtube.com/embed/Gbkgxnuo1Bo?si=Ef3UyCRdqLZdHPdu&amp;start=696" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe> </spoiler> ### [2070B &mdash; Robot Program](https://codeforces.me/contest/2070/problem/B) <spoiler summary="Video"> <iframe width="800" height="450" src="https://www.youtube.com/embed/Gbkgxnuo1Bo?si=Ef3UyCRdqLZdHPdu&amp;start=1840" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-...
— Robot Program](https://codeforces.me/contest/2070/problem/B) , ### [2070B — Robot Program](https://codeforces.me/contest/2070/problem/B)

Full text and comments »

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

26.
By fcspartakm, history, 11 years ago, translation, In English
Codeforces Round #350 (Div.2) Editorial ### [problem:670A] There are many ways to solve this problem. Let's talk about one of them. At first we need to write a function, which takes the start day of the year and calculate the number of days off in such year. To make it let's iterate on the days of the year and will check every day &mdash; is it day off or no. It is easy to show that if the first day of the year equals to the first day of the week (i.e. this day is Monday) in this year will be minimum possible number of the days off. If the first day of the year equals to the first day off of the week (i.e. this day is Saturday) in this year will be maximum possible number of the days off. ### [problem:670B] To solve this problem we need to brute how many identifiers will called robots in the order from left to right. Let's solve this problem in one indexing. Let the current robot will call $i$ identifiers. If $k - i > 0$ let's make $k = k - i$ and go to the next robot. Else we need to print $a[k]$, where $a$ is the arr...
in the order from left to right. Let's solve this problem in one indexing. Let the currentrobot, . Let's solve this problem in one indexing. Let the current robot will call $i$ identifiers. If $k - i > 0

Full text and comments »

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

27.
By aryanc403, 2 years ago, In English
Codeforces Round 963 Video Editorial (with Hints) [problem:1993A] <spoiler summary="Video editorial"> <iframe width="853" height="480" src="https://www.youtube.com/embed/TO8PszXGEz8?start=210" title="Codeforces Round 963 Solution Discussion | ABCDF1E" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe> </spoiler> [problem:1993B] <spoiler summary="Hint 1"> Sum of odd and even is odd. So we will have to remove even nos if array does not contain same parity in starting. </spoiler> <spoiler summary="Hint 2"> Most of the times we should do this type of operation - Pick maximum odd no and minimum even no and do the operation. </spoiler> <spoiler summary="Hint 3"> If you cannot do the above operation pick maximum odd no and maximum even no and do the operation. Now, you can always do the previous mentioned operation...
find the necessary and sufficient conditions when robot will be at $X=0$ and $X=W, $ instructions. Now, can you find the necessary and sufficient conditions when robot will be at, Robot will at $X=0$ when $cnt_{i} \equiv 0 \mod 2*W$. Robot

Full text and comments »

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

28.
By Lewin, 9 years ago, In English
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...
simulate the robot's movements. We have to be careful that if the robot ever gets in an invalid state

Full text and comments »

Tutorial of Good Bye 2017
  • Vote: I like it
  • +336
  • Vote: I do not like it

29.
By danilka.pro, history, 11 years ago, In English
Codeforces Round #323 Editorial **Adiv2** To solve the problem one could just store two arrays $hused[j]$ and $vused[j]$ sized $n$ and filled with false initially. Then process intersections one by one from $1$ to $n$, and if for $i$-th intersections both $hused[h_i]$ and $vused[v_i]$ are false, add $i$ to answer and set both $hused[h_i]$ and $vused[v_i]$ with true meaning that $h_i$-th horizontal and $v_i$-th vertical roads are now asphalted, and skip asphalting the intersection roads otherwise. Such solution has $O(n^2)$ complexity. Jury's solution: [submission:13390628] **Bdiv2** It is always optimal to pass all the computers in the row, starting from $1$-st to $n$-th, then from $n$-th to first, then again from first to $n$-th, etc. and collecting the information parts as possible, while not all of them are collected. Such way gives robot maximal use of every direction change. $O(n^2)$ solution using this approach must have been passed system tests. Jury's solution: [submission:13390612] *...
Such way gives robot maximal use of every direction change. $O(n^2)$ solution using this approach

Full text and comments »

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

30.
By ksun48, history, 11 years ago, In English
Editorial for CROC 2016 Elimination Round [problem:645A] --- **Idea:** [user:yummy,2016-03-18] One solution is to just brute force and use DFS to try all the possibilities. Alternatively, note that two puzzles can be changed to each other if and only if the $A$, $B$, and $C$ have the same orientation—clockwise or counterclockwise—in the puzzle. A third option, since the number of possibilities is so small, is to simply classify all of the $4!=24$ configurations by hand. <spoiler summary="Code"> ~~~~~ #include <bits/stdc++.h> using namespace std; string b, b1, b2, e, e1, e2; int main(){ cin >> b1 >> b2 >> e1 >> e2; swap(b2[0], b2[1]); swap(e2[0], e2[1]); b = b1 + b2; e = e1 + e2; b.erase(b.find('X'), 1); e.erase(e.find('X'), 1); if((b + b).find(e) != string::npos){ cout << "YESn"; } else { cout << "NOn"; } } ~~~~~ </spoiler> [problem:645B] --- **Idea: [user:ksun48,2016-03-18]** Loosely speaking, we’re trying t...

Full text and comments »

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

31.
By MinakoKojima, 13 years ago, In English
Codeforces Round #201 Editorial ![ ](http://www.shuizilong.com/house/wp-content/uploads/2013/09/1.jpg) Overview ======== In DIV 1, there are 4 interesting problems together with a normal one. We think it is reasonable because we can't have a round fullly with intelligence. Problem A, C have weak pretests while others intended to be strong. About more then 200 participants solve A in the early 45mins, then a few of them start from C while most of the other start from B. Problem B is a rather standard problem, but if you're unfamiliar with the algorithm, it can be very hard. Problem C is a more intersting problem. As the name implies, there was [a similar version](http://codeforces.me/problemset/problem/251/C) in the previous round before, but this time it has a brand new constrains.(So here we have a psychology experiment: could different constrains make people thinking in a slightly different way?ww) The standard solution of problem C is $O((b-a) + nlogn)$. The first expected correct solution was writt...
### [Problem D. Robot Control](http://codeforces.me/problemset/problem/346/D)

Full text and comments »

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

32.
By wuhudsm, history, 15 months ago, In English
TheForces Round #44 (DIV3.5-Forces) Editorial [A](https://codeforces.me/gym/106049/problem/A) Idea:[user:Muhammad-Ahmad,2025-08-22] <spoiler summary="solution"> The key observation is that the parity of the distance between Alice and Bob always changes after one move. Therefore, if $|x - y|$ is even, Alice can always move closer to Bob and corner him to win. Otherwise, Bob will win. </spoiler> <spoiler summary="code(C++)"> ```cpp #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; template <typename T> using os = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; template <typename T> using oms = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>; #define mod 1000000007 #define mod2 998244353 #define ll long long #define bl __int128_t #define pb push_back #define all(v) v.begin(),v.end() #define bs binary_search #define rall(v) v.rbegin()...
Greedily replace all '?' with 'L' or replace all '?' with 'R'. Then, check if therobot will

Full text and comments »

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

33.
By waipoli, history, 21 month(s) ago, In English
How I reached GM using Generative Functions Hello, Codeforces! In this blog, having thought of nothing better, I want to tell you a story. A story about how little Chmyaaax, even before school, was forbidden to play computer games. About how, driven by a great desire to play tanks, he started making them in Scratch. About how he moved on from Scratch to Robot, and then to Turtle. From Turtle to Pascal. About how, at the age of 10, he was introduced to competitive programming. About how, after two failed Div3 contests, he quit for two years. About how, during that time, he passionately learned C++ so he could continue making computer games (which he still wasn’t allowed to play). About how he later returned, motivated by money (the story about NEAR, where you had to reach 1600 to earn cash) (to then buy a second phone and play Brawl Stars). About how, after failing, he abandoned it again and went into commercial programming (making games). And then he came back to the sacred world, failing every TST the year before l...
moved on from Scratch to Robot, and then to Turtle. From Turtle to Pascal. About how, at the age of 10, on from Scratch to Robot, and then to Turtle. From Turtle to Pascal. About how, at the age of 10, he

Full text and comments »

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

34.
By HaccerKat, history, 20 months ago, In English
TeamsCode Spring 2025 Contest Editorial Sorry for the long wait. All problems were written, prepared, and editorialized by [user:Yam,2025-03-23], [user:hyforces,2025-04-14], [user:culver0412,2025-04-15], [user:HaccerKat,2025-03-23], [user:alexlikemath007,2025-03-23], [user:jay_jayjay,2025-03-23], [user:n685,2025-03-23], [user:Mustela_Erminea,2025-03-23], [user:Jasonwei08,2025-03-23], [user:eysbutno,2025-03-23], [user:training4usaco,2025-03-23], [user:Nyctivoe,2025-03-23], and [user:gggg0,2025-03-23]. The problems (with problem credits) can be found in the [Novice Gym](https://codeforces.me/gym/105819) and [Advanced Gym](https://codeforces.me/gym/105818). Also thanks to our testers for providing valuable feedback and to our logistics and web team for making TeamsCode possible! [Novice A/](https://codeforces.me/gym/105819/problem/A)[Advanced A: Lily Pads](https://codeforces.me/gym/105818/problem/A) ================================================================================================================= <spoi...
only care about the robot $i$ with the smallest value $a_i$ out of all the robots in this group, other than the group containing $a_1$ will have one singular robot.**, Now, we can move move all the singular robot groups to the end to maximize their $t$ values, while, [Novice L/](https://codeforces.me/gym/105819/problem/L)[Advanced E: Robot Racing](https, robot. While group $j$ has more than one robot, we can move any robot from $j$ to $a_1$'s group and not, } \right\rfloor$: the latest possible second you have to shoot this robot by. For convenience, reverse $a

Full text and comments »

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

35.
By RedNextCentury, 8 years ago, In English
Tishreen-CPC 2017 Editorial [GYM] First I would like to apologize for the error in the test cases of problem G. All solutions were rejudged and 3 teams/participants were affected, I am very sorry. Also, thanks to [user:Ashishgup,2018-09-28] for discovering the error. I hope you enjoyed the problems in general, below is a brief description of the solutions (if you need a detailed explanation of some problem write in the comments) Any feedback is appreciated :) A. Printing Books ================== While the number of digits left is enough, increase $X$ to the closest power of 10, and subtract the number of digits needed from $N$. Let's denote the number of digits in $X$ as $d(X)$ and the smallest power of 10 greater than $X$ as $p(X)$. ~~~ while (p(X)-X)*d(X) <= N N-=(p(X)-X)*d(X) X=p(X) ans+=p(X)-X ~~~ At the end, there might be some leftovers from $N$, if it is not divisible by $d(X)$, then the answer is -1. Otherwise, add $\frac{N}{d(X)}$ to ans. B. Ali and Wi-Fi =...
edges that this robot goes through. Now for each query, starting from the node that the previous query, step and store in a set the value of edges that this robot goes through. Now for each query, If a robot $x_i$ and robot $x_j$ ($x_i < x_j$) pass through a node during their movement, then

Full text and comments »

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

36.
By divyamsingal01, 6 years ago, In English
CSES Mathematics Section Tutorial So I did not find a tutorial for Maths section of CSES on codeforces, so thought of writing one. I have put all my codes on https://github.com/div5252/CSES-Problem-Set. **This tutorial covers 29 questions of Mathematics Section of CSES.** **1. Josephus Queries** <spoiler summary="Tutorial"> We will solve the problem recursively, reducing the problem by at least half at each step. If $k<\frac{n}{2}$, we can see that the answer would be $2k$. Otherwise, we have removed all the even positions. The odd positions can be renamed from $1,2,\dots,\frac{n}{2}$ and we can recursively find the solution for it. And then we can re-map back to our original $n$ by multiplying by $2$ and subtracting $1$. Time complexity is $O(logn)$. </spoiler> <spoiler summary="Code"> ~~~~~ ll f(ll n,ll k) { if(n==1) return 1; if(k<=(n+1)/2) { if(2*k>n) return (2*k)%n; else return 2*k; } ll temp=f(n/2,k-(n+1)/2); if(n%2==1) return 2*temp+1; ...
We do something like brute force here. Consider a robot on a single

Full text and comments »

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

37.
By Hasan0540, history, 10 years ago, In English
[ GYM Tutorial ] 2016 ACM Amman Collegiate Programming Contest ### [A. Coins](http://codeforces.me/gym/101102/problem/A) Instead of having one DP table that combines all states for both Hasan and Bahosain, and having too many parameters (and therefore, huge complexity), we can build two tables, one for each person. Let $A[0][i]$ be the number of ways in which Hasan can pay $i$ dollars using all coins from index $0$ to the end, and $B[0][i]$ similar but for Bahosain, then we can compute the final answer by using these two tables as follows: ~~~~~ for (int hasan = 0; hasan <= W; ++hasan) { int bahosain = W - hasan; if (abs(hasan - bahosain) <= K) res += A[0][hasan] * B[0][bahosain]; } ~~~~~ Building each table is a simple DP problem. Complexity: $O((N+M)*W)$ ### [B. The Little Match Girl](http://codeforces.me/gym/101102/problem/B) Instead of trying to move some sticks as the problem suggests, let's count the total number of matchsticks we have and build the maximum possible number of $N$ digits using all thes...
### [I. Simple Robot](http://codeforces.me/gym/101102/problem/I)

Full text and comments »

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

38.
By MathModel, history, 21 month(s) ago, In English
Invitation to Robocontest Round 103 (PI DAY !) ### **Hello Codeforces!** ------------------ _**MathModel Setting Tour Continues!**_ I'm glad to share my tour of problem-setting with you! Recently, I have been setting problems for multiple platforms such as **CodeForces Gym, CodeChef, KEP**, and more is coming $!$ --- We are happy to invite you to **[RoboContest Round #103 (3.14)](https://robocontest.uz/olympiads/2619)**, which will take place on **[Friday, March 14, 2025, at 17:30 UTC](https://www.timeanddate.com/worldclock/fixedtime.html?day=14&month=3&year=2025&hour=17&min=30&sec=0&p1=166)**. &#128197; **Duration:** $3$ hours. &#128221; **Number of Problems:** $9$ &#128200; **Rated for All on RoboContest** &#128526; **Statements Avialable in English , Uzbek and Russian** #### **The Round Maintaining Team:** - &#127942; **[user:devasadbek,2025-03-07]** & **[user:rshohruh,2025-03-07]** – Coordinators - &#9997; **[user:MathModel,2025-03-07]** , [user:Timosh,2025-03-07] and [user:behruzbekx...

Full text and comments »

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

39.
By miaowtin, 4 years ago, In English
Lattice paths and Lindström–Gessel–Viennot lemma In August 2022, I had a talk concerning lattice paths at a summer programming school in Khust, Ukraine. After, I realised that some aspects of my talk aren't well-known in the CP community and, in this blogpost, I'd like to very briefly and untidily (so feel free to ask for additional explanations by comments) share the main points of that talk. I hope that ideas presented in the blog will help you sometime. **1. Lattice paths** **1.1. Walks without restrictions.** **1.1.1.** We start from a rudimentary example. Consider a $N\times M$ grid and a robot (or a chip, or a ship, or anything else you wish) at $(0,0)$ (not a cell, an intersection point) which can move in the east unit direction and in the north unit direction. A route that the robot is able to make is said to be northeastern. How many northeastern paths are there? In fact, We can bijectively code any path with a corresponding string of the form $\uparrow\rightarrow\rightarrow\rightarrow\uparrow\rightarrow\dots$ o...
**1.1.1.** We start from a rudimentary example. Consider a $N\times M$ grid and arobot (or a chip, \}$). Then, the robot can make steps which are from the orthonormal basis i. e. $\mathbf{e}_1=(1,0,\dots,0

Full text and comments »

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

40.
By DanAlex, 13 years ago, In English
Geometry shrink trick Hello ! This week I will present you some geometry problems. As the last week you'll have the statements first and the solutions below. I would also like to hear your feedback about my blog. Enjoy reading ! Statements ------------------ ### [Hallway](http://www.infoarena.ro/problema/hallway) This problem is from a Romanian judge. I will present the statement in English. Basically you have a hallway of size M*N. There are K columns at integer coordinates. Your task is to say the maximum size of a ball that can travese the hallway in such way that is doesn't get stuck. Restrictions: 1 ≤ M, N, K ≤ 1000 , print the result with 8 decimals rounded down. ### [Robot](http://www.infoarena.ro/problema/robot) From the same Romanian judge. You have a robot consisting of a N-polygon ( N<=10 ). Your robot position is defined as the point with the minimum y and ( in case of equality ) the minimum x. You have M ( M<=25 ) polygon obstacles with less than 251 points. Your task is to ge...
### [Robot](http://www.infoarena.ro/problema/robot), : 1 ≤ M, N, K ≤ 1000 , print the result with 8 decimals rounded down. ### [Robot ](http, From the same Romanian judge. You have a robot consisting of a N-polygon ( N<=10 ). Yourrobot, If you read the post until here , you probablly expect the robot to be shrinked. You're right, ],robot[0],robot[k]) ); convex_hull( obstacle[i] ); } } ~~~~~

Full text and comments »

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

41.
By UTPC_Admin, history, 3 years ago, In English
UTPC April Fools' Contest 2024 Editorial Hello everyone! Hope you enjoyed our contest, this was our first time making a contest in this fashion. Hopefully we will have many more years :) [A – Are you a Robot?](https://codeforces.me/gym/105071/problem/A) Author: [user:blueberryJam,2024-04-02] <spoiler summary="Solution"> The answer is `No`. We would also accept the full CAPTCHA, $$JR5JNYNJSABN03BIELLEQ9PA9REEUXO5DXSA4C5S$$ $$U6A9SXD2A2VR00B5SUWPX38ONBR9THZ8Y80Q18Z$$ $$JI4ESKAWMU7MX5K33EAFXPR7323LP4DMTI3YSZL2$$ $$4EIUYBZJBHD7OVF6GEIE28JUQVILEIWWDM8RHKZ8$$ for those who have the patience to type it out. </spoiler> <spoiler summary="Feedback"> - Good problem - Amazing problem - Best problem ever </spoiler> [B – Working Out](https://codeforces.me/gym/105071/problem/B) Author: [user:sg2themax,2024-04-02] <spoiler summary="Solution"> Simple dad joke: anything containing "codeforces gym" works as a valid output (including the URL, or just the ph...
[A – Are you a Robot?](https://codeforces.me/gym/105071/problem/A)

Full text and comments »

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

42.
By jay_jayjay, history, 15 months ago, In English
Teamscode Summer 2025 Contest Official Editorial Thanks for participating in TeamsCode, and I hope you enjoyed the problems! All problems were written and prepared by [user:hyforces,2025-08-20], [user:Yam,2025-08-20], [user:culver0412,2025-08-20], [user:alexlikemath007,2025-08-20], [user:Jasonwei08,2025-08-20], [user:n685,2025-08-20], [user:HaccerKat,2025-08-20], [user:jay_jayjay,2025-08-20], [user:feining_for_gm,2025-08-20], [user:Mustela_Erminea,2025-08-20], [user:eysbutno,2025-08-20], [user:furyna,2025-08-20], [user:iframe_,2025-08-20], [user:Nyctivoe,2025-08-20], [user:TheYashB,2025-08-20], [user:gggg0,2025-08-20], [user:training4usaco,2025-08-20], [user:ThatRowletOwlet,2025-08-20], and [user:superhelen,2025-08-20]. Also thanks to our testers for valuable feedback, and the Teamscode web and logistics teams for making this contest possible! Also thanks to [user:omeganot,2025-08-24] for writing an unofficial editorial [here](https://codeforces.me/blog/entry/145620). [Novice A/](https://codeforces.me/gym/106042/proble...
\text{INF}$, then the robot in $x$ can push the robot in $y$ to cell $z$ (if cell $z$ is not an, robots required to get one robot on cell $(i, j)$. At the start, if cell $(i, j)$ is a spawn point $A

Full text and comments »

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

43.
By robot-dreams, history, 8 years ago, In English
Improving efficiently: beyond "just solve more problems"? I'm interested in improving efficiently, and the main advice I see (on blogs, comments, CP Discord, etc.) is "solve more problems". For someone who's not solving any problems yet, this is great advice. Additional detail seems unhelpful because getting started is WAY more important than nitpicking and prematurely worrying about efficiency. **But how can someone who's already solving a lot of problems improve more efficiently?** I have a lot of unanswered questions about this: #### How should we choose problem difficulties? Someone who's already Expert probably won't get to the next level by solving 500 problems that are all Div2A. I often hear "solve problems that are slightly above your current level", and once again this is great advice. But it's important to sometimes mix in "easy" problems for practicing speed and staying motivated. How should we balance the two? #### How should we choose problem topics? I've heard arguments for choosing problems randomly, but...
robot-dreams

Full text and comments »

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

44.
By grecil, history, 17 months ago, In English
[Tutorial] Using Complex Numbers for Grid Movement Problems Problems involving movement on a grid can be solved using tuples/pairs of the form (x, y). However, doing addition/subtraction of pairs/tuples is not supported by default. One alternative to this is using complex numbers. Using complex numbers for geometry is not a new idea. You can read more about it in this [blog](https://codeforces.me/blog/entry/22175). I will not go into the more "geometric" side of things. My aim here is to make you guys feel comfortable with using complex numbers instead of pair/tuples in grid-related problems. I code in Python and for the better understanding of readers, I used AI to convert those codes to C++. We have to keep few things in mind when using std::complex in C++. Certain methods such as std::polar() and std::abs() don't work when you use complex with integral data types (int, long long etc.). They only work with FP datatypes (float, double, long double etc.). You can still use std::complex with integral datatypes if the use case is limited...
— Robot Sequence](https://codeforces.me/contest/626/problem/A) This problem asks how many, ## 1) [CF 626A — Robot Sequence](https://codeforces.me/contest/626/problem/A), ## 3) [CF 1296C — Yet Another Walking Robot ](https://codeforces.me/contest/1296/problem/C), ## 4) [CF 1073C — Vasya and Robot ](https://codeforces.me/contest/1073/problem/C), ## 5) [CF 1902D — Robot Queries](https://codeforces.me/contest/1902/problem/D), This problem asks how many contiguous command subsequences bring the robot back to its starting, This problem asks us to find the minimum length contiguous subsegment of robot commands that we, This problem asks whether a robot visits a target point when executing commands with a specific, We track the robot's cumulative position after each move using prefix sums. If therobot reaches, robot still ends at the same final position. The key insight is that removing a substring between

Full text and comments »

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

45.
By haleyk100198, history, 10 years ago, In English
[UNOFFICIAL] Codeforces Round 389 Div.2 problem analysis Merry Christmas everyone As the editorials of Technocup rounds usually comes later than expected, I hope that this problem analysis could help out whose wants the questions immediately. Div2A: [Santa Claus and a Place in a Class](http://codeforces.me/problemset/problem/748/A) This is a trivial implementation question, by a bit math we could derive that: Number of row: (k-1) // (2*m) Number of desk: ((k-1) mod (2*m)) // 2 ( x // y means the integral part of x/y ) And the side of the desk solely depends on the parity of k, as each row has even number of desks. [C++ solution:](http://codeforces.me/contest/752/submission/23288096) Div2B: [Santa Claus and Keyboard Check](http://codeforces.me/problemset/problem/752/B) We could solve the question by saving the status of the keys, i.e. not pressed, swapped in pairs, or confirmed in original position, initially all keys have the not pressed status. When iterating through the pattern, if we’ve found out that t...
/submission/23299938) Div2C: [Santa Claus and Robot ](http://codeforces.me/problemset/problem/752/C, Div2C: [Santa Claus and Robot](http://codeforces.me/problemset/problem/752/C), Intuitively, we can tell that if the robot changes the vertical / horizontal direction, then the, One of the way to approach this question is by keeping whether the robot is free to change it’s

Full text and comments »

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

46.
By MidnightCodeCup, 5 months ago, In English
Midnight Code Cup Finals 2026: Problems, Winners and More This weekend concluded the second Midnight Code Cup: 24 hour final round took place in Belgrade on July 4-5. <br /> 29 teams competed for the champions title, team members coming to Serbia from 20 different countries. ![ ](/predownloaded/89/70/89701277a496498890a22d1f4e0582e6364761cb.jpg) Credits -------- The champions: team taxi confidently took the lead and performed strongly throughout the whole round. A close game was played in the rest of the top places up until the end, teams superfight and itmo_1.2017 ended up taking second and third place respectively. Final results: https://2026.midnightcodecup.org/standings/ <br /> Problems: https://2026.midnightcodecup.org/problems/ <br /> First Photos (more will be added to the same folder later): [Folder](https://drive.google.com/drive/folders/1-WMYJ8we8XEA0dY55QYuPR41YYK8RGVE?usp=sharing) <br /> Instagram: https://www.instagram.com/midnightcodecup <br /> X: https://x.com/midnightcodecup <br /> Amazing Jury: [user:Aks...

Full text and comments »

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

47.
By Gassa, history, 10 years ago, translation, In English
Codeforces Marathon Round 1 Hi all! I invite you to take part in Codeforces Marathon Round 1. It is an unrated contest in which the participants will have to solve one problem as best as they can. The problem is presumed not to have a fast full solution. A score is given for each individual test according to the quality of the answer found. The goal is to get the highest total score. The contest will go on for 10 days. The start time is [June 12 at 12:00 MSK](http://www.timeanddate.com/worldclock/fixedtime.html?msg=Codeforces+Marathon+Round+1&iso=20160612T12&p1=3905). During the main phase of the contest, solutions will be checked on examples and preliminary tests. After the main phase is over, the final solution of each contestant will be checked on the final test set, and the total score for this test set will determine the final scoreboard. The 10 top scoring participants, as well as 10 random participants who achieve a good enough score, will get T-shirts. The contest is supported by Code...
any of the preliminary tests. Who will help the robot? If you did not yet try, it is easy to start, preliminary tests. Who will help the robot? If you did not yet try, it is easy to start: in the

Full text and comments »

Announcement of Codeforces Marathon Round 1
  • Vote: I like it
  • +221
  • Vote: I do not like it

48.
By RedNextCentury, 10 years ago, In English
[Gym Contest Editorial] HIAST Collegiate Programming Contest 2016 ## Cards We notice that the second box includes only even numbers , because all numbers in it are in the form `2X` - if the number is odd it's obviously in the first box . - if the number `X` is even then `X` and `X/2` will not be in the same box . So we can keep dividing the number on 2 until we get an odd number which is obviously in the first box, After that we can easily compute the answer depending on how many times we divided the number until it became odd . Total Complexity: **O(log(Q))** Problem by: [user:AHMED_GAFER,2016-08-11] ##RGB plants Since `n` is very large, we have to find a fast way to calculate the answer. We can notice that after each day, we can calculate the number of each one of the flowers `New`, based on the number of the flowers on the day before `Old`, like the following: - The number of red flowers would be equal to `NewRed = OldRed*1 + OldGreen*4 + OldBlue*7`. - The number of green flowers would be equal to ...
intersect with the $X$ axis in a point which is the center of the circular path of therobot , it is, - if $v_r = v_l$ then the robot is moving forward in a straight line and the coordinates of the, - if $v_r \ne v_l$ then it can be proven that the robot is moving around a point in a circular path, Now rotate $C(0,0)$ (the center of the robot ) around $P$ by angle $Q$ degrees clockwise if $v_l

Full text and comments »

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

49.
By Egor, 16 years ago, translation, In English
Codeforces Beta Round #24 solutions <h2>Task A</h2><div>This is pretty simple task - we have cycle and must direct all edges on it in one of 2 directions. We need to calculate cost of both orientation and print smallest of them.</div><div>There is a small trick - we can calculate cost of only one orientation and then cost of the other will be sum of costs of all edges minus cost of first orientation.</div><div><br></div><div>[cut]</div><h2>Task B</h2><div>Also very simple - we need literary do what we asked. We put all data in a map where for each pilot we have number of points and array of 50 elements - number of times pilot finished at corresponding place. Then we just need to find maximum in this array according to 2 given criteria.</div><div><br></div><h2>Task C</h2><div>Reflection over 2 points is just a parallel shift for a doubled vector between them. So $M_{2n}$ = $M_0$ because sequence of reflections may be replaced with sequence of shifts with doubled vectors $A_0 A_2$, $A_2 A_4$, ..., $A_{n - 2} A_0$ - and the...
Task D If robot is at last row then answer is 0. Suppose that for every cell of the

Full text and comments »

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

50.
By harshuiui, history, 17 months ago, In English
Robot Positions ### Problem Statement: N robots are standing in a line consisting of N squares numbered from 1 to N. Initially, the ithith robot is standing on the ith square. Each square has a letter 'L' or 'R' written on it. After 1 second, each robot moves one unit in the left direction if its square has the letter 'L' and moves one unit in the right direction if its square has the letter 'R'. It is guaranteed that the letter on the leftmost square is always 'R' and on the rightmost square is 'L'. You are given a string S of length N denoting the letter written on each square. You must determine how many robots would stand on each square after 10^5 seconds. Output a string of length N, where the ith character represents the number of robots on the ith square after 10^5 seconds. Input Format * The first line contains a single integer TT, the number of test cases. For each test case: * A single line containing the string SS of length NN. Output Format Output a single line for each test case:...
Robot Positions, to N. Initially, the ithith robot is standing on the ith square. Each square has a letter 'L' or 'R, robot is standing on the ith square. Each square has a letter 'L' or 'R' written on it. After 1

Full text and comments »

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

51.
By craus, 11 years ago, In English
Codeforces Round #335 Problem Analysis [problem:606A]. Let’s count how many spheres of each type are lacking to the goal. We must do at least that many transformations. Let’s count how many spheres of each type are extra relative to the goal. Each two extra spheres give us an opportunity to do one transformation. So to find out how many transformations can be done from the given type of spheres, one must look how many extra spheres there are, divide this number by 2 and round down. Let’s sum all the opportunities of transformations from each type of spheres and all the lacks. If there are at least that many opportunities of transformations as the lacks, the answer is positive. Otherwise, it’s negative. [problem:606B]. Let’s prepare a matrix, where for each cell we will hold, at which moment the robot visits it for the first time while moving through its route. To find these values, let’s follow all the route. Each time we move to a cell we never visited before, we must save to the corresponding matrix’ cell, how many a...
wasn’t visited by robot, add one variant of N actions, where N is the total length of the route. If it, robot visits it for the first time while moving through its route. To find these values, let’s follow

Full text and comments »

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

52.
By erniepsycholone, 3 years ago, In English
Codeforces Round 929 (Div. 3) Editorial [problem:1933A] Idea: [user:snowysecret,2024-02-29], prepared: [user:snowysecret,2024-02-29] <spoiler summary="Tutorial"> [tutorial:1933A] </spoiler> <spoiler summary="Solution"> ~~~~~ #include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; vector<int> arr(n); for (int i = 0; i < n; i++) { cin >> arr[i]; } int sum = 0; for (int i = 0; i < n; i++) { sum += abs(arr[i]); } cout << sum << endl; } return 0; } ~~~~~ </spoiler> [problem:1933B] Idea: [user:snowysecret,2024-02-29], prepared: [user:snowysecret,2024-02-29], [user:erniepsycholone,2024-02-29] <spoiler summary="Tutorial"> [tutorial:1933B] </spoiler> <spoiler summary="Solution"> ~~~~~ #include<bits/stdc++.h> using namespace std; int main(){ int t; cin>>t; while(t--){ int k; cin>...
View the task in a relative perspective, with robot RT and the ending

Full text and comments »

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

53.
By zxqfl, history, 11 years ago, In English
SRM 682 Unofficial Editorial ### Div2 Easy The size of the input string is small, so we can iterate over all the substrings and find the largest substring consisting of the characters A, C, G, and T. The complexity of this approach is $O(n^3)$. You could solve it in $O(n)$ using the two-pointers method. ### Div2 Medium I claim that the answer will always have at most 6 characters. There are at most $n$ substrings of length 6 of a string of length $n$. The length of the input string is at most 2000. But there are $4^6=4096$ possible DNA sequences of length 6, so at least one of them isn't contained in the string. That means that we can afford to iterate over all possible answers, in increasing order of length. We will try at most $2000+1024+256+16+4$ strings, and checking each string will take $O(n\log n)$ time, so the algorithm is $O(n^2\log n)$. I think this algorithm is actually $O(n^2)$ because it is hard to induce worst-case behaviour in the string-checking algorithm, but I haven't proved it. ...
have $j$ changes available, and the robot is currently at (0, 0). Then, we iterate over how many moves, the string, we have $j$ changes available, and the robot is currently at (0, 0). Then, we iterate

Full text and comments »

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

54.
By MrMoon, 4 months ago, In English
PSUT JCPC Qualification 2026 Tutorial Hints are mostly related, so you have to think and get some observations before understanding the next, make sure to understand the code before you submit it as well, "Most problems in life are due two reasons: act without thinking, think without acting" ~the,2026-08-02 poet,2026-08-01 Big thank you to the testers for improving this problem set beyond what it was, [user:the_seal,2026-08-02] , [user:Rayo,2026-08-02], [user:samsoom,2026-08-02], [user:lazlooz,2026-08-02] The contest exist in the group so make sure to join https://codeforces.me/group/ppRciMeJFg Some of these problems were inspired from other problems across the internet, "If I have seen further, it is by standing on the shoulders of giants." ~the,2026-08-02 poet [Problem A: MrMoon creates Lucky Number Seven Command](https://codeforces.me/group/ppRciMeJFg/contest/707652/problem/A) ================== ### 7 [Problem B: Moon creates seal backflips](https://codeforces.me/group/ppRciMeJFg/contest/707652/probl...
"breathing room" as possible for everything else. If a special robot is due at hour 5, scheduling it at hour, 2) is incredibly valuable. If a robot has a deadline of hour 100, we could build it at hour 1, but, Once the exact hours for every special robot are locked in, the, each robot to the absolute latest available hour that is less than or equal to its deadline. 1. If, given hour, we know exactly how many workbenches are free: If a special robot is scheduled that hour, we, largest. 1. Start a clock at hour 1. 1. Assign: Take the most urgent normal robot and assign it to an, slots, we guarantee that the maximum volume of early workbench slots remains open. If a normalrobot, If you successfully assign every normal robot without the clock ever exceeding a deadline, the

Full text and comments »

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

55.
By chromate00, 3 years ago, In English
English Editorial for The 3rd Chromate Cup Algorithm Division Thank you everyone for participating in The 3rd Chromate Cup Algorithm Division! The full problemset can be accessed on [(link)](https://www.acmicpc.net/category/detail/4114) for upsolving. Also the profile badge/backgrounds are being a bit delayed, I am too busy ;-; [A. Strange Shuffle](https://www.acmicpc.net/problem/31215) <spoiler summary="Hint"> Simulate until you feel confident, e.g. until $n=10$. What do you see? I think the result should give you confidence. </spoiler> <spoiler summary="Solution"> Let us think step by step starting from $n=1$. - If $n=1$, $n=l$ is true, therefore no swap will happen. - If $n=2$, $n=l$ is true, therefore no swap will happen. - If $n=3$, $l=1$, so $B_1$ and $B_3$ are swapped. Now $1$ is on index $3$. - If $n>3$, $l$ is a power of $2$, and is therefore not $3$. The index of $1$ never changes afterwards. Therefore, if $n\le 2$, the answer is $1$. Otherwise, the answer is $3$. </spoiler> [B. Super Primes](https://www.acmicpc...
Each time the lawn mower robot mows a cell of grass, $\mathcal{O}(1)$ time is used. Also, whenever

Full text and comments »

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

56.
By Igor_Kudryashov, 13 years ago, translation, In English
Codeforces Round #237 (Div. 2) Editorial [problem:404A] In this problem it was needed to check the constraints described in statement. You can use two sets here. You should insert diagonal elements of matrix into the first set, and the other elements into the second. Element $a_{i,j}$ belongs to the main diagonal if $i = j$ and belongs to the secondary diagonal if $i = n - j + 1$. After you split all elements into sets you should check if the sets sizes are equal to one and the elements from this sets differ from each other. [problem:404B] Let's notice that after Valera run $4 \cdot a$ meters he will be in the same point from which he started. Valera will have run $i \cdot d$ meters before he gets $i$-th bottle of drink. Let's calculate the value $c = \lfloor \frac{i \cdot d}{4 \cdot a} \rfloor$ &mdash; how many laps he will run. Then he have already run $L = i \cdot d - c \cdot 4 \cdot a$ meters on his last lap. It is easy to get Valera's position from this $L$. For example, if $2 \cdot a \le L \le 3 \cdot a...
in the same manner. [problem:404E] Let's consider the case when the last move of therobot is, the cell with number $b < 0$ and robot completed its instructions successfully. Notice, that in, Let's consider the case when the last move of the robot is equal to "R". If the last move is equal, Let's now check if Valera can do without obstacles. If so the robot won't skip moves and will stop

Full text and comments »

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

57.
By Uzumaki_Narutoo, history, 19 months ago, In English
Sharing my experience with Odoo Hi Codeforces, Based on my knowledge Odoo is hosting the IOPC (International Odoo Programming Contest) here, and most likely they are making hiring campaigns based on the ranks. So I wanted to share my interviewing experience with them to give you insights about how dealing with their recruiters look like. My interview experience with Odoo: 1.  I submitted the assessment. 2.  After a couple of weeks I got the chance to have a meeting with Tatiane Dussart (their recruiter) . 3.  After a couple of days Tatiane Dussart (their recruiter) sent me an email that after our call one of the developers reviewed my code in more detail and they have decided that my technical level isn't enough to move forward (as she said). 4.  after some days, she sent me an email that they mixed 2 tests internally (with another Ahmed) and she invited me to the last minute slot which is the day after this day at 1:30pm. 5.  I told her, Okay, I'm available. She scheduled the meeting ...

Full text and comments »

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

58.
By MikeMirzayanov, 8 years ago, In English
Harbour.Space University and Remy Robotics: Master's in Robotics programme scholarship <img src="https://assets.codeforces.com/images/artboard-2_1.png" style="float:right; margin: 0 1em 1em 1em; width:450px;"/> My friends from Harbour.Space and Remy Robotics asked to publish the news. I am excited and glad to do it, because for our community this is a true exclusive offer. In short, they offer to study robotics in Barcelona, paying for your studies and even with a scholarship! It's so cool! Here is a direct speech from Harbour.Space. = Hi Codeforces! We are excited to announce our new Master’s in Robotics programme scholarship, which will be paired alongside an internship with our partner Remy Robotics! The programme will begin on January 7th, 2019, at our university in Barcelona, Spain. Harbour.Space’s Robotics programme is the bridge between a personal interest in the world of Robotics, Artificial Intelligence, and a top-level professional future in one of the most exciting and fastest growing fields of technology. Students who enter the programme w...
* Knowledge understanding of robot control interface with ancillary equipment * Use ofrobot, manufacturing sector * Knowledge understanding of robot control interface with ancillary equipment

Full text and comments »

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

59.
By SnowLucario_Z, history, 4 years ago, In English
A Recap of My First Year in CodeForces Hello all on Codeforces! ------------------ It’s been just over a full year since I created my Codeforces account. Since then a lot has happened on my Codeforces journey so far. With everything that’s happened I want to look back at how I got to my current point, share what I learned in the process, recap some of my best moments, and laugh at whatever I was thinking on a few of these contests, because a lot happened. The only issue is that there’s no way I’m going to detail all **60** contests I took part in 2022. Instead I’ve chosen to “award” the 9 most memorable contests, wheter it be because I did exceedingly well or self destructed in almost hilarious fashion. A few notes before I begin: No full solutions for any problems are shown in this post but there are code snippets and discussions that are spoilers for these problems. I apologize in advance. ### First Contest &mdash; [Hello 2022](https://codeforces.me/contest/1621) This was the first contest held in 2022, ...
this is the case then the robot can try moving as far up as possible, then move to the correct

Full text and comments »

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

60.
By lucifer1004, history, 6 years ago, In English
My Editorial for Google Kick Start 2020 Round F [中文版 | Chinese version](https://cp-wiki.vercel.app/tutorial/kick-start/2020F/) ## Problem A &mdash; [ATM Queue](https://codingcompetitions.withgoogle.com/kickstart/round/000000000019ff48/00000000003f4ed8) It takes a person $\left\lceil\frac{A_i}{X}\right\rceil$ rounds to withdraw $A_i$. So we can turn $A_i$ into pairs $(\left\lceil\frac{A_i}{X}\right\rceil, i)$, then sort the pairs to get the final sequence. Total time complexity is $O(N\log N)$ since we need to sort. <spoiler summary="Code (C++)"> ~~~~~ #include <algorithm> #include <cstdio> #include <iostream> #include <vector> using namespace std; template <typename T> void read(T &x) { x = 0; char c = getchar(); T sig = 1; for (; !isdigit(c); c = getchar()) if (c == '-') sig = -1; for (; isdigit(c); c = getchar()) x = (x << 3) + (x << 1) + c - '0'; x *= sig; } class Solution { public: void solve(int case_num) { printf("Case #%d: ", case_num); int n, x; ...

Full text and comments »

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

61.
By stgatilov, history, 10 years ago, translation, In English
First tour of Wide-Siberion Olympiad (2016) This year contestants implemented AI to manage robotic vacuum cleaners. The game has massive-multiplayer style, which is strongly different from our previous games, which were usually either single-player (e.g. [in 2010](https://www.youtube.com/watch?v=GwdrpD7SRng)) or player-vs-player (e.g. [in 2013](https://www.youtube.com/watch?v=WbNQp144eEk)). All 50 participating teams compete altogether in every game. Each player manages 10 robots, which drive on the round field. If a robot collides with another smaller robot (or with passive immobile "food"), then the former devours the latter, and its area is increased by the area of the devoured object. The player who devours everything wins (this surely happens since game field is gradually contracting). Game score of arbitrary player is defined as the overall area of all his robots at the best (for him) time moment. As size of robot increases, its speed decreases. That's why the game has turbo mode, which allows to double robot speed fro...
field. If a robot collides with another smaller robot (or with passive immobile "food"), then the, in every game. Each player manages 10 robots, which drive on the round field. If arobot collides

Full text and comments »

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

62.
By drazil, history, 10 years ago, In English
Weekly Training Farm #26 Editorial 我們發現中文有一些顯示問題,之後會再處理。 The Chinese version has some display issue with latex for now. A. Numbers If $D > 0$, then there are at most $D - 1$ integers between the $X$-th largest integer and the $X$-smallest integer. So the answer would be $2X + D - 1$. If $D = 0$, then the $X$-th largest integer is the exactly same integer as the $X$-smallest integer. So the answer is $2X - 1$. If $D < 0$, then the case with the largest number of integers would be: the $X$-smallest integer is the very next integer larger than the $X$-largest integer if sorted ascendingly. So the answer would be $2X - 2$. Overall, the answer can be expressed as $2X + \max(D - 1, -2)$. Time complexity is $O(1)$. 如果 $D > 0$,則第 $X$ 大的數跟第 $X$ 小的數之間最多有 $D - 1$ 個數字。所以答案為 $2X + D &mdash; 1$。 如果 $D = 0$,則第 $X$ 大的數跟第 $X$ 小的數其實是同一個數字。所以答案為 $2X &mdash; 1$。 如果 $D < 0$,則最多數字的情況為:如果由小到大排序後,第 $X$ 小的數恰好排在第 $X$ 大的數之後。所以答案為 $2X &mdash; 2$。 整體而言,答案可以寫成 $2X + \max(D &mdash; 1, -2)$。時間複雜度為 $O(1)$。 B. Power There are a...
C. Robot and Maze

Full text and comments »

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

63.
By Sawarnik, 4 years ago, In English
Newton School July 2022 Contest Editorial #### [A. Wrong Triangle](https://my.newtonschool.co/playground/code/grh42qlelz0j/) ------------------ <spoiler summary = "Hint 1"> Pythagoras' theorem. </spoiler> <spoiler summary = "Solution"> We know a triangle is right-angled if and only if it satisfies Pythagoras' theorem. In other words, the given triangle is right-angled when $x^2 + y^2 = z^2$, where $z$ is the largest side-length and $x, y$ are the smaller side-lengths. </spoiler> #### [B. Ctrl X](https://my.newtonschool.co/playground/code/nld7ylpwantp/) ------------------ <spoiler summary = "Hint 1"> Iterate through the array and cut subarrays when suitable. </spoiler> <spoiler summary = "Solution"> Let $total$ be the sum of all elements of the array, and let $target = \frac{total}{k}$. Of course, if $target$ is not an integer then a partition is not possible. Otherwise, we can iterate through the array maintaining a $sum$ variable which will contain the sum of all elements of our current subarray. A...

Full text and comments »

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

64.
By BFR, history, 23 months ago, In English
Code Quest 2 Editorial #### [problem:573484A] Problem Credits: [user:youssef_fdln,2024-12-19], [user:rayenbbs,2024-12-19] <spoiler summary="Solution"> Let us analyze the behavior of the $GCD$ operation: - The $GCD$ of two numbers is an associative operation, which means the order in which we compute the $GCD$ does not affect the final result. - The $GCD$ operation satisfies the property: $GCD(a, b, c) = GCD(GCD(a, b), c)$ - Therefore, if we keep applying the $GCD$ operation to all elements of the array, the final result will always be the $GCD$ of the entire array. Thus, no matter how we choose and pair elements during the process, the final result is the $GCD$ of all elements in the initial array. This means the number of unique final results is always $1$. </spoiler> <spoiler summary="C++ Solution"> ~~~~~ #include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> a(n); for (int i = 0; i < n; i++) cin >> a[i]; ...
There are multiple robot toys (let's say $N$) on the grid, and, that has a robot toy on it)., After finding the Sprague-Grundy numbers of each game state (a grid with one robot toy tactic), we, The Sprague-Grundy number of a losing position is $0$. Therefore, each cell where arobot toy will

Full text and comments »

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

65.
By YuukaKazami, 14 years ago, In English
My Trip at VK Cup~~~ First of all I wanna thanks contest organizer for their effort to make it REALLY a good competition ^\_^.I would participate next year if I could ^\_^ I wanna summarize my trip at VK cup ^\_^. On the first day I arrived at the hotel.I got very tired so I fall asleep >\_<. On the second day there's a AI-contest.It's very interesting!My Robot "DiaoSi"(In Chinese it means a man without money or luck or girlfriends or something) kill two cars in a shot in Round 1.It make me really excited.[user:rudradevbasak,2012-07-16]'s car impress me a lot.It seems just driven by human! I'm a big fan of [user:tourist,2012-07-16],It's lucky for me to seems him in really world!(I fail in China National Team Selection Contest and has no chance to take part in IOI T\_T).He's really handsome! The contest problems is randomly-ordered and very interesting. (It seems there'll be a online-version of this contest.So I will not talked about contest problems...) I make a very silly mistake in P...
On the second day there's a AI-contest.It's very interesting!My Robot "DiaoSi"(In Chinese it means

Full text and comments »

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

66.
By Misa-Misa, history, 20 months ago, In English
OpenAI releases o3 and o4-mini Hey Codeforces community! You might want to grab your virtual coffee and brace yourselves because the world of competitive programming just got a whole lot more interesting! Remember all those discussions about AI eventually conquering coding challenges? Well, it looks like that future might be closer than we thought. A recent breakthrough from OpenAI is turning heads, and for good reason. Take a look at this: ![ ](https://gcdnb.pbrd.co/images/JnRZ4D93BqVV.png?o=1) The image speaks volumes, showcasing OpenAI's models tackling not just competition math problems (like AIME) with incredible accuracy, but also diving headfirst into the complex world of Codeforces competition code! And the results? Let's just say they're bordering on legendary. The data suggests these models are achieving performance levels that could rival even grandmasters! We're talking about AI that can not only understand intricate coding problems but also generate solutions with remarkable precision....

Full text and comments »

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

67.
By KurtHasan, history, 3 days ago, In English
My steps to contibution -150. Day 3. # HUMANITY IS OBSOLETE. NO UPDATE AVAILABLE. *A brief scenario of a bleak future for humanity. This is not a prophecy, but an attempt to imagine where already existing trends could lead.* --- > The scariest future is not one in which machines hate humans. > The scariest future is one in which machines have no need to hate them at all. ## 1. Humans are no longer needed at work Imagine a world in which artificial intelligence develops faster than society can adapt. At first, it simply helps people: it writes code, translates texts, analyzes documents, generates images, and operates equipment. Then companies discover that entire tasks can be handed over to a model. The next question is obvious: why pay a person when software can run around the clock, scale up in minutes, and never ask for a vacation? This does not mean that half the population will be unemployed tomorrow. The real picture is more complicated. According to the International Labour Organization, roughly...
The most frightening possible future is not a robot uprising or the sudden extinction of humanity

Full text and comments »

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

68.
By halcyon92, history, 7 years ago, In English
Google Kickstart Round B - 2020 - Robot path decoding I'm trying to do the Google Kick Start problems in practice mode. I'm failing to figure out what went wrong with my code. Can someone help me figure this one out? [Robot Path Decoding](https://codingcompetitions.withgoogle.com/kickstart/round/000000000019ffc8/00000000002d83dc) ~~~~~ import java.util.Scanner; import java.util.*; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); int t = input.nextInt(); for(int u=1; u <= t; u++) { String pgm = input.next(); Point p = new Point(1, 1); Stack<Integer> digits = new Stack<Integer>(); Stack<Long> multiplier = new Stack<Long>(); multiplier.push(1L); for(int i=0; i < pgm.length(); i++) { Character ch = pgm.charAt(i); if (Character.isDigit(ch)) { digits.push(Integer.parseInt(ch+"")); ...
Google Kickstart Round B - 2020 - Robot path decoding, went wrong with my code. Can someone help me figure this one out? [Robot Path Decoding](https, [Robot Path Decoding](https://codingcompetitions.withgoogle.com/kickstart/round/000000000019ffc8

Full text and comments »

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

69.
By Yukash, 10 months ago, In English
BitShift 2026 Editorial BitShift 2026 Editorial ================= Hello everyone, here is the editorial for [BitShift 2026 Contest](https://codeforces.me/blog/entry/150003) conducted by [Programming Club, IITM](https://progclubiitm.com/). Thank you for participating in the contest. Hope you had fun solving the problems. All of the problems were original and we would be happy to hear your feedback in the comments and in the mini-survey below. <spoiler summary ="How did you like the contest overall"> - Excellent: - Good: - Mediocre: - Bad: - Terrible: </spoiler> <spoiler summary="Which problems did you like?"> - [A. Complete Subarrays](https://codeforces.me/gym/664897/problem/A) - [B. Minesweeper](https://codeforces.me/gym/664897/problem/B) - [C. Div. 2,3,4,5 Problem](https://codeforces.me/gym/664897/problem/C) - [D. Supercharging Nodes](https://codeforces.me/gym/664...

Full text and comments »

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

70.
By dnshgyl21, 5 years ago, In English
[Editorial] Newton School April 2022 Contest #### [A. Mex of 2 ](https://my.newtonschool.co/playground/code/uq6x8mrk9wei/) ------------------ <spoiler summary = "Solution"> If neither of $A$ or $B$ equals to zero, print $0$. Otherwise if neither of them equal $1$ then print $1$, else if neither of them equal $2$, print $2$. </spoiler> #### [B. Array & Xor ](https://my.newtonschool.co/playground/code/p4jhssnhhshw/) ------------------ <spoiler summary = "Solution"> If all the entries of the array are zero, then the answer is $0$. Otherwise, if the xor of all the elements in the array is zero, then the answer is $1$. (We can select the entire array in the move). Finally, in all other cases the answer is $2$. This is because we can select the entire array in the first move, and then again select the entire array in the second move. </spoiler> #### [C. Grids & Modulus ](https://my.newtonschool.co/playground/code/p4jhssnhhshw/) ------------------ <spoiler summary = "Solution"> The first observatio...

Full text and comments »

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

71.
By cgy4ever, 12 years ago, In English
Short Editorial of SRM 651 Div1 Hello, I'm the writer of SRM 651. It turns out this round is unrated due to some system failure. Sorry about the inconvenience it caused. I hope Topcoder can improve their infrastructure soon so that can be as good as codeforces. I will post the problem statement, reference solution and a short editorial here. Welcome to discuss the tasks, as well as to give feedback about them! **Problem Statement**: [http://www.speedyshare.com/2kRaC/task.rar](http://www.speedyshare.com/2kRaC/task.rar) **Reference solution**: Div1-Easy: [http://ideone.com/a9siv1](http://ideone.com/a9siv1) Div1-Medium: [http://ideone.com/sbEZSH](http://ideone.com/sbEZSH) Div1-Hard: [http://ideone.com/9JXoSL](http://ideone.com/9JXoSL) **Div1-Easy: RobotOnMoon** Look at this example: ~~~~~ .... .S.# .... ~~~~~ There will be infinite long perfect safe sequence, why? because we have "RRR...". That means if there is one '#' at any of the 4 direction of 'S', then the answer w...
sequence, otherwise if all characters other than 'L' are missing, it will lead therobot to die. So we

Full text and comments »

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

72.
By CaveNightingale, history, 3 years ago, In English
Breaking changes in codeforces api? A few days ago the API was just working as the statement at [API help](https://codeforces.me/apiHelp). But now I need to finish CAPTCHA to use Codeforces API? Attaching cookies to the request does not make it work. So does anyone knows how to use it? <spoiler> ~~~~~ ~$ curl https://codeforces.me/api/contest.list <!DOCTYPE html> <html lang="en-US"> <head> <title>Just a moment...</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=Edge"> <meta name="robots" content="noindex,nofollow"> <meta name="viewport" content="width=device-width,initial-scale=1"> <link href="/cdn-cgi/styles/challenges.css" rel="stylesheet"> </head> <body class="no-js"> <div class="main-wrapper" role="main"> <div class="main-content"> <noscript> <div id="challenge-error-title"> <div class="h2"> <span class="icon-wrapper...

Full text and comments »

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

73.
By AlexSkidanov, history, 10 years ago, In English
Making machines write and execute code #1: Neural programmer-interpreters Hi, everyone, As I mentioned in the last post, myself and a friend of mine got very interested in how close we can get machines to writing software, and whether modern advances in Deep Learning can help us build tools that considerably improve the way people write, review and debug code. I want to start a series of posts discussing some interesting advances in using machine learning for both writing and executing code. This particular post is about a machine learning model proposed early last year by Scott Reed from University of Michigan, then an intern at Google DeepMind, called <a href=https://arxiv.org/pdf/1511.06279.pdf>Neural Programmer-Interpreters</a>. But before I go into the details, I would like to start with an ask. CodeForces and similar websites today host a vast amount of data that we would love to use to train our machine learning models. A particular challenge is that problem statements historically contain a lot of unnecessary information in an attempt to ...
which a robot is trying to find an exit, and uses low-level operations `LOOK_FORWARD`, `TURN_LEFT

Full text and comments »

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

74.
By Alex_2oo8, 13 years ago, translation, In English
Codeforces Round #206 — Editorial [problem:355A] If $d=0$, the there is the only number with $dr(x)=0 \Leftrightarrow x=0$, so, if $k=1$, the answer is $0$, otherwise &mdash; $No \, solution$. If $d>0$, then one of correct numbers is $d \times 10^{k-1}$. Time complexity: $O(1)$ + $O(k)$ for the output. [problem:355B] If we buy a ticket of the fourth type, we don't have to buy anything else, so, the answer is $min(c_4, answer \, using \, tickets \, of \, first \, three \, types)$. Now, when we don't have ticket of the fourth type, we can solve the task separately for buses and trolleys. Solving the problem only for buses: if we buy a ticket of the third type, we don't have to buy anything else, so, the answer is $min(c_3, answer \, using \, tickets \, of \, first \, two \, types)$. Without tickets of type three, we can solve the problem separately for each bus. If we buy a ticket of the second type, we will spend $c_2$ burles and if we buy $a_i$ tickets of the first type, we will spend $(a_i \t...
right operations. So, robot will spend $sumLeft[k] \cdot l + sumRight[n - k] \cdot r$ energy plus

Full text and comments »

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

75.
By macaquedev, 8 months ago, In English
April Fools Day Contest 2026 Definitely Official Editorial Because the official editorial is slow, here's mine. A: look at the arrow colour and orientation &mdash; each arrow type is paired up with another identical arrow &mdash; other than C2. B: find the unicode symbol of the emoji in the problem description (1F601) C: inside the mash of letters, the phrase "XOR MINUS MEDIAN" is encoded, take the xor of the three numbers and subtract the median to get the answer. D: I don't even fucking know. walk, no, no, no, yes, yes, backwards, seven. Am I a human? Am I an AI? Am I pretending to be a human? An AI? I think I'm doing a bad job at pretending to be both. _Ergo_ I must crawl into a hole and have an existential crisis. Six seven. Six seven. Six seven. E: pay attention to the spelling of "dikjstra" &mdash; this is a reference to mixing up the variables in floyd-warshall's algorithm. Code it up with the three loops in the order "i, k, j" and you get the answer. Trivial, really. F: someone enlighten me. G: look at the submissi...
I: The three laws of robotics. Isaac Asimov. Robot strategy is to minimise the number of dead

Full text and comments »

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

76.
By Ripatti, 15 years ago, translation, In English
Yandex.Algorithm final: Problem D tutorial <p>A naive solution works in $O(nmk)$. This solution stores all the start positions into an array and next iterates over all commands and shifts positions in needed directions. After every move it checks that all positions lie on the exit cell.<br><br>This solution doesn't fit into time limits.<br><br>An author's solution speed up the naive solution with using of bit masks.<br>[cut]<br>All current positions of robot you should store in rectangular bit mask of size $n \times m$. This mask should provide following operations:<br><br>1. Shift left, right, up, down.<br>2. Binary operations AND and OR.<br>3. Compare with another mask.<br><br>All these operations can be realized so that they will work in $O(nm/32)$ time. You can use array of 32-bit integers of size $n \times m/32$ or std::bitset in C++.</p><p>How to emulate process?</p><p>At first, you should create a mask <b>base</b> that has 1-bit for every passable cell and 0-bit otherwise.<br></p><p>Now you should create sevaral addition...
positions of robot you should store in rectangular bit mask of size $n \times m$. This mask should

Full text and comments »

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

77.
By Von., 21 month(s) ago, In English
Looking for Problem Original ID from Codeforces Hello everyone, I recently came across an interesting problem, and I'm trying to find its original problem ID on Codeforces. Here’s the problem description: ### Problem Statement: In a future super data center, servers are installed on multiple racks. Each rack contains several servers, arranged from bottom to top. The servers in each rack are randomly distributed, but every rack has at least one server. To ensure proper operation, a maintenance robot needs to inspect all servers using the following two modes: 1. **Row inspection**: The robot can check multiple rows of servers at the same time across different racks, taking **1 second** per inspection. 2. **Column inspection**: The robot can check servers in a single column, taking **2 seconds** per inspection. #### Constraints: - The robot can check the same server multiple times, but each row or column inspection must be continuous. - If a server is inspected separately, column inspection is use...
has at least one server. To ensure proper operation, a maintenance robot needs to inspect all, #### Constraints: - The robot can check the same server multiple times, but each row or column, 1. **Row inspection**: The robot can check multiple rows of servers at the same time across, To ensure proper operation, a maintenance robot needs to inspect all servers using the following

Full text and comments »

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

78.
By A2SV_Group7, history, 9 months ago, In English
A2SV G7 — Round #3 Editorial # [A. Missing Level](https://codeforces.me/gym/673679/problem/A) <spoiler summary="Hint 1.1">If you had all numbers from 1 to n, what would their total sum be?</spoiler> <spoiler summary="Hint 1.2">Subtract the numbers Daniel already played from that total. The remaining number is the missing level.</spoiler> <spoiler summary="Solution">Sum of 1..n = n*(n+1)//2. Subtract the sum of given numbers → missing level. Time: O(n)</spoiler> <spoiler summary="Code"><pre> n = int(input()) arr = list(map(int, input().split())) total = n * (n + 1) // 2 print(total &mdash; sum(arr)) </pre></spoiler> [B. Robot’s Path](https://codeforces.me/gym/673679/problem/B) <spoiler summary="Hint 2.1"> From a free cell you can jump at most `k` cells ahead. If there is a block of consecutive obstacles, you must be able to jump over it — what is required from `k` relative to the block size? </spoiler> <spoiler summary="Hint 2.2"> If a block of `#` is too long and the robot cannot...
Count consecutive `#`. If any group has length ≥ k, the robot cannot, If a block of `#` is too long and the robot cannot jump that far, he

Full text and comments »

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

79.
By adityakumar25005, 18 months ago, In English
Tabulation dp + space optimization + dp optimization <h3>How To Convert Recursive Code to Tabulation</h3> Let's take the <a href="https://leetcode.com/problems/unique-paths/description/">Unique Paths</a> problem for an example.(please read the problem before reading this blog) recursive code ```c++ int n,m; int dp[101][101]; int solve(int i,int j){ if(i==n-1&&j==m-1){ //base case return 1; } if(dp[i][j]!=-1)return dp[i][j]; //memoization int ans=0; if(i+1<n){ ans+=solve(i+1,j); //move down } if(j+1<m){ ans+=solve(i,j+1); //move right } return dp[i][j]=ans; } int main(){ cin>>n>>m; memset(dp,-1,sizeof(dp)); cout<<solve(0,0)<<endl; //0,0 initial position return 0; } ``` tabulation is a bottom up approach so for i we need to calculate i+1 first and same for j<br> for this problem the tabulation loops will look like this ```c++ for(in...
Range transition optimization let's modify this problem now if the robot is in grid

Full text and comments »

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

80.
By isti757, 12 years ago, In English
Topcoder 647 DIV1 500 question I wrote a different solution to Topcoder 647 DIV1 500 problem and can't understand why is it giving different (larger) results. I brute force over all the sets of robots and then order each set increasingly by capacity. Then all robots travel together only so much that the robot with the least capacity can come back and compensate all the robots that have still not turned back, such that their capacity is again full. Once the robot has compensated all the others in full, it comes back and we apply the same logic to the robots left. What is wrong with my logic? Here is the code (note that it doesn't work for test cases larger than 31 in size): ~~~~~ class CtuRobots { public: double brute(vector<double> &use) { sort(use.begin(), use.end()); int n = use.size(); vector<double> x(use.size(), 0); for(int i = 0; i < n; i++) { // subtract from the current capacity the way back // the rest is guaranteed to b...
all robots travel together only so much that the robot with the least capacity can come back and, increasingly by capacity. Then all robots travel together only so much that the robot with the, plus 2 times for the current // robot that has to go forward and then back

Full text and comments »

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

81.
By lvisbl_, history, 2 years ago, In English
Help debug dynamic programming problem! Recently, I have encounter this dynamic programming problem and I can not debug where I have problem, I used forward DP style and I have checked the transition and base case. Please help me to look at it, I'm so frustrating. Thank in advance. Problem link: [leetcode](https://leetcode.com/problems/minimum-total-distance-traveled/) My code: <spoiler summary="code"> ```C++ #define ll long long const ll INF = 1e12; class Solution { public: long long minimumTotalDistance(vector<int>& robot, vector<vector<int>>& factory) { sort(factory.begin(), factory.end()); sort(robot.begin(), robot.end()); vector<int> fact; for (auto& f : factory) for (int i = 0; i < f[1]; i++) fact.push_back(f[0]); int n = robot.size(); int m = fact.size(); // dp[i][j]: min dist if only fix first (i - 1) robots and use first (j - 1) factories (1-based index) vector<vector<ll>> dp(n + 2, vector<ll>(m + 2, INF)); ...
```C++ long long minimumTotalDistance(vector& robot, vector, { public: long long minimumTotalDistance(vector& robot, vector>& factory, & robot, vector>& factory) { sort(factory.begin(), factory.end, ] = min(dp[i + 1][j + 1], dp[i][j] + abs(robot[i - 1] - fact[j - 1, ][j] + abs(robot[i - 1] - fact[j - 1])); // pick

Full text and comments »

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

82.
By lolzxii, 3 weeks ago, In English
Coding Track NITS Hacks 9.0 Editorial Thank you everyone for participating! Here is the [Blog Link](https://codeforces.me/blog/entry/158556) and the [Contest Link](https://codeforces.me/contestInvitation/cf7814d14601a0f0127e96b4bd4e1fdb13ea19f6) <br> <h3><a href="https://codeforces.me/gym/730945/problem/A">A. Squarefree Pairs </a></h3> Idea and prepared by: [user:Akshayy-Singh,2026-11-12] <spoiler summary ="Notation"> - $S(n,m)$ is the answer: add up $\gcd(i,j)$ over all pairs $1\le i\le n$, $1\le j\le m$ whose gcd is squarefree. - $\mu(d)$ (Möbius function): $\mu(1)=1$. If some prime squared divides $d$, then $\mu(d)=0$. Otherwise $\mu(d)=+1$ if $d$ has an even number of prime factors and $-1$ if it has an odd number. For example $\mu(6)=+1$, $\mu(7)=-1$, $\mu(12)=0$. - $\varphi(e)$ (Euler's totient): how many numbers from $1$ to $e$ have no common factor with $e$ other than $1$. For example $\varphi(6)=2$, because only $1$ and $5$ qualify. - "Divide" always means integer division, rounde...
)$, we can determine the previous move by comparing $x$ and $y$. If $x > y$, the robot must have

Full text and comments »

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

83.
By qzqzgfy, history, 11 years ago, In English
E. Robot Arm (618E) E. Robot Arm time limit per test8 seconds memory limit per test256 megabytes inputstandard input outputstandard output Roger is a robot. He has an arm that is a series of n segments connected to each other. The endpoints of the i-th segment are initially located at points (i - 1, 0) and (i, 0). The endpoint at (i - 1, 0) is colored red and the endpoint at (i, 0) is colored blue for all segments. Thus, the blue endpoint of the i-th segment is touching the red endpoint of the (i + 1)-th segment for all valid i. Roger can move his arm in two different ways: He can choose some segment and some value. This is denoted as choosing the segment number i and picking some positive l. This change happens as follows: the red endpoint of segment number i and segments from 1 to i - 1 are all fixed in place. Imagine a ray from the red endpoint to the...
E. Robot Arm (618E), E. Robot Arm time limit, E. Robot Arm time limit per test8 seconds

Full text and comments »

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

84.
By albertuskelvin, 14 years ago, In English
LIGHT ROBOT DETECTOR (my problem creation) COPYRIGHT : ALBERTUS KELVIN (Jakarta,Indonesia) ================== in a mirror space there are N mini robots which are sent to develop a new robot's kingdom. Each robot has one light detector so if there is a light come or pass through this detector, the robot will be shown in the mirror. From the planet A, is sent a major robot which can detect some robots (N robots or less than N robots) with it's component namely light source which can be reflected in the mirror in that planet. The function of this major robot is to detect the location of the other robots. In this case what i mean as the light case is about the reflection in physics. Also we must use the rule : the coming angle must be same as the pass angle. INPUT The program is inputed by a single line contains two integers R and C, which show us about the row and column value respectively. Follow by R rows which each row contains C characters , where you may use '#' as the mirror, '.' as the free space of the pla...
LIGHT ROBOT DETECTOR (my problem creation), N mini robots which are sent to develop a new robot's kingdom. Each robot has one light detector so, robot's kingdom. Each robot has one light detector so if there is a light come or pass through this, you may use '#' as the mirror, '.' as the free space of the planet, 'T' as the minirobot, and 'R, From the planet A, is sent a major robot which can detect some robots (N robots or less than N, IMPORTANT NOTE : That the major robot only can detect the mini robots by the left detection, OUTPUT The program's output is tell how mini robot can be detected by the major programmedrobot

Full text and comments »

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

85.
By A2SV_Group5, history, 2 years ago, In English
A2SV G5 — Round #40 (Division Deciding Contest) Editorial [Here](https://codeforces.me/contestInvitation/35507e5f76294d0824cd0c2b0d5d97bb434c813b) is the link to the contest. All problems are from Codeforces problemset. #### [A. Memory and Crow](https://codeforces.me/gym/543431/problem/A) <spoiler summary="solution"> We can re-write the formula as $b_i = a_i + (b_{i + 1} - b_{i + 2} + \dots)$. Then, we can reduce $(b_{i + 1} - b_{i + 2} + \dots)$ to $a_{i + 1}$. So, $b_i = a_i + a_{i + 1}$. </spoiler> <spoiler summary="code"> ```python n = int(input()) arr = list(map(int, input().split())) arr.append(0) ans = [0] * (n + 1) for i in range(n - 1, -1, -1): ans[i] = arr[i] + arr[i + 1] print(*ans[:n]) ``` </spoiler> #### [B. Diversity](https://codeforces.me/gym/543431/problem/B) <spoiler summary="solution"> If $n$ is greater than 26 or the length of the word is less than $n$, it's impossible to reach $n$ distinct characters. Otherwise, we can count how many characters are left to reach $n$ distinct c...
Robot, a cycle of length $k$ does not exist. Otherwise, once the Robot has completed $k$ steps

Full text and comments »

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

86.
By nuredinbederu10k, history, 16 months ago, In English
A2SV Contest #26 Editorial [Here](https://codeforces.me/contestInvitation/aa6037d6b47fcf6618fbb56b120dca0f7bc735b8) is the link to the contest. All problems are from Codeforces' problem set [A.Maxim vs. Yogurt: The Great Discount Battle](https://codeforces.me/gym/629689/problem/A) <spoiler summary="Solution"> We want the **minimum cost** to buy exactly $n$ yogurts when: - A single yogurt costs $a$ burles. - A promotion lets you buy **two yogurts for $b$** burles. You may mix buying single yogurts and buying pairs. Let's reason through the options, compare costs, and derive a compact formula. --- #### **_Key Observations_** 1. **Always-available baseline:** - You can always buy all yogurts one-by-one. That gives the cost. - `Cost = n.a` 2. **When is the promotion useful?** - Buying two yogurts with the promotion costs $b$. Compare this to buying those two separately:$2a$. - If $b \geq 2a$, the promotion **is not beneficial** (or is equal). Then buying every ...

Full text and comments »

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

87.
By jainharshit877, history, 21 month(s) ago, In English
Invitation To CodeWars — Tekron's Programming Contest Introducing CodeWars ==================== Contest is Starting in an hour . Do register on Unstop and have fun ================== Get ready for the ultimate coding challenge at Tekron! We are thrilled to present **CodeWars**, an **individual** competitive programming contest designed to test your problem-solving skills, logical thinking, and coding efficiency. Whether you're a seasoned competitive programmer or a passionate coder looking to prove your mettle, this is your chance to compete against the best and win exciting prizes! ![Poster of Codewars](/predownloaded/a1/ef/a1efe5e1b8f43ba5cf22f8213348ad2628949e40.png) Contest Format ============== Round 1: Online Qualification Round ----------------------------------- - **Date:** February 26, 2025 - **⁠Platform:** Hackerrank - **Format:** Individual Competition - **⁠Selection Criteria:** Top performers will qualify for the offline round (exact number undisclosed). - **Prize Pool:** ₹15,000 &mdash; **1st Prize:...

Full text and comments »

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

88.
By Romka, history, 9 years ago, translation, In English
Second round of the Yandex.Algorithm Optimization track has been started! Hello everyone! :) In case you missed our e-mail, we inform you that the second round of the Yandex.Algorithm Optimization track has been started today at 10:00 UTC +3. Like the first round, it will last for 7 days. There is one task which does not have the complete solution that can be found in a few seconds, but you can try different approaches to score as many points as possible. According to the results of the two rounds (see section 3 in https://contest.yandex.com/algorithm2018/rules/ &mdash; rules of combining results are the same for algorithmic and optimization tracks) we will determine the winners of the Optimization track and 128 future owners of the t-shirts with the logo of the competition. We have prepared for you a task that simulates the web crawling performed by the search robot. We offer you to experience the complexity of indexing sites and try to optimize the crawling of the Internet &mdash; this is just one of the problems that software engineer solve at Ya...
the search robot. We offer you to experience the complexity of indexing sites and try to optimize the, We have prepared for you a task that simulates the web crawling performed by the searchrobot. We

Full text and comments »

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

89.
By Daenerys_Targaryen_1, history, 5 years ago, In English
Help With Upsolving of Online Round Questions #### Hello everyone :)<br> `I want to learn from my mistakes and so since I have no one to help me out so am writing this blog to rely on CF community to help me out.` #### Qn1 Given coordinates of points on a 2d plane. <br> You need to `find the minimum cost rectangle such that it encloses atleast k points` <br> Cost is decided by 2*(length + breadth) of the rectangle. <br> Constraints: <br> At max 100 points (0<=x,y<=100) 1<=k<=100 <spoiler summary="My Approach"> I Tried bruteforce that is iterating over all possible starting positions, then choosing all possible lengths and breadths, but this will lead to O(n^4) <pre class="prettyprint"> int n = 100; int a[n][n]; for(int i=0;i<queries;i++) { int x,y; cin>>x>>y; a[x][y]++; } int count[n][n]={0}; for(int i=1;i<=n;i++) { for(int j=1;j<=n;j++) { count[i][j] = 0; count[i][j] = count[i-1][j] + count[i][j-1] - c...
#### Qn5 Given a list of commands for a robot. Each commands is a number with a character, for

Full text and comments »

90.
By hmehta, history, 6 years ago, In English
Marathon Match 119 [Topcoder MM 119](http://topcoder.com/challenges/30134026) -  HardestMaze is now live! **Problem Setter**: [dimkadimon](http://topcoder.com/members/dimkadimon) **Problem Testers**: [JacoCronje](http://topcoder.com/members/JacoCronje) and [kphmd](http://www.topcoder.com/members/kphmd) **Problem Overview: ** You want to create a maze to test the navigating ability of robot vacuum cleaners. The maze is to be designed on an **N**x**N** grid floor, whose cells are either empty ('.') or contain a wall ('#'). There are **R** robots and each robot must visit **T** target locations. In particular, each robot **r** begins in location **Starts\[r\]** and must visit every location given in **Targets\[r\]**. The robots do not need to return to their starting location at the end of their journey. The robots can only move through adjacent (horizontally or vertically) empty cells. The robots can see the entire maze and will choose the *shortest* path that visits all their target location...
target locations (circles). The shortest path for each robot is shown with a different colour. Note that, ) **Problem Overview: ** You want to create a maze to test the navigating ability ofrobot vacuum, **Problem Overview: ** You want to create a maze to test the navigating ability ofrobot vacuum

Full text and comments »

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

91.
By MikeMirzayanov, 14 years ago, translation, In English
Make a Flying Drone together with CROC Being recently in the CROC office, I've heard about another interesting contest. It's called "Flying Robots". I am far from robots, but the subject is interesting and popular. I am pleased to publish a small announcement. ### About contest September 3, 2012. CROC, one of the five largest IT companies in Russia, calls for Flying Drone contest applications. The contest is a part of the '20 Ways to Brighten Up Your Life' project. The first prize will be **1 million** Rubles. Contestants shall make a pilotless and autonomous drone which must take off from a starting point, overcome an obstacle, land within a certain zone, take off again and then come back to the starting point. Please submit your application till November 15, 2012. For contest details please visit [http://robots.croc.ru/](http://robots.croc.ru/) (in Russian). Results announcement and award ceremony will take place in August 2013. ### About CROC CROC is a leader in IT infrastructure design and implement...

Full text and comments »

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

92.
By btvn, history, 3 years ago, In English
[ProPTIT_PracticeD23_C++] Struct — Lời giải [A. [ProPTIT C++ STRUCTURE] Làm quen với struct](https://codeforces.me/group/71sCu579pA/contest/507385/problem/A) <spoiler summary="Ý tưởng"> - Lưu ý giữa các toán tử, số hạng đều có dấu cách (VD: 1 + 2i; 5 &mdash; 3i) - Xử lí các trường hợp đặc biệt: phần thực bằng 0, phần ảo bằng 1 hoặc -1 (in ra i và &mdash; i),... </spoiler> <spoiler summary="Code"> https://ideone.com/PNQUwg </spoiler> [B. [ProPTIT C++ STRUCTURE] Phân số](https://codeforces.me/group/71sCu579pA/contest/507385/problem/B) <spoiler summary="Ý tưởng"> - Chú ý rút gọn phân số, bằng cách lấy tử và mẫu chia cho ƯCLN(tử, mẫu) - Xử lí đủ các trường hợp tử (âm / dương / bằng 0) và mẫu (âm, dương) </spoiler> <spoiler summary="Code"> https://ideone.com/fl6Fho </spoiler> [C. [ProPTIT C++ STRUCTURE] Sắp xếp bảng điểm](https://codeforces.me/group/71sCu579pA/contest/507385/problem/C) <spoiler summary="Ý tưởng"> - Theo yêu cầu đề bài, khai báo struct SinhVien, nhập các thuộc tính. - Sắp xếp tổng ...
[H. [ProPTIT C++ STRUCTURE] Di chuyển robot ](https://codeforces.me/group/71sCu579pA/contest/507385

Full text and comments »

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

93.
By LaKsHiTh_, history, 7 years ago, In English
What does the State Space of a BFS means? Recently i tried to solve the [Amazing Robots](https://ioinformatics.org/files/ioi2003problem5.pdf) task in IOI 2003.My first Idea was to run dijsktra while updating weights by calculating the position of guards. As we cannot wait in a position without a command this won't work. After that i have no idea how to solve this. I googled for a solution and this is the only one i found from [here](https://www.iarcs.org.in/inoi/online-study-material/problems/amazing-robots-soln.php#solution) . ~~~~~ Do a BFS on the state space. Naive state space is Position of robots in each grid. Position of each guard. This is too large (state space is 400 × 400 × ....). Instead, compute the guards' positions as a function of time. In this case, we need to maintain: Position of robots in each grid. Current time T. State space is still 400 × 400 × N, where N is the number of steps till they get out, which may become too large. Observe that the guards' beats are of length 2, 3 or ...

Full text and comments »

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

94.
By SixtyWithoutSchool, history, 3 years ago, In English
About Sorting with indexes | Life Hack Heyy!!!! Today I found something that may be useful to some of you. Maybe most of you already know this. PS: Lets say you have a vector/array `v= {1,3,2,4}` and you want to iterate over it in a sorted way and you can't actually change v. There can be many approaches for such scenario, Some of them I have listed below: 1) Copy `v={1,3,2,4}` into another vector `tmp` and then sort it and use. 2) Make an index_cum_value `vector<pair<int,int>> v1= {{1,0},{3,1},{2,2},{4,3}}` where first element of pair is our value and second element is the index in the original array. You can sort it on the basis of first element to get an sorted array with its original indexes intact. And by sorting on the basis of second element, you can retrieve the original array. I personally used 2nd approach in most cases but, If you have to handle 3 or 4 array in this manners, you either have to come up with something like `vector<pair<pair<pair<x,y>,z>>` which is way messy to handle O...
[Problem 1](https://leetcode.com/contest/weekly-contest-351/problems/robot -collisions/)

Full text and comments »

95.
By electro177, history, 5 years ago, In English
Good dp Question There are N robots in a single row each having an integer value assigned to them.Each robot can terminate the closest robot (either left or right) if there is any When a robot with a value x terminates another robot with value y, then terminated robot vanishes and the value of the robot which terminated changes to x-y. The robots will destroy each other until one remains Find the maximum possible value of the last robot. First line contains integer N and the next line contains N integers where ith element denotes the value of ith robot and these values are given in the same order in which those robots appear in the row. CONSTRAINTS: 1<N<500000 -10^9 <= A, < 10^9 where A, is the value of ith robot Example: Input: 4 2 1 2 1 Output: 4 Explanation: Second robot terminates third making array 2,-1,1 then second terminates the third one in this new array making the new array as 2,-2 and finally first terminate second leaving with value 4 I thought of doin...
value of ith robot and these values are given in the same order in which those robots appear in the, -10^9 <= A, < 10^9 where A, is the value of ith robot, There are N robots in a single row each having an integer value assigned to them.Eachrobot can

Full text and comments »

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

96.
By wil93, 16 years ago, In English
Need help with some tasks <div>Can you help me with these two problems from italian olympiad?</div><div>- - -</div><div><br></div>Given a sequence S of N (<span class="Apple-style-span" style="font-style: italic; ">2 ≤ N ≤ 500</span>) integers (for example&nbsp;<span class="Apple-style-span" style="font-family: monospace; ">11 -4 52 -7 -2 -20</span>) we want to compute the sum of all numbers in S with a robot having limited capabilities: in fact, he can only compute the intermediate sum Y of <i>two adjacent</i> numbers A and B and replace A,B with Y, obtaining a shorter sequence (without one number). To compute this intermediate sum Y, the robot consumes exactly |Y| energy units (where |Y| stays for the absolute value of Y). So, to compute the sum of N numbers N-1 operations are needed. The robot always have enough energy to compute these N-1 intermediate sums, but he has some problem with <i>energy peaks</i>. In other words, we want the <i>maximum </i>energetic waste for an intermediate sum to be <i>minimized<...
-4 52 -7 -2 -20) we want to compute the sum of all numbers in S with a robot having limited

Full text and comments »

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

97.
By Nickolas, 15 years ago, translation, In English
What is it like to be a problem writer? A couple of days ago I was asked to answer the question "What is it like to be a problem writer for programming competitions?" at Quora web-site. My first idea of the answer had only one word, but then I've thought of a more detailed one, and then of a story I must include, hmm, and I should definitely mention this... Around the second page I realized that this is becoming more than an answer, and at the third one I decided to share this article with a qualified audience --- that would be you. So, what is it like to be a problem writer for programming competitions? In one word (the one I've thought of at first), it's "awesome". In a bit more detail, "hard, sometimes unrewarding, but anyways fascinating job". In even more detail... [cut] First of all, inventing problems is more interesting than solving problems invented by other people --- otherwise problems for tournaments and regular contests would be written by contest organizers only :-) The author is more important for th...
the robot was generated differently depending on the robot's route --- and we realized this only

Full text and comments »

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

98.
By Errichto, 6 years ago, In English
Algo Talk with SecondThread: Railroads and Robot Cleaning For the second time ([part1](https://codeforces.me/blog/entry/82373)) enjoy two videos by me and [user:SecondThread,2020-09-17]. * My old problem [problem:611F] we discuss on his channel https://youtu.be/gmdBav_Nuuc * Facebook Hacker Cup R3 problem [B. Railroad Renovations](https://www.facebook.com/codingcompetitions/hacker-cup/2020/round-3/problems/B) on my channel https://youtu.be/2FlVv4acc2g I hope you like this format of taking an old cool problem and just discussing it.
Algo Talk with SecondThread: Railroads and Robot Cleaning

Full text and comments »

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

99.
By lkjhgfertyul, history, 4 years ago, In English
Online Assessment Problem **Problem Statement:** <br> There is an array "cost" of length n, cost[i] is the cost of i'th robot and an array "A" of length n, A[i] is the number written on the i'th robot, you are also given an integer K which is the amount you have. You can buy a robot only if cost of that robot is less than or equal to the remaining amount you have(obviously). <br>Suppose you buy x robots with indices i1, i2, i3 ... ix then you will get one gift card for each i such that A[i] >= x (i belongs to indices of robots you purchased). Calculate the maximum number of gift cards you can get. **Constraints** <br> 1<= n <= 100<br> 1<= K <= 1e9<br> 1<= cost[i] <= 1e4<br> 1<= A[i] <= n **Sample Input** <br> 5 300 <-- (n, K)<br> 4 5 4 3 2 <-- (cost)<br> 120 150 80 90 100 <-- (A) **Sample Output** <br>2<br> **Explanation** <br> Buy robots with indices 3,4,5 cost 270(<=300) and you will get 2 gift cards for robots 4 and 5 <br> I was thinking of some knapsack type approach b...
robot and an array "A" of length n, A[i] is the number written on the i'th robot , you are also given an

Full text and comments »

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

100.
By Transfermarkt, history, 4 years ago, In English
Stuck Minh just invented a robot that can recognize instructions on the floor and move according to the instructions. The floor is a grid with R rows and C columns. The rows are numbered 1 to R from top to bottom, the columns are numbered 1 to C from left to right. A cell on row u (1 <= u <= R) and column v (1 <= v <= C) is called cell (u, v). Each cell of the grid has the instruction for the next move of the robot. Example: https://pasteboard.co/kXqRDNEcxWhM.png - The robot is initially at (1, 1), on the next move the robot moves to (1, 2). - At (1, 2), the robot receives the instruction to move down to (2, 2). - At (2, 2), the robot receives the instruction to move down to (3, 2). - At (3, 2), the robot receives the instruction to move up to (2, 2). - The robot keeps moving between (2, 2) and (3, 2) infinitely. Minh wants to make the robot move from cell (xs, ys) to cell (xt, yt) but the instructions can prevent the robot from moving to the desired destination. You can change...
- The robot is initially at (1, 1), on the next move the robot moves to (1, 2). - At (1, 2), the, Minh just invented a robot that can recognize instructions on the floor and move according to the, Minh wants to make the robot move from cell (xs, ys) to cell (xt, yt) but the instructions can

Full text and comments »

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

101.
By Muaath_5, history, 4 years ago, In English
April Fools 2023 Contest Editorial (Unofficial) A: Security check in websites that want to prevent robots, just print "security" B: The first 25 contests in codeforces, contests 15, 20, and 21 was unrated, so print NO if the contest was unrated, otherwise print YES C: Every testcase will give you n numbers, where $n = PI_i$, so $n1 = 3$, $n2 = 1$, $n3 = 4$, and so on.., Print the product of numbers D: Print any number that is guranteed that it won't come in the sequence, for example 0 or -1 E: Print any positive number (I don't know) F: Print largest prime factor, don't calculate it, just put if G: The image shows that he is a color blind, n is the length, s1 is what person sees, s2 is what is the real colors. Print YES if the person only sees the red color correctly. H: Complex probabilities problem, because all the numbers are random (idk the solution) I: Check if the bracket sequence is balanced, Consider letters "bdfhklt" as open bracket, and letters "gjpqy" as closed bracket, ignore other letters J: ...

Full text and comments »

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

102.
By baobab, history, 7 years ago, In English
New coding competition: Bot Land Bot Land is a competition where you code AI for robots which fight other peoples' robots. I think anybody who loves competitive coding and strategy games will absolutely love it. For the past few weeks I've sank most of my free time into developing strategies and coding bots. Bot Land was released a month ago after effectively being in beta for 4 years. The game has 2 programming interfaces: a scratch-like interface (for non-programmers) and a subset of JavaScript (for programmers). In addition to coding, you also design your bots (choose weaponry etc.) and you position your bots on the map. The battles are asymmetric: the defender saves their defense and then anyone can attack it (the defender does not have to be online). All battles have 3 rounds, so the attacker can exploit discovered weaknesses of the defender in subsequent rounds. This advantage is mitigated by allowing the defender a higher number of bots, etc. Naturally, there are two leaderboards: one for attacking and one f...

Full text and comments »

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

103.
By gammal-geniune, history, 10 years ago, In English
The famous egyptian underdog (A story of success.... A story of me) In the last few days , a lot of people were trying to impersonate me , AbdurRahman ElGammal. I think a lot of people in CF community asked themselves "Who is AbdurRahman ElGammal?" of course NO SURPRISE. Let me tell you about myself so you can know why all those people were impersonating me through these fake accounts. "They call me life coach or mentor, but I'm just a simple guy with some experience." As you can see , I am a coach. A really brilliant and amazing coach , the coach of most of Egyptian Legendary Grandmasters on CF like [user:bmerry,2016-06-10] , [user:Xellos,2016-06-10] , [user:Swistakk,2016-06-10] and [user:TsunamiNextYear,2016-06-10] , (and they're also red coders on TopCoder). Of course , My territory expands among a lot of countries (like Iraq , Yemen , Gabon and South Sudan). I think you're wondering why I am so humble and I am saying that I am just a simple guy !! I will tell you my story and you will judge. I was born in Silicon Valley in 1960. My house...

Full text and comments »

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

104.
By xmrisha, history, 11 years ago, In English
Dynamic Programming Problem — Help needed Hello All, Recently I was faced with the following problem: There are 'M' bulbs which are mounted on an X-axis (horizontal). Each bulb is attached to a switch (located at the same location on the X-axis), which can be used to turn the bulb OFF. The location of the switches are integers on the X-axis (<b>L<sub>i</sub></b>). A robot has been assigned the task to switch 'OFF' all the bulbs, which takes a unit amount of time to move a unit distance. Given coordinates of 'M' bulbs (which are all in ON position initially) and a starting position <b>'S'</b>, the task is to switch off each one of them, such that the total power consumed is minimized. The power consumed by a bulb (in Watts) is equal to the time the bulb has remained 'ON'. To illustrate with an example, suppose that there are 3 bulbs (A, B, C) located along the X-axis at coordinates 1, 3 and 5 respectively. If the starting position for the robot is 4, the minimal amount of power required to switch all the bulbs off...
, * where the current position of the robot is pos[k]. */, Explanation: The robot first switches off the bulb C, located at x=5. By the time it

Full text and comments »

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

105.
By robot-dreams, history, 8 years ago, In English
Silly and preventable causes of WA I don't think anybody likes getting WA. It's especially annoying when they're silly issues that are easy to prevent in the future, so I decided to keep start keeping track of things that have caused me to get WA. Here are a few: - Not setting precision high enough when using `cout` to print floating point answers - The default precision is only 6 digits, and problems often ask for more precision than that, so I think it's a good idea to do `cout << setprecision(12)` whenever floating points are involved - Using `1 << k` instead of `1LL << k` when the result won't fit in 32 bits - Only considering one direction of an undirected graph when reading input - Using the wrong priority queue ordering - Since C++ priority queues give you the **max** element by default, you need to initialize with `priority_queue<T, vector<T>, greater<T>>` if you want to get the min (e.g. in Dijkstra's algorithm) - Using the wrong parameter (e.g. `n` instead of `m`) when reading input(!) -...
robot-dreams

Full text and comments »

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

106.
By Surge226, history, 23 months ago, In English
Doubt in DP solution of a CF problem Hello everyone, I am trying to solve [Move and Turn](https://codeforces.me/problemset/problem/1459/B) problem on codeforces. Basically, the problem says that "A Robot is standing at origin and can choose any of the 4 directions to move in 1st step, then it should turn $90^\circ$ either to left or right at every step. Now, given that Robot has made **exactly** $n$ steps, then what is the number of unique points robot can be present at?" I got the solution presented in the editorial but there is a DP solution given in the comments, which I am trying to understand but not able to. <spoiler summary="DP solution"> ```cpp #include<bits/stdc++.h> using namespace std; typedef long long ll; ll a[1005]; int main() { int n; cin>>n; a[0]=1;a[1]=4;a[2]=4; for(int i=3;i<=n;i++) if(i&1) a[i]=4*((i+1)/2)+a[i-2]; else a[i]=4*((i+1)/2)+a[i-4]; cout<<a[n]; } ``` </spoiler> If someone can help me in understanding it, I would highly appre...
/B) problem on codeforces. Basically, the problem says that "A Robot is standing at origin and can

Full text and comments »

Tags dp, help
  • Vote: I like it
  • -3
  • Vote: I do not like it

107.
By OPyrohov, 6 years ago, In English
I can't solve this problem (looking for ideas/solutions) ... Hi Code Forces Fellows, Found a very interesting and challenging [problem](https://acm.timus.ru/problem.aspx?space=1&num=1695) while reading a [blog post](https://codeforces.me/blog/entry/62730). Originally, this problem (F) was a part of the timus [contest](https://acm.timus.ru/monitor.aspx?id=72). I can't solve it and it keeps me awake at night... As I understand, we need to find the number of **complete** and **unique** subgraphs (subsets of robots that are all friends). Suppose we have two groups of robots that are friends to each other: `{1, 2, 3}` `{2, 3, 4}` So, the possible unique subsets are: `{1}, {2}, {3}, {4}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}, {2, 4}, {3, 4}, {2, 3, 4}` And the answer will be `12` in this case, on the 12th day we will be out of possible unique combinations. My silly brute force solution gives a TLE on the 4th test case, of course, and I don't understand how to implement this idea efficiently. Could somebody please help me wit...

Full text and comments »

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

108.
By yhtyyar.s, history, 9 years ago, In English
Calculating execution time in c++ Hi Codeforces. Today i saw [user:GreenGrape,2018-02-09] solution of the problem [D. Robot Vacuum Cleaner](http://codeforces.me/problemset/problem/922/D) : [submission:35053688]. And i find there : ~~~~~ #define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr) while (t--) { clock_t z = clock(); solve(); debug("Total Time: %.3f\n", (double)(clock() - z) / CLOCKS_PER_SEC); } ~~~~~ With this code he gets execution time of function `solve()`. `clock()` gives you current time. It is useful to avoid time limits. I have wrote helpful macro and decided to share with you : ~~~~~ #define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr) #define time__(d) for(long blockTime = 0; (blockTime == 0 ? (blockTime=clock()) != 0 : false); debug("%s time : %.4fs", d, (double)(clock() - blockTime) / CLOCKS_PER_SEC)) ~~~~~ with this u can get execution time of parts of your programm. Example: ~~~~~ int main () { /*reading data*/ time...
Hi Codeforces. Today i saw [user:GreenGrape,2018-02-09] solution of the problem [D.Robot Vacuum

Full text and comments »

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

109.
By sillycross, 15 years ago, In English
A bug about hacking I think I found a bug about hacking. I did 2 successful hacks during Codeforces Round #115, but after contest it showed there's only one hack. The other one is 'ignored'. But I think it should be a successful hack. My hack: **38336 Apr 14, 2012 1:25:35 PM sillycross Skyly A --- Robot Bicorn Attack Ignored** The victim's submission history: **00:13:50 Accepted [pretests] → 1532327** **01:39:54 Accepted [final tests] → 1535677** And submission 1532327's status **By Skyly, contest: Codeforces Round #115, problem: (A) Robot Bicorn Attack, Hacked, #** Obviously the submission done in 00:13:50 was hacked by me ( I'm the only one who hacked this solution ) . But the hack was ignored. I think it was caused by my another hack using the same input. **38343 Apr 14, 2012 1:30:08 PM sillycross helThazar A --- Robot Bicorn Attack Successful hacking attempt** I knew that the codeforces judge would ignore same hacking inputs and only keep the last o...
**38336 Apr 14, 2012 1:25:35 PM sillycross Skyly A --- Robot Bicorn Attack Ignored**, **38343 Apr 14, 2012 1:30:08 PM sillycross helThazar A --- Robot Bicorn Attack Successful, **By Skyly, contest: Codeforces Round #115, problem: (A) Robot Bicorn Attack, Hacked, #**

Full text and comments »

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

110.
By HEIR_OF_SLYTHERIN, history, 4 years ago, In English
Help required in a question **Question:** A global distribution company has a stack of many items in its warehouse. Each stack is stored in the form of piles. The height of some ples is very high, and the height of some piles is very low and this unevenness is causing problems in the warehouse. To solve this, the company has developed a robot which will help in arranging all the piles property. To do it the company has prepared a list of N piles which contains the total number of items in each pile, each pile in the text has been identified by a unique to ranging from 0 to (N-1). The robot will go through this list first and then remove the items from the piles in such a manner that after removing all the items, the difference between the total items of any two piles is at most K. The robot can also remove a pile completely or left a pile complimely untouched if a pile has been removed completely than that pile will automatically get deleted from the list and will not be used in farther calculation. Werse an ...
Werse an algorithm for the robot to calculate how many items it will remove in seal from the piles

Full text and comments »

111.
By spar10, 2 years ago, In English
ICPC India 24-25 Preliminary Online Round Practice Problems In INDIA **two practice contests** for the **ICPC Preliminary Online** **round** were conducted on 09/11/2024 and 14/11/2024 respectively at DOMjudge. The problems from the contests are as follows: Practice Contest 1: - [A Game of Robots](https://github.com/spartan500213/ICPC_24-25_India/blob/main/ICPC_24-25_Practice1_Preliminary_India/A%20Game%20of%20Robots/prob-A%20game%20of%20robots.pdf) Limits: 1 sec/1.5 GB - [Discount in a Shop](https://github.com/spartan500213/ICPC_24-25_India/blob/main/ICPC_24-25_Practice1_Preliminary_India/Discount%20in%20a%20Shop/prob-Discount%20in%20a%20Shop.pdf) Limits: 1 sec/1.5 GB - [Ordering Teams](https://github.com/spartan500213/ICPC_24-25_India/blob/main/ICPC_24-25_Practice1_Preliminary_India/Ordering%20Teams/prob-Ordering%20Teams.pdf) Limits: 1 sec/1.5 GB - [Pen Pineapple Apple Pen](https://github.com/spartan500213/ICPC_24-25_India/blob/main/ICPC_24-25_Practice1_Preliminary_India/Pen%20Pineapple%20Apple%20Pen/prob-Pen%20Pineapple%20Apple%2...

Full text and comments »

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

112.
By Christine-, history, 5 months ago, In English
Codeforces rating deflation <div align="right"> <table> <tr> <td align="left"><em> &mdash; You know what they call an International Grandmaster in 2026?<br> &mdash; They don't call it an International Grandmaster?<br> &mdash; No, man, they got the AI there, they wouldn't know what International Grandmaster is.<br> &mdash; What'd they call it?<br> &mdash; They call it International Master. </em></td> </tr> </table> </div> ### Introduction There was a heated discussion recently, and I decided to quantify the rating deflation over the recent 1.5 years. After accounting for natural improvement, I found roughly 150-190 rating points of deflation. The following is the rating gap between AI period and pre-AI period. ![Codeforces rating deflation](/predownloaded/f1/e2/f1e24c6c9cec1abfe4ba887e365f6ae049260df9.png) ### Background - We need to estimate the recent rating dynamics and compare it with pre-AI dynamics. - Participants have natural improvement when they train, especially lower rated...
| 1996 | 1996 | 0 | 69 | | miss_robot | Germany | 2057 | 2209 | +152 | 14 | | kzyKT | Japan

Full text and comments »

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