Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

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 Rhodoks, history, 4 years ago, In English
Codeforces Round #810 Editorial Sorry for the late editorial. May this editorial help you. If you have questions, feel free to ask. [problem:1711A] <spoiler summary="hint1."> The minimal weight is at least $1$ since $1$ divides any integer (so $1$ divides $p_1$). </spoiler> <spoiler summary="solution"> Since $k+1$ does not divide $k$, a permutation with weight equal to $1$ is: $[n,1,2,\cdots,n-1]$. </spoiler> <spoiler summary="code"> ~~~~~ #include <bits/stdc++.h> using namespace std; void work() { int n; cin>>n; cout<<n<<' '; for (int i=1;i<n;i++) cout<<i<<' '; cout<<endl; } int main() { int casenum=1; cin>>casenum; for (int testcase=1;testcase<=casenum;testcase++) work(); return 0; } ~~~~~ </spoiler> [problem:1711B] <spoiler summary="hint1."> See the party as a graph. </spoiler> <spoiler summary="hint2."> Divide the vertices into two categories according to their degrees' parity. </spoiler> <spoiler summary="solution"> Let's consider ...
> ~~~~~ #include using namespace std; void work

Full text and comments »

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

2.
By MikeMirzayanov, 10 years ago, translation, In English
Codeforces: summing up 2016 year <center> <img src="http://assets.codeforces.com/images/Happy-New-Year-HD-Wallpapers.jpg"/> </center> Somehow it turns out that for me, each coming the New Year means more and more. This is an excellent opportunity to take stock, to breathe fresh air and to go through a kind of catharsis. This is a rare opportunity to be with the family, dress up in Santa Claus and just have fun. Holidays give me a clear criterion that I do the right things. If during the holidays, I begin to think about it, to recall some deferred ideas, eager to implement something new. So I’m doing right things. My things. And now exactly the same as in several recent years: during New Year holidays I write code for Codeforces, trying new technology or simply I’m making minor changes in testlib. It is necessary to me: at this moment are no deadlines, do not press the obligation. Just now, at 3 am, I can not break away from being able to do something new. I would like to take a moment and realize that spun in ...
things. And now exactly the same as in several recent years: during New Year holidays I writecode, * Championship VK Cup 2016 (together with VK) * Championship CROC 2016 (together with КРОК, * чемпионат VK Cup 2016 (совместно с ВКонтакте) * чемпионат КРОК 2016 (совместно с КРОК) * мини, . Баумана) * мини-чемпионат Intel Code Challenge (совместно с Intel) * спонсорские раунд CanadaCup

Full text and comments »

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

3.
By SecondThread, history, 3 years ago, In English
It's Happening! Meta Hacker Cup 2023 Schedule Meta Hacker Cup 2023 Schedule ================== Meta Hacker Cup is back! We’re excited to announce our schedule for our 2023 season, kicking off on **September 22nd**! - Practice Round: [Fri. Sept 22nd, 10am Pacific — Mon. Sep. 25th, 10am Pacific](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Meta+Hacker+Cup+2023+Practice+Round&iso=20230922T10&p1=234) (72 hours)* - Round 1: [Sat. Oct. 7th, 10am — 1pm Pacific](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Meta+Hacker+Cup+2023+Round+1&iso=20231007T10&p1=234&ah=3) (3 hours) - Round 2: [Sat. Oct. 21th, 10am — 1pm Pacific](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Meta+Hacker+Cup+2023+Round+2&iso=20231021T10&p1=234&ah=3) (3 hours) - Round 3: [Sat. Nov. 4th, 10am — 1pm Pacific](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Meta+Hacker+Cup+2023+Round+3&iso=20231104T10&p1=234&ah=3) (3 hours) - Finals: [Sat. Dec. 9th, 6am &mdash; 10am Pacific](https://www.timeanddate.com/worldclock...
It's Happening! Meta Hacker Cup 2023 Schedule, +Hacker+Cup+2023+Round+1&iso=20231007T10&p1=234&ah=3) (3 hours) - Round 2: [Sat. Oct. 21th, 10am — 1pm

Full text and comments »

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

4.
By stevenkplus, history, 6 years ago, In English
I challenge you to a duel, Errichto (UPD: Saturday 11am PT) ![Scoreboard](/predownloaded/08/57/0857157477081fc11f0c1d1814de19e66cb0006c.png) Dear [user:Errichto,2020-09-17], In case you are unaware, you beat me by 3 seconds of penalty on [Facebook Hacker Cup Round 3](https://www.facebook.com/codingcompetitions/hacker-cup/2020/round-3/scoreboard). Upon deep reflection, I decided that I will not accept this lying down. In order to avenge this notorious defeat, I am challenging you to a 1v1 duel. **Rules:** 1. Duel will be held as a lockout competition and will be televised live 2. Lockout problems will be chosen by a neutral problem setter 3. Loser must change their main to honor the winner. See below for details ~~~~~ // your template if you lose #define stevenkplus main int stevenkplus() { // your code here } ~~~~~ --- **Update:** We're doing it this Saturday! https://www.timeanddate.com/worldclock/fixedtime.html?msg=Errichto+vs+Stevenkplus&iso=20200926T11&p1=224&ah=1 Will be broadcast live at https://www.twitch...
Hacker Cup Round 3](https://www.facebook.com/codingcompetitions/hacker-cup /2020/round-3/scoreboard). Upon

Full text and comments »

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

5.
By SecondThread, 2 years ago, In English
Meta Hacker Cup 2024 Schedule — Introducing the Meta Hacker Cup AI Track Meta Hacker Cup 2024 ================== Meta Hacker Cup is back! We’re excited to announce our schedule for our 2024 season, kicking off on September 20th! - Practice Round: [Fri. September 20th, 10am Pacific (72 hours)](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Meta+Hacker+Cup+Practice+Round&iso=20240920T10&p1=234)* - Round 1: [Sat. October 5th, 10am Pacific](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Meta+Hacker+Cup+Round+1&iso=20241005T10&p1=234&ah=3) (3 hours) - Round 2: [Sat. October 19th, 10am Pacific](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Meta+Hacker+Cup+Round+2&iso=20241019T10&p1=234&ah=3) (3 hours) - Round 3: [Sat. November 2nd, 10am Pacific](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Meta+Hacker+Cup+Round+3&iso=20241102T10&p1=234&ah=3) (3 hours) - Finals: [Sat. December 7th, 6am Pacific](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Meta+Hacker+Cup+Finals&iso=20241207T10&p1=234&ah=4) (4 hou...
Meta Hacker Cup 2024 Schedule — Introducing the Meta Hacker Cup AI Track, ://www.timeanddate.com/worldclock/fixedtime.html?msg=Meta+Hacker+Cup +Round+1&iso=20241005T10&p1=234&ah=3) (3

Full text and comments »

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

6.
By tourist, history, 10 years ago, translation, In English
VK Cup 2017 Round 3 + Codeforces Round #412 -- Tutorial Here is the tutorial of VK Cup 2017 Round 3 and Codeforces Round #412. Enjoy! <spoiler summary="Is it rated?"> [tutorial:807A] <spoiler summary="Code"> ~~~~~ n = int(input()) results = [] for i in range(n): results.append(list(map(int, input().split()))) for r in results: if r[0] != r[1]: print("rated") exit() for i in range(n): for j in range(i): if results[i][0] > results[j][0]: print("unrated") exit() print("maybe") ~~~~~ </spoiler> </spoiler> <spoiler summary="T-Shirt Hunt"> [tutorial:807B] <spoiler summary="More efficient code"> ~~~~~ #include <bits/stdc++.h> using namespace std; int main() { int p, x, y; cin >> p >> x >> y; for (int s = y; ; s++) { if (s % 50 != x % 50) { continue; } bool me = false; int i = s / 50 % 475; for (int j = 0; j < 25; j++) { i = (i * 96 + 42) % 475; if (i + 26 == p) { me = true; ...
VK Cup 2017 Round 3 + Codeforces Round #412 -- Tutorial, ~~~~~ #include , ~~~~~ n = int(input()) a = sorted(list(map, ~~~~~ n = int(input()) results = [] for i in range(n, ~~~~~ p, x, y = map(int, input().split()), Here is the tutorial of VK Cup 2017 Round 3 and Codeforces Round #412. Enjoy!

Full text and comments »

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

7.
By Intellegent, 6 months ago, In English
Spectral::Cup 2026 Round 2 (Codeforces Round 1100, Div. 1 + Div. 2) <center> <img src="https://i.imgur.com/lPGWfOR.png" style="width: 300.0px;max-width: 100.0%;max-height: 100.0%;"></center> <center> <h1> Greetings Codeforces! </h1> </center> [user:sammyuri,2026-05-18], [user:myst-6,2026-05-18] and I are absolutely chuffed to bits to invite you all to have a go at Codeforces Round ${12}_{10}$ ([contest:2229]), kicking off at [contest_time:2229]. There will be **9** absolute cinema problems for you to solve over the course of **3 hours**, some problems will have multiple parts. This round will be combined for Division 1 and Division 2 and will be rated for everyone. I’d like to raise a glass to the following brilliant minds for making this whole thing possible: - [user:dominater069,2026-05-18] for splendid coordination. - [user:um_nik,2026-05-18] for preliminary review. - The fine assembly of testers: [user:arvindf232,2026-05-18], [user:evenimage,2026-05-18], [user:geothermal,2026-05-18], [user:sana,2026-05-18], [user:wansur,20...
Spectral::Cup 2026 Round 2 (Codeforces Round 1100, Div. 1 + Div. 2), prizes Code fast, think faster – see you in the next round of Spectral::Cup

Full text and comments »

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

8.
By zimpha, 6 years ago, In English
List of All Open Cup Contests Open Cup has very high quality problems. I made a list for all the contests containing the standings, sources, upsolving links, statements and discuss blog in codeforces. Some materials and links of old opencup contests are missing, maybe [user:snarknews,2020-11-10] could help to fill these entries. I will update the list when new opencup stages published. Note: most of the upsolving links need the logins for yandex.contest or opentrains. ## XXI Open Cup named after E.V. Pankratiev | # | Contest | Upsolving | Materials | |:--:|:------------|:--:|:--:| | Stage 1 | [Grand Prix of Eurasia](https://official.contest.yandex.ru/opencupXXI/contest/20063/standings)<br/> [XXI All-Siberian Programming Contest. Online](https://olympic.nsu.ru/files/inet_res_2020_0.pdf) | [baekjoon](https://www.acmicpc.net/category/detail/2403)<br/> [yandex](http://official.contest.yandex.ru/opencupXXI/contest/20063) | [statement](https://yadi.sk/i/dsRvTxbgJ9fDXw) [discuss](https://codeforces.me/blog/...
List of All Open Cup Contests, /index.cgi?data=macros/stage&stg=14&region=main&ncup=och) [Tatarstan Code Cup 2017](https, ://opencup.ru/index.cgi?data=macros/stage&stg=14&region=main&ncup=och) [Tatarstan Code Cup 2017

Full text and comments »

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

9.
By maomao90, 2 years ago, In English
Meta Hacker Cup... Why must you be so special?? _Disclaimer: This is a rant about Meta Hacker Cup and may not contain any useful information._ Meta Hacker Cup is one of the biggest annual programming competitions, but it has the strangest submission format, unlike any other online judge. Why does it have to be so different? Let’s take a look at how Meta Hacker Cup 2024 Round 1 went for [user:maomao90,2024-10-06] > The time now is 1:00 AM in Singapore. The contest starts, and maomao90 begins solving the problems. > The time now is 1:41 AM. maomao90 has solved problems A, B, and C without much trouble and starts working on problem D. After quickly coming up with a theoretical solution, maomao90 begins coding. > The time now is 2:05 AM. The code is ready and passes the sample tests. maomao90 proceeds to validate the solution. > The time now is 2:06 AM. Validation passes, and the input zip file is downloaded. > The time now is 2:07 AM. maomao90 runs the code on the final test. ![Image showing assertion failed](https...
Meta Hacker Cup... Why must you be so special??, zip file and runs the code for the final test. > The time now is 3:45 AM. maomao90 submits the, > The time now is 3:44 AM. After a final check, maomao90 downloads the zip file and runs thecode

Full text and comments »

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

10.
By KAN, 21 month(s) ago, In English
Codeforces Blitz Cup 2025 Hi Codeforces! As announced earlier, we’re holding an individual competition, the Codeforces Blitz Cup 2025, to celebrate 15 years of Codeforces. The tournament features PvP matches in a novel Blitz format, where every second (literally!) counts. In a 40-minute match, the opponents rush to solve each consecutive problem quicker than the rival. One needs to come up with a correct solution, think over the optimal implementation, and code cleanly: only the first one to get a problem correctly claims the points. <spoiler summary="Complete Blitz rules"> - Each match lasts 40 minutes, with 7 problems of increasing difficulty (worth 2, 3, 4, 6, 8, 10, and 12 points). - Problems are revealed one at a time, in the order of increasing difficulty. - Only the first contestant to solve a problem earns points. - Once a problem is solved, it becomes unavailable, and the next one is revealed after 60 seconds. Contestants need to code the solution from scratch. It is forbidden to use ...
Codeforces Blitz Cup 2025, Blitz Cup 2025, to celebrate 15 years of Codeforces. The tournament features PvP matches in a novel

Full text and comments »

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

11.
By MikeMirzayanov, 7 years ago, translation, In English
Codeforces: Итоги 2019 <a style="float:right; display: inline-block; margin:0 1em 1em 2em; max-width: 60%;" href="https://codeforces.me/10years"/> <img style="max-width:100%" src="https://assets.codeforces.com/images/codeforces-10-years-300.png"/> </a> Привет, Codeforces! Недавно платформе исполнилось <b>10 лет</b>. Мы принимаем ваши поздравления по ссылке <b><a href="https://codeforces.me/10years">https://codeforces.me/10years</a></b>. Пожалуйста, ознакомьтесь с прогрессом в 2019-м году и <a href="https://codeforces.me/10years">поддержите краудфандинг-кампанию</a> по случаю юбилея. Ваше пожертвование станет вкладом в будущее Codeforces, поможет его развитию и работе. Нам нужны ресурсы, чтобы продолжать проводить раунды, не останавливаться в разработке, внедрять нововведения и поддерживать существующую инфраструктуру. В 2019-м году над задачами совместно с многочисленными авторами работали координаторы: [user:KAN,2020-02-06], [user:300iq,2020-02-06], [user:cdkrot,2020-02-06], [user:arsijo,20...
, спасибо! * **Mail.Ru** — Технокубок и Russian AI Cup * **VK**, VK Cup — теперь личное

Full text and comments »

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

12.
By KaiSuoShuTong, 20 months ago, In English
Codeforces Round #1010 (Div. 1, Div. 2, based on Zhili Cup 2025) <img src="/predownloaded/56/63/566383e7e7fa812dd2a088c602242a8719a18bea.png" style="width: 250.0px;float: right;margin: 0 1.0em 1.0em 1.0em;max-width: 100.0%;max-height: 100.0%;"> Nihao! Hello to all fans of competitive programming and Codeforces enjoyers! On behalf of Tsinghua University’s Zhili College, we — your proud and slightly sleep-deprived Class of 2028 Information and Computing Science students — are happy to invite you to participate in [contest:2081] and [contest:2082], which will take place on [contest_time:2081]. **Note the unusual start time of the round.** You’ll have **3 hours** to tackle **7 problems** for division 1 and **6 problems** for division 2, the round will be rated for all participants. It’s a little longer than your typical Codeforces round, and yes, we know you’ll be sleep-deprived — but who needs sleep when there’s coding to do, right? This round’s problems are brought to you by the incredible [user:Ecrade_, 2025-03-01], [user:newbiewzs, 2025-...
Codeforces Round #1010 (Div. 1, Div. 2, based on Zhili Cup 2025), , and may your code be bug-free and your coffee cup never empty.** See you at the round! **UPD, You’ll have **3 hours** to tackle **7 problems** for division 1 and **6 problems** for division 2

Full text and comments »

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

13.
By SecondThread, history, 3 years ago, In English
Hacker Cup Shirts 2023 Meta Hacker Cup Shirts ================== Hacker Cup prizes are back this year, and the shirts are back in black! The **top 2000 participants** in [Round 2](https://www.facebook.com/codingcompetitions/hacker-cup/2023/round-2) will win a shirt. If you qualify for [Round 3](https://www.facebook.com/codingcompetitions/hacker-cup/2023/round-3) and finish in the top 200, you'll win a shirt with a top-200 badge on the sleeve instead of the normal shirt. Just like last year, T-Shirts will be able to be claimed in your [Hacker Cup Profile](https://www.facebook.com/codingcompetitions/profile) after we have finished plagiarism checks for the Round 3. <strike>(or after we have finished plagiarism checks for Round 2 if you didn't qualify for Round 3 and have no chance of winning a top-200 shirt)</strike> ![ ](https://wumbogames.github.io/cfPictures/hc2023profileprize.png) ![ ](https://wumbogames.github.io/cfPictures/hc2023shirt.png) You must claim your shirt by **December 15th*...
Hacker Cup Shirts 2023, plagiarism checks for Round 3 on **Monday, November 6th**., /codingcompetitions/hacker-cup/2023/round-2) will win a shirt. If you qualify for [Round3](https

Full text and comments »

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

14.
By purplesyringa, history, 2 years ago, In English
Please improve QoL for blogs I'm pretty sure I've spent more time writing blogs than contests on Codeforces. Over time, I've found plenty of rough edges. So this is a plea to the Codeforces team to fix them. I'm effectively going to say "please redo everything" over dozens of paragraphs, but I'll hopefully make the steps to the solution tangible and clear. If this is deemed way too ambitious, few improvements are better than none. [cut] <!-- --> ## Publication time So I write a post in the Codeforces UI, save a draft, update it a few times, think it's ready, and publish it. I open my brand new post and see: > ### Totally not a useless post > By [user:purplesyringa,2024-09-24], history, 3 days ago, In English Okay, wait, "3 days ago"? Oh, right, that's when I saved the first draft. Now people open the post, see "3 days ago", see 0 upvotes, and what do they think? That's right, they think it's garbage because no one's voted positive, so they skip the article. Maybe not everyone's like tha...
2024 Schedule — Introducing the Meta Hacker Cup AI Track, 3 months ago, +528, hours ago, +5 - Meta Hacker Cup 2024 Schedule — Introducing the Meta Hacker Cup AI Track,3 months

Full text and comments »

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

15.
By KAN, 9 years ago, translation, In English
VK Cup 2018 Раунд 2 и Codeforces Round 472 Всем привет! Завтра, [24-го марта 2018 в 18:35 по московскому времени](https://www.timeanddate.com/worldclock/fixedtime.html?msg=VK+Cup+2018+Round+2&iso=20180324T1835&p1=352&ah=2) состоится второй отборочный раунд чемпионата VK Cup 2018! В нем сразятся 450 команд, которые стали лучшими в первом раунде и первом уайлд-кард раундах. Лучшие 100 команд в завтрашнем раунде выйдут в раунд 3 напрямую и получат футболку чемпионата, остальным же можно будет пожелать удачи во втором уайлд-кард раунде. Для тех, кто не прошел в раунд 2 или просто не принимал участие в VK Cup 2018, состоятся параллельные раунды Codeforces как для первого, так и для второго дивизиона. Участвуют все! VK Cup 2018 Раунд 2 и раунд для первого дивизиона будут содержать шесть задач, раунд для второго дивизиона &mdash; пять. Авторами задач являются [user:cyand1317,2018-03-23], [user:skywalkert,2018-03-23], [user:Claris,2018-03-24] и я. Большое спасибо [user:fcspartakm,2018-03-23] и [user:Tommyr7,2018-03-23] за п...
VK Cup 2018 Раунд 2 и Codeforces Round 472, изначальным время для раунда 3 VK Cup.**, раунда 3 VK Cup.** Опубликован [разбор](/blog/entry/58544). Поздравляем победителей! VKCup

Full text and comments »

Announcement of VK Cup 2018 - Round 2
  • Vote: I like it
  • +209
  • Vote: I do not like it

16.
By SecondThread, history, 4 years ago, In English
Meta Hacker Cup Shirts 2022 Meta Hacker Cup Shirts ================== The Hacker Cup Team has done a bunch of work over the past year to streamline the shirt claiming process, and we're excited for you to finally see what we've added. You can now see the Hacker Cup Prizes you've earned in the past (and the ones available to claim this year) on your profile, with tracking codes, links to claim them, and your claim codes built into the site. Emails this year will also be coming from us, rather than from our third party, which should help prevent them from being marked as spam. If you participated in Meta Hacker Cup this year and placed in the top 2000 of [Round 2](https://www.facebook.com/codingcompetitions/hacker-cup/2022/round-2), **you can now claim your shirt** on your [Hacker Cup profile page](https://www.facebook.com/codingcompetitions/profile). ![ ](https://wumbogames.github.io/cfPictures/listed_prizes.png) ![ ](https://wumbogames.github.io/cfPictures/shirts.png) You must claim your shirt b...
Meta Hacker Cup Shirts 2022, Meta Hacker Cup Shirts ================== The Hacker Cup Team has done a bunch of work over the

Full text and comments »

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

17.
By Radewoosh, history, 11 years ago, In English
VK Cup 2016 — Round 3 — Editorial Editorial was created by [user:Errichto,2016-05-07], but he said that he has enough contribution, so I'm posting it for you. ;) #1 [problem:673A] (invented by [user:GlebsHP,2016-05-07] &mdash; thanks!) You are supposed to implement what is described in the statement. When you read numbers $t_i$, check if two consecutive numbers differ by more than $15$ (i.e. $t_i - t_{i-1} > 15$). If yes then you should print $t_{i-1}+15$. You can assume that $t_0 = 0$ and then you don't have to care about some corner case at the beginning. Also, you can assume that $t_{n+1} = 91$ or $t_{n+1} = 90$ (both should work &mdash; do you see why?). If your program haven't found two consecutive numbers different by more than $15$ then print $90$. If you still have problems to solve this problem then check codes of other participants. [submission:18286606] #2 [problem:673B] (invented by [user:Errichto,2016-05-07]) Some prefix of problems must belong to one division, and the remaining suf...
VK Cup 2016 — Round 3 — Editorial, the middle. We calculate dp for first $q^{2/3}$ days and later we use multiply vectors by matrix, :18286633] #3 [problem:673C] (invented by [user:Errichto,2016-05-07]) We are going to iterate

Full text and comments »

Tutorial of VK Cup 2016 - Round 3
  • Vote: I like it
  • +109
  • Vote: I do not like it

18.
By SecondThread, history, 2 years ago, In English
Hacker Cup Shirts 2024 Meta Hacker Cup Shirts ================== Hacker Cup shirts are back this year! If you placed in the top 2000 of [Round 2](https://www.facebook.com/codingcompetitions/hacker-cup/2024/round-2), you'll have a shirt available on your Hacker Cup Profile page. If you placed in the top 200 of [Round 3](https://www.facebook.com/codingcompetitions/hacker-cup/2024/round-3), you'll win a shirt with a top-200 badge on the sleeve, instead of the normal shirt. ![ ](https://wumbogames.github.io/cfPictures/AvailableExample.png) ![ ](https://wumbogames.github.io/cfPictures/Shirts2024.png) You must claim your shirt by **December 13th**. We will not be shipping shirts after the 13th. Due to regulations, Meta is also not able to support prize shipments to the following countries at this time: <spoiler summary="Country List"> - Belarus &mdash; Suspended - Central African Republic &mdash; Suspended - Comoros &mdash; Not Served - Cuba &mdash; Not Served - Equatorial Guinea &mdash; Su...
Hacker Cup Shirts 2024, 3](https://www.facebook.com/codingcompetitions/hacker-cup/2024/round-3), you'll win a shirt with a

Full text and comments »

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

19.
By thanhchauns2, 4 years ago, In English
Codeforces Round #812 (Div.2) Hi Codeforces! ================== [user:_dlbm17,2022-06-25], [user:Demen100ns,2022-06-25], [user:Spyofgame,2022-06-25] and I are delighted to invite you to participate in [Codeforces Round #812 (Div. 2)](https://codeforces.me/contests/1713). - Start time: [contest_time:1713] - Duration: **120 minutes**. - Number of tasks: **6**, including at least **one interactive** problem. Make sure to read [this blog](https://codeforces.me/blog/entry/45307) and familiarize yourself with these types of problem before the round! <spoiler summary="This contest is brought to you by:"> - <a href = "https://www.facebook.com/HocvienPTIT">PTIT</a>, my university. - <a href = "https://discord.gg/vKjE9xan">Code Mely</a>, a Vietnamese fanpage for Computer Science. </spoiler> <img align="right" src="https://i.ibb.co/VLCYnxH/received-1102672770650793-1.png" width="60%" height="60%"> Special thanks to: - <span>[user:errorgorn,2022-08-02] for wonderful coordination</span><span style="col...
/vKjE9xan">Code Mely, a Vietnamese fanpage for Computer Science.

Full text and comments »

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

20.
By ATSTNG, history, 7 years ago, In English
[Tutorial] Matroid intersection in simple words **[This article is also available in [Russian](https://codeforces.me/blog/entry/69287?locale=ru)]** Hello, CodeForces. I think that matroids are beautiful and powerful concept, however, not really well known in competitive programming. I’ve discovered matroids at 2019 Petrozavodsk Winter Training Camp. There was a problem that clearly cannot be solved using usual techniques I knew, editorial for this problem was just these three words “just matroid intersection”. Back then it took me more than 2 days of upsolving to find all the information and details I need and implement solution that gets Accepted on this. And it took way longer to actually understand why does it work and exactly how does it work. (I still hesitate in some details.) Of course, it is not hard to google up all the definitions and some related articles, but in my opinion they all are focused more on mathematical part of theory, strict proofs in some not really obvious but short ways, and observing only ke...
understanding: 1. Basics of set theory and set operations 2. Spanning trees in graphs3. Matchings

Full text and comments »

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

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

Full text and comments »

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

22.
By __baozii__, history, 10 months ago, In English
Invitation to Baozii Cup 3 Hello, Codeforces! We are happy to invite you Baozii Cup 3, which will take place on [contest_time:664651]. You will have $5$ hours to solve $13$ problems, including **at least one** interactive problem. This is a team contest following ACM/ICPC rules, with teams of up to $3$ members. The penalty for an incorrect submission is $20$ minutes. The standings will be frozen for the last $60$ minutes of the contest. Most problems are created and prepared by me, with help from [user:Bronya_H,2026-01-17], [user:zeemanz,2026-01-17], and [user:TRDOG,2026-01-17]. We would like to thank: - [user:MikeMirzayanov,2026-01-17] for creating the fantastic CodeForces and Polygon platform. - [user:Sserxhs,2026-01-17], [user:SATSKY_2025target_LGM,2026-01-17], [user:-WIDA-,2026-01-17], [user:fatalerror,2026-01-17], and [user:itsiftikar02,2026-01-17] for testing the round and providing valuable feedback. - [user:-firefly-,2026-01-17] for generously letting me copy his [Soy Cup #2: ...
Invitation to Baozii Cup 3, Hello, Codeforces! We are happy to invite you Baozii Cup 3, which will take place on, UPD3: Note that rules about third party code for Codeforces still apply in this contest. If you are

Full text and comments »

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

23.
By hxu10, history, 2 years ago, In English
My Meta hacker cup experience I have participated in the Meta Hacker Cup for four consecutive years: 2021, 2022, 2023, and 2024. After receiving the T-shirt today, I would like to share my experiences and progress. **2021: A newbie want a T shirt** ![2021](https://github.com/user-attachments/assets/9abd55cc-3008-47ba-9399-a301a35bed51) This year, I was a complete newbie. The first two rounds lasted over 24 hours, which gave me more time to solve the problems, so my rank looked good. However, Round 2 was only 3 hours long, and it turned out to be a complete disaster for me. I got stuck on the first problem and doubted my solution repeatedly. Although I finally solved it 30 minutes before the contest ended, I had no time left for the other problems. In the end, I only solved one problem and ranked 2700+, which meant I didn’t even qualify for a T-shirt. I shared my result with some Meta HR representatives, but they didn’t respond. I applied to several positions at Meta, but my resume was rejected. I also...
My Meta hacker cup experience, also participated in the Google Code Jam Round 2 and ranked 1000+, but I failed to qualify for Round3, First, I wanted to challenge myself with Google Code Jam again because, although I qualified for, I also participated in the Google Code Jam Round 2 and ranked 1000+, but I failed to qualify for, This year, I performed much better. I finally made it to Google Code Jam Round 3 ! For the Hacker

Full text and comments »

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

24.
By SecondThread, history, 3 years ago, In English
Meta Hacker Cup 2023 Round 1 Meta Hacker Cup Round 1 ================== Good morning! [Meta Hacker Cup Round 1](https://www.facebook.com/codingcompetitions/hacker-cup/2023/round-1) starts on [Saturday, October 7th at 10:00 AM Pacific](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Meta+Hacker+Cup+2023+Round+1&iso=20231007T10&p1=234&ah=3) in under 48 hours! Anyone can register for Round 1 this year, even if you haven't participated in the practice round. Important info: - To qualify for Round 2, you must solve at least one problem in this round. (Due to having too many submissions in the early part of the contest, we relaxed this requirement from the earlier one of needing to place in the top 5000 of the round) - The contest will be **3 hours**. - As usual, you may not discuss solution ideas or code until after the contest hours is over. It's your responsibility to make sure that your code is not leaked. We'll DQ contestants if we have reason to believe they shared code or solutions with oth...
Meta Hacker Cup 2023 Round 1, needing to place in the top 5000 of the round) - The contest will be **3 hours**. - As usual, you, Meta Hacker Cup Round 1 ================== Good morning! [Meta Hacker Cup Round 1](https

Full text and comments »

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

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

Full text and comments »

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

26.
By PrinceOfPersia, 12 years ago, In English
Valentine Algorithm cUp 2015 Are you in love with algorithms? If you are don't miss this round and be algorithm's valentine ;) ![ ](http://assets.codeforces.com/images/girl-and-laptop.jpg) On the night before valentine's day ([exact time](http://www.timeanddate.com/worldclock/fixedtime.html?day=13&month=2&year=2015&hour=18&min=30&sec=0&p1=166)), Valentine Algorithm cUp 2015 is going to take place. There will be 6 problems and 3 hours to solve them. All of them are written by me([user:PrinceOfPersia,2015-02-05]). This competition is like surprise languages but too different. 3 days before the contest, I will publish tutorial of 5 new algorithm languages(not programming languages) with their compiler codes. Each language is going to be really simple to learn and have at most 6 or 7 commands (they're not like programming languages). Your program should print the code written in the language the problem says and checker will run it (pay attention that inputs are encoded, don't try to read form input, j...
Valentine Algorithm cUp 2015, This competition is like surprise languages but too different. 3 days before the contest, I will

Full text and comments »

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

27.
By SecondThread, history, 13 months ago, In English
Hacker Cup Round 1 Recap Hacker Cup Round 1 Recap ================== **TLDR:** Hacker Cup Round 1 is a wrap! We’ll be holding Round 2 on **November 15th** (instead of November 1st) to allocate sufficient time for stress testing. Thanks to everyone who participated, and the judges hope you enjoyed the problems! First off, congratulations to [user:Geothermal,2025-10-29] for winning, and our top 3: 1. [user:Geothermal,2025-10-29], solving the set in 35 minutes and 35 seconds 2. [user:ksun48,2025-10-29], who solved C and D first and came back for B2 3. [user:tourist,2025-10-29], for placing third despite solving the set 12 seconds before Geothermal Additionally, I’d like to give a huge thanks to the people who helped make the round possible, including the authors: - A1/A2:[user:SecondThread,2025-10-29], with diagrams from Alex Li - B1/B2: [user:anhkha1004,2025-10-29] - C: [user:Intellegent,2025-10-29], with additional writing from SecondThread and Alex Li - D: [user:Intellegent,2025-10-29],...
Hacker Cup Round 1 Recap

Full text and comments »

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

28.
By TheScrasse, history, 5 years ago, In English
[Tutorial] Diameter of a tree and its applications Hello everyone,<br> finding the diameter is one of the most frequent ways to solve problems about trees. In this tutorial we will see how to find a diameter and some of its properties, and we will use them to solve some problems of increasing difficulty.<br> The first part of the tutorial is quite basic, so feel free to skip it and jump to the problems if you already know the concepts. Target: rating $[1400, 2300]$ on CF<br> Prerequisites: basic graph theory, greedy The diameter ------------------ Given an unweighted tree, let's define $\text{dist}(a, b) =$ the number of edges in the simple path $a \rightarrow b$. A diameter of the tree $a \rightarrow b$ is the longest path, i.e., the one that maximizes $\text{dist}(a, b)$ over all pairs of nodes. If there are multiple diameters, let's pick any of them. The same definition is valid for a weighted tree with nonnegative weights (with $\text{dist}(a, b) =$ the sum of the weights of the edges in the simple path $a \rightar...
> Try all possible paths in $O(n)$.

Full text and comments »

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

29.
By Kuroni, history, 2 years ago, In English
VNOI Cup 2024 Final — Mirror Invitation <center> <img src="/predownloaded/70/8f/708f459847db2916bf53cd154c153ce03f7d61a8.png"></img> </center> Hello again Codeforces! We are excited to invite you to the **mirror** contest of the **VNOI Cup 2024 Final Round**! Join us on [Saturday, August 3, 2024, at 12:00 AM GMT+7](https://www.timeanddate.com/worldclock/fixedtime.html?msg=VNOI+Cup+2024+-+Final+round&iso=20240803T12&p1=3909&ah=5) and try our fun, yet challenging problems as the finalists! VNOI Cup is a Competitive Programming competition hosted by VNOI (Vietnam Olympiads in Informatics community), a group of Vietnamese programmers like you, working together to make programming competitions more fun and challenging in Vietnam. We're a non-profit organization dedicated to supporting the growth of competitive programming in Vietnam. This competition is one of the many ways we aim to achieve this goal! Again, a big shoutout to our awesome problem setters and testers! Thanks to their hard work, we have an exciting co...
VNOI Cup 2024 Final — Mirror Invitation, **VNOI Cup 2024 Final Round**! Join us on [Saturday, August 3, 2024, at 12:00 AM GMT+7](https

Full text and comments »

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

30.
By MidnightCodeCup, 21 month(s) ago, In English
Midnight Code Cup is here <img alt="Neapolis University Pafos" src="/predownloaded/09/67/0967c4495a0c7e09b4854a493404ed57e3fecbe2.png" style="float:right;height: 150px; margin: 10px;"/> **The Qualification round has started! Cheer for your favourite team:** https://ranker.codeforces.com/ranklist/602915 We’re excited to launch the first-ever Midnight Code Cup (MCC) — a team competition featuring an online Qualification round and a 24-hour onsite Final. Expect algorithmic challenges, optimization puzzles, cutting-edge computer science, and some just plain weird problems. It’ll be exhausting. And fun. Who are we? ----------- A team of problem solving <s>geeks</s> <s>veterans</s> enthusiasts, eager for the return of this contest format. The idea of Midnight Code Cup was born at **Recraft.AI** (AI image generation and graphic design pioneers) with huge support from **JetBrains** (creator of Kotlin, intelligent IDEs, and AI-driven developer tools) as well as **Neon** (developer-first open-source database)...
Midnight Code Cup is here, to launch the first-ever Midnight Code Cup (MCC) — a team competition featuring an online, **Update 3:** The registration will close on April, 9th, Who can participate? -------------------- Teams of 3 ready to rock and roll! No programming

Full text and comments »

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

31.
By SecondThread, history, 10 months ago, In English
Meta Hacker Cup Shirts 2025 - Claim before January 31st! Meta Hacker Cup Shirts ================== Hacker Cup shirts are back this year! If you placed in the top 2000 of [Round 2](https://www.facebook.com/codingcompetitions/hacker-cup/2025/round-2), you'll have a shirt available on your Hacker Cup Profile page. If you placed in the top 200 of [Round 3](https://www.facebook.com/codingcompetitions/hacker-cup/2025/round-3) and solved at least one problem correctly in that round, you'll win a shirt with a top-200 badge on the sleeve, instead of the normal shirt. ![ ](https://wumbogames.github.io/cfPictures/AvailableExample.png) ![ ](https://wumbogames.github.io/cfPictures/Shirts2025.png) You must claim your shirt by **January 31st**. We will not be shipping shirts claimed after the 31st. Due to regulations, Meta is also not able to support prize shipments to the following countries at this time: <spoiler summary="Country List"> - Belarus &mdash; Suspended - Central African Republic &mdash; Suspended - Comoros &mdash; Not Se...
Meta Hacker Cup Shirts 2025 - Claim before January 31st!, 3](https://www.facebook.com/codingcompetitions/hacker-cup/2025/round-3) and solved at least one

Full text and comments »

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

32.
By Kuroni, history, 2 years ago, In English
VNOI Cup 2024 Round 1 — Mirror Invitation Hello Codeforces! We're thrilled to announce the third season of the VNOI Cup! &#127881; We invite you to join the mirror round of our programming contest. **Remember, if you are a Vietnamese-national, consider joining the official round**. <center> <img src="/predownloaded/22/11/2211a1152e1cecea1a8e0cb38bd178808b077238.png"></img> </center> VNOI Cup is a Competitive Programming competition hosted by VNOI (Vietnam Olympiads in Informatics community), a group of Vietnamese programmers like you, working together to make programming competitions more fun and challenging in Vietnam. We're a non-profit organization dedicated to supporting the growth of competitive programming in Vietnam. This competition is one of the many ways we aim to achieve this goal! A big shoutout to our awesome problem setters and testers! Thanks to their hard work, we have an exciting contest ready for you. - [user:xuanquang1999,2024-05-26], [user:atoiz,2024-05-26], [user:vinfat,2024-05-26], [us...
VNOI Cup 2024 Round 1 — Mirror Invitation, Hello Codeforces! We're thrilled to announce the third season of the VNOI Cup! 🎉 We

Full text and comments »

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

33.
By andrewzta, 13 years ago, In Russian
Russian Code Cup 2014 Определены даты проведения крупнейшей в России ежегодной олимпиады по спортивному программированию Russian Code Cup 2014. В этом году программисты сразятся за звание лучшего (и за главный приз – 10 тысяч долларов США) в четвертый раз. Регистрация на чемпионат уже идет, а первый тур состоится уже в эту субботу, 19 апреля! Russian Code Cup – это возможность для русскоязычных программистов со всего мира проверить свои силы и продемонстрировать мастерство, решая оригинальные задачи различной сложности, а также заявить о себе экспертному IT-сообществу. Олимпиада проходит в три этапа: квалификационные раунды, отборочный тур и финал, на каждом из которых участникам олимпиады предлагается от четырех до восьми разноплановых задач. Задания и техническую часть соревнования обеспечивают специалисты Mail.Ru Group и эксперты НИУ ИТМО – соорганизатора Russian Code Cup. На первых двух этапах программисты соревнуются онлайн на сайте Russian Code Cup. Первый квалификационный раунд состоится 19 ...
Russian Code Cup 2014, Победитель Russian Code Cup получит главный приз – 10 тысяч долларов США; участник, занявший второе

Full text and comments »

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

34.
By Kuroni, history, 17 months ago, In English
VNOI Cup 2025 - Round 2 Invitation ![ ](/predownloaded/79/22/7922b975c9cab6378b05cfb3da97b29dad08653c.png) Hello Codeforces! We invite you to join Round 2 of VNOI Cup 2025! &#9888;&#65039; For **international participants** (including those who participated in round 1): you will now compete alongside Vietnamese contestants in the main contest. The results from the first round will be merged afterward. Top performers will be invited to join the Final Round onsite in Vietnam, where they will compete in the **Open Division** — a separate onsite leaderboard from the official Vietnamese contestants. **To maintain the fairness of the contest, all international participants must identify themselves as such on the VNOJ website** (a guide on how to do so can be found [here](https://docs.google.com/document/d/e/2PACX-1vS7nLgYocUdt1oZhFFHNvn8BxaCB6Ni9LfmtJqjKPthre-Bot1uVWgKnRkJhD0YxSGh9Ong4TpCAUQZ/pub)). &#9888;&#65039; Please note that invited participants from the Open Division will need to **cover their own travel and ...
VNOI Cup 2025 - Round 2 Invitation, invite you to join Round 2 of VNOI Cup 2025! ⚠️ For **international participants

Full text and comments »

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

35.
By dXqwq, 18 months ago, In English
The 7th Turing Cup Tournament # 2025 · The 7th Turing Cup Tournament The Turing Cup is an invitational competition that is organized by one of the most successful informatics competition teams in China, the XinYouDui and partner with X-Camp Academy. ## Timeline | Event | Time (UTC+8) | |----------------------|-----------------------------------------| | Registration Time | May 06, 2025, 06:00 PM &mdash; May 25, 2025, 12:29 PM | | Opening Ceremony | May 25, 2025, 07:50 AM &mdash; 08:30 AM | | Contest Time | May 25, 2025, 08:30 AM &mdash; 12:30 PM | --- ## Contest Details ### Staff - Writers: [user:dXqwq,2025-05-22], [user:Flamire,2025-05-22], [user:myee,2025-05-22], [user:orzdevinwang,2025-05-22], [user:zhaohaikun,2025-05-22] - Testers: [user:dspt,2025-05-22], [user:emptyhope,2025-05-22], [user:jqdai0815,2025-05-22], [user:Kubic,2025-05-22], [user:le0n,2025-05-22], [user:zhaohiakun,2025-05-22] ### Features - **High Contest Q...
The 7th Turing Cup Tournament

Full text and comments »

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

36.
By errorgorn, 19 months ago, In English
1/phi Halving in Interactive Tree Problems Thanks to [user:toxicpie9,2025-04-22] for proofreading and emotional support. Recently, I was thinking about JOISC 2025 Space Thief. And there is a part where you need to do divide and conquer on a tree, where you need to split the edges of the tree into two components where the edges are both connected. Basically, we consider an interactive problem on a tree where there is a hidden edge. We are allowed to ask queries of the form $(v,N_v)$ where $v$ is a vertex of the tree and $N_v$ is a set of neighbouring edges of $v$. Then the query returns to us whether the hidden edge is in the subtree of one of $N_v$ when we root the tree at $v$. We maintain a set of edges that the hidden edge can be in. In each query, we try to split the set of edges into two parts and ask a query to separate them. In the worst case, we replace the set of edges by the larger component. Let $R$ be the maximum ratio of the larger component. In [this blog](https://codeforces.me/blog/entry/120446)...
create a similar situation where the centroid of $A \cup B_1$ has $3$ children of sizes $c,d,d$ where

Full text and comments »

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

37.
By Tony2_CF, history, 11 months ago, In English
The Time Complexity Lower Bound for Segment Tree Beats is log^2 Original Post: https://jiry-2.blog.uoj.ac/blog/1404 The following content is translated by Gemini 2.5 Pro. ## Part 1: Introduction to the Hacking Method ### How to Map the Hack Sequence to a Segment Tree First, we are given a Hack sequence of length $len$. After $O(1)$ range addition operations and $\Theta(\log len)$ global $\text{chkmax}$ operations, this sequence becomes a cyclic shift (rotation) of the original sequence. Since a cyclic shift does not affect our range addition and global $\text{chkmax}$ operations (we can simply shift the indices for the range addition accordingly), we can consider the sequence as unchanged. If we have such a sequence, let $len=n^{\frac{1}{3}}$, and place such a sequence at intervals of $n^{\frac{2}{3}}$. Each sequence corresponds exactly to a segment tree interval. A subtree of size $n^{\frac{2}{3}}$ contains exactly one such segment tree interval. For the Hack sequence, the range addition operations are performed one by one on eac...
}{3}}$, and place such a sequence at intervals of $n^{\frac{2}{3}}$. Each sequence corresponds exactly

Full text and comments »

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

38.
By __baozii__, history, 4 months ago, In English
Spectral::Cup 2026 Round 3 (Codeforces Round 1110, Div. 1 + Div. 2) Editorial We hope you enjoyed the problems! <spoiler summary="Rate the contest!"> <spoiler summary="Quality"> - Excellent contest - Good contest - Average contest - Bad contest - Horrible contest </spoiler> <spoiler summary="Difficulty"> - Trivial contest - Easy contest - Average contest - Hard contest - Impossible contest </spoiler> </spoiler> [problem:2245A] <spoiler summary="Solution"> [tutorial:2245A] </spoiler> <spoiler summary="Code"> ~~~~~ for _ in range(int(input())): n, k = map(int, input().split()) s = input() if k * 2 > n: print(-1) continue ans = 0 for i in range(k): ans += int(s[i] != 'R') + int(s[n - i - 1] != 'L') print(ans) ~~~~~ </spoiler> <spoiler summary="Rate the problem!"> <spoiler summary...

Full text and comments »

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

39.
By MidnightCodeCup, 17 months ago, In English
Midnight Code Cup Finals 2025 This weekend concluded the first season of the Midnight Code Cup with a long-awaited 24-hour contest. 29 teams – the best from the qualification round, including the qualification winners **Omogen Heap** – competed on-site in Belgrade, Serbia, on June 7-8. Team **Omogen Heap** jumped into first place around the midpoint of the contest and held the title until the very end. Congratulations to our first Midnight Code Cup champions on their dominant performance! Second place went to team **GoodBye2023**, and **Jinotega** finished in third. <img src="/predownloaded/e9/4e/e94e30de980b4d744d2ab445f30b58727f6a5871.jpg" align="left" style="width: 100%;" alt="Omogen Heap"/> <img src="/predownloaded/29/50/2950dfc71ef7a653721f8eb8830c0d79e3cc43b1.jpg" align="left" style="width: 50%;" alt="GoodBye2023"/><img src="/predownloaded/ab/d2/abd21f99c60852c6891a0ef545fbf8dd30370a93.jpg" align="left" style="width: 50%;" alt="Jinotega"/> <spoiler summary="Finalists"> 1 Omogen Heap: 23125.99 ...
Midnight Code Cup Finals 2025, This weekend concluded the first season of the Midnight Code Cup with a long-awaited 24-hour, ], [user:shibh308,2025-06-13], [user:Yu_212,2025-06-13]) 3 Jinotega [pinely]: 20585.03 ([user:Arterm,2025-06

Full text and comments »

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

40.
By waipoli, history, 23 months ago, In English
Eolymp Cup #3 ![ ](https://eolympusercontent.com/images/ak1nas6ed565j4mo28t7od66q0?width=1920) Eolymp Cup #3 ============= Get ready for the [third round of the Eolymp Cup](https://basecamp.eolymp.com/en/contests/s9jjggk0op4b55163d4t9l39nc) happening on **Sunday, December 15**! Compete for a chance to **win free HSU scholarships, Eolymp subscriptions**, and our exclusive **Evil Chmyaaax T-Shirt**. Don’t miss out on the action—we’re excited to see you there! ### About **Eolymp Cup** is a programming competition for students. The competition consists of 4 rounds, held throughout the year. Each round features 6 problems, each designed to challenge participants' knowledge of algorithms, data structures and programming. The competition is open to everyone, but prizes will only be awarded to participants who are born after January 1, 2002. All other participants will compete unofficially. ### Format and Duration In each round, you are given 3.5 hours to solve 6 problems. Each problem i...
Eolymp Cup #3, ![ ](https://eolympusercontent.com/images/ak1nas6ed565j4mo28t7od66q0?width=1920) EolympCup #3

Full text and comments »

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

41.
By Ilya_Is2022, 3 years ago, translation, In English
Community Code Cup 3 Hello, Codeforces! ================== I am pleased to invite you to participate in our new [Community Code Cup 3](https://cups.online/en/contests/contests_code_cup) round that will take place on the **All Cups** platform! The competition will take place [Friday, April 19, 2024, at 17:05]() and will be held according to the **ICPC** rules: - All solutions will be tested on a **full** set of tests; - **The penalty** for an incorrect attempt in this round will be $20$ minutes; - The rating table will be frozen in the **last hour**. **$6$** &mdash; **$7$** interesting tasks are expected for the participants of the competition. The duration of the round will be $2$ hours. The tasks have been prepared by: - Ilya Isaev [user:Ilya_Is2022,2024-01-02] - Stanislav Nekrasov [user:nekstas,2024-01-02] - Ilya Donov [user:donovilia2007,2024-03-23] - Maksim Gorshunov [user:maksonchik20,2024-03-23] The illustrator of the contest: - Victoria Moskaleva [user:vika1310,20...
Community Code Cup 3, - **Top 3** competitors will receive branded **All Cups T-shirts** and $6$ months of subscription, - **Топ 3** участников соревнования получат фирменные футболки **All Cups** и $6$ месяцев подписки

Full text and comments »

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

42.
By MikeMirzayanov, 12 years ago, translation, In English
Codeforces 5 years: Great news! Hello Codeforces! I am happy to announce that the indicated $10000 support fund was raised in a little more than three days! Thanks you very much friends! Now it became possible to pay the writers equivalent funds even they are in rubles. It was impossible because of great increase of the dollar exchange rate. |Round type|USD|Rubles| |-----------|--|---| |Div 1 + Div 2| $250+*$50 | 18000 rub | | Div 2 | $100+*$50 | 9000 rub | <small>We tie the money paid in rubles to the Central Bank of Russia exchange rate, rounded to the closest sum in rubles divisible by 5 (according to the rules of mathematical rounding). The table shows the values that were up-to-date when this post was published. An asterisk marks the bonus that is given if the round is prepared perfectly. </small> And that is not all! As I said before, we now have the opportunity to adequately support the coordinator of the Codeforces problems Max [user:Zlobober,2015-02-27] Akhmdov. He started working on his ...
achievements include the 5-th place at the Russian Code Cup 2014, the 10-th place in 2013 and the3-rd place, the Russian National Team. My biggest achievements include the 5-th place at the RussianCode Cup, достижений — 5 место Russian Code Cup 2014, 10-е место в 2013-м и 3-е в 2014-м году на NEERC в, последних достижений — 5 место Russian Code Cup 2014, 10-е место в 2013-м и 3 -е в 2014-м году на

Full text and comments »

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

43.
By KAN, 10 years ago, translation, In English
VK Cup 2017 — Wild-card раунд 1 Hi all! Tomorrow, on [April 5th 2017, at 15:35 UTC](https://www.timeanddate.com/worldclock/fixedtime.html?msg=VK+Cup+Wild-card+Round+1&iso=20170405T1835&p1=166&ah=2) the first Wild-card Round of VK Cup 2017 will be held. Along with it there will be parallel unofficial round in which everyone can take part. The rounds will use **special rules, the rounds will be unrated.** The problems were prepared by Codeforces team. The detailed rules will be added to this post 30 minutes before the rounds. I can say now that there will be 24-hours open hacks phase after the round, like in Codeforces Educational Rounds. **Round rules:** The round will be almost usual contest with ACM ICPC rules. There will be 12 problems for 2 hours. During the round your solutions will be tested on some basic tests, they should be much stronger than usual pretests. After the round you will have 24 hours to find tests against other participants’ solutions, this part is the same as in Educational round...
VK Cup 2017 — Wild-card раунд 1, /fixedtime.html?msg=VK+Cup+Wild-card+Round+1&iso=20170405T1835&p1=166&ah=2) the first Wild-card Round of

Full text and comments »

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

44.
By Lewin, history, 10 years ago, In English
VK Cup Round 2 + Codeforces Round #409 Tutorial <spoiler summary="Viscious Keyboard"> [tutorial:801A] <spoiler summary="example code 1"> ~~~~~ print (lambda s: max((s[:i] + x + s[i+1:]).count("VK") for x in "VK" for i in range(len(s))))(raw_input()) ~~~~~ </spoiler> <spoiler summary="example code 2"> ~~~~~ print (lambda s: s.count("VK") + int(any(x*3 in "K" + s + "V" for x in "VK")))(raw_input()) ~~~~~ </spoiler> </spoiler> <spoiler summary="Valued Keys"> [tutorial:801B] <spoiler summary="example code"> ~~~~~ x,y = raw_input(), raw_input() print all(a>=b for a,b in zip(x,y)) * y or "-1" ~~~~~ </spoiler> </spoiler> <spoiler summary="Voltage Keepsake"> [tutorial:772A] <spoiler summary="example code (c++)"> ~~~~~ #include <stdio.h> #include <algorithm> #include <assert.h> using namespace std; typedef long long ll; typedef long double ld; // Adjust MAXN for bounds const ll MAXN=1e5+4; // MAXV is the max amount of time we can take const ld MAXV=1e18; ll a[MAXN],b[MAXN]; ld exhaust[MAXN]; i...
VK Cup Round 2 + Codeforces Round #409 Tutorial, [tutorial:801A] , ~~~~~ print (lambda s: s.count("VK") + int(any(x*3 in "K" + s

Full text and comments »

Tutorial of VK Cup 2017 - Round 2
  • Vote: I like it
  • +63
  • Vote: I do not like it

45.
By dXqwq, 4 months ago, In English
The 8th Turing Cup Tournament **UPD 1: Submitting a recording will be required in order to win (division top 3 or best female coder) prize. The format of the recording & rules are the same with [AGC](https://atcoder.jp/posts/agc_proctoring_en).** **UPD 2: We've noticed that contest is unavailable in the X-Camp Contest System. We are investigating.** **UPD 3: International contestants should also register at XinYouDui contest system.** **UPD 4: You should submit your video file(or url) to `[email protected]`.** # 2026 · The 8th Turing Cup Tournament The Turing Cup is an invitational competition that is organized by one of the most successful informatics competition teams in China, the XinYouDui and partner with X-Camp Academy. ## Timeline | Event | Time (UTC+8) | |----------------------|-----------------------------------------| | Registration Time | Jun 18, 2026, 06:00 PM &mdash; Jul 30, 2026, 12:29 PM | | Opening Ceremony | Jul 30, 2026, 07:...
The 8th Turing Cup Tournament, **UPD 1: Submitting a recording will be required in order to win (division top 3 or best female

Full text and comments »

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

46.
By ssvb, 5 years ago, In English
$O(N^2)$ solution to Facebook Hacker Cup 2021 Round 1 problem A2 (part one) Right after the end of Facebook Hacker Cup 2021 Round 1, [user:wjomlex,2021-09-25] posted the following [comment](https://codeforces.me/blog/entry/94726?#comment-839269) in the discussion section under the announcement blog: > A common issue was people writing O(N^2) solutions to problem A when O(N) solutions are necessary. You won't be able to run an O(N^2) solution in 6 minutes when N = 800,000. But is this really true? Challenge accepted! ##### Problem A1 <div> <spoiler summary="Spoiler"> First of all, here is an $O(N)$ solution for [problem A1](https://www.facebook.com/codingcompetitions/hacker-cup/2021/round-1/problems/A1): <spoiler summary="Spoiler"> ~~~~~ #include <iostream> #include <vector> #include <stdint.h> using namespace std; /* * This is a solution for problem A1. Time complexity: O(N) * Characters in the input buffer are remapped: 'F' => 0, 'X' => 1, 'O' => 2 */ static int32_t solve_a1(const int8_t *arr, int n) { int32_t ans = 0, h...
$O(N^2)$ solution to Facebook Hacker Cup 2021 Round 1 problem A2 (part one), > ##### Problem A2, solution v0 Reusing code from the problem A1 solution allows to easily create an $O(N^3, Reusing code from the problem A1 solution allows to easily create an $O(N^3)$ solution for [problem

Full text and comments »

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

47.
By waipoli, history, 2 years ago, In English
Eolymp Cup #2 ![ ](https://eolympusercontent.com/images/ak1nas6ed565j4mo28t7od66q0?width=1920) Eolymp Cup #2 ============= We are very excited to announce [the second round of Eolymp Cup](https://basecamp.eolymp.com/en/contests/ptmnufrm6p6nl7gods1loo65go) on **6th of October at 15.00 UTC**! Take up a challenge to get a chance to win a trophy, medals, prizes, and scholarships at [Harbour.Space University](https://harbour.space/). **Eolymp Cup** is a programming competition for students. The competition consists of 4 rounds, held throughout the year. Each round features 6 problems, each designed to challenge participants' knowledge of algorithms, data structures and programming. The competition is open to everyone, but prizes will only be awarded to participants who are born after January 1, 2002. All other participants will compete unofficially. ### Registration You can register on the [contest page](https://basecamp.eolymp.com/en/contests/ptmnufrm6p6nl7gods1loo65go), just click "Joi...
Eolymp Cup #2, ![ ](https://eolympusercontent.com/images/ak1nas6ed565j4mo28t7od66q0?width=1920) EolympCup #2

Full text and comments »

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

48.
By SecondThread, history, 3 years ago, In English
Meta Hacker Cup 2023 Practice Round Meta Hacker Cup Practice Round ================== Good morning! The Meta Hacker Cup Practice Round starts in under 24 hours! If you haven't yet, now's a great time to [register for the round here](https://www.facebook.com/codingcompetitions/hacker-cup/2023/practice-round). This round will be 72 hours long, starting tomorrow, September 21st at 10AM Pacific. Though it's optional, we strongly recommend participating. If you've never competed before, you'll see that Hacker Cup has a slightly unconventional submission system (you run your own code locally, and upload the output), so it's good to practice that. Be sure you have a sufficiently large stack size, for example, if you plan to use recursion in any of your solutions, and that you're familiar with compiling your code if you don't usually do that in other contests. A couple other reminders before the contest starts: - We ask that you don't discuss the statements or solutions (ideas or code) until after the practice round...
Meta Hacker Cup 2023 Practice Round, better yet 2. Write your code to read from a file rather than stdin, or 3. Redirect stdin to a file, rather than stdin, or 3. Redirect stdin to a file when executing your code. You can also view

Full text and comments »

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

49.
By brunomont, 6 months ago, In English
Chinese Postman Problem: How I Ran a 180 km Ultramarathon Through Every Street in My City Hello, Codeforces! A couple of years ago, a friend of mine told me that two cyclists had passed through every single street in the center region of the city I live in (Belo Horizonte, southeastern Brazil), on the [third try](https://www.strava.com/activities/1030665876/overview). <spoiler summary="First try"> After ~160 km, they had not completed 1/3 of the goal. [Strava link](https://www.strava.com/activities/976021527). <img src="/predownloaded/8a/53/8a53829f7d78e88808a3ff751b64406ec2fc0efd.png" style="width: 600.0px;max-width: 100.0%;max-height: 100.0%;"> </spoiler> <spoiler summary="Second try"> They were better prepared, but one of the guys was run over by a car (no big injuries). [Strava link](https://www.strava.com/activities/999450285). <img src="/predownloaded/85/8f/858fdcdcfda93cd1d9c7c59db7dbfad9e63d6ea2.png" style="width: 600.0px;max-width: 100.0%;max-height: 100.0%;"> </spoiler> <center> <img src="/predownloaded/8d/5c/8d5cfb677a361654105e49f36f214c35...
. All of the code I used is in a very messy repo [3], if you want to check it out. Also, I made a

Full text and comments »

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

50.
By Egor, 13 years ago, In English
Preview: University of Tokyo Next team is Tokyo University team called “University of Agitsune”. Its name has an interesting history. The team members name themselves like 3 animals &mdash; rabbit (usagi in Japanese), eel (unagi) and fox (kitsune). If you combine a rabbit and a fox, you will get usagitsune. If you combine an eel and a fox, you will get unagitsune. Replacing by dash letters that differ, we can obtain u-agitsune. And as University of Tokyo is sometimes referred to as U-Tokyo, reversing the rule, we get the team name (credit for this explanation should go to ~qnighy,2013-06-26). Last year 2 of its members participated in OpenCup under name “Kroliki” (transliteration of Russian word for rabbits). This is not a coincidence, as Makoto Soejima learns Russian. They finished 7th in general classification with one second and one third places on stages. This team finished first in Tokyo Regional Contest, one problem ahead of second place, and third in Kaohsiung Regional Contest. They also finished firs...
admin), TopCoder Open 2010 and 2011 champion, Google Code Jam 2011 champion and 2010 and 2012, champion, Google Code Jam 2011 champion and 2010 and 2012 finalist, Facebook HackerCup 2011 and, ), финалист TopCoder Open 2011, финалист Google Code Jam за 2009, 2012 и 2013, финалист Facebook HackerCup, ., победитель чемпионата Google Code Jam 2011 и финалист 2010 и 2012 гг., финалист Facebook HackerCup

Full text and comments »

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

51.
By hehezhou, 3 years ago, In English
2024-The 6th Turing Cup Tournament **Turing Cup Tournament** The Turing Cup is an invitational competition that is organized by one of the most successful informatics competition teams in China, the XinYouDui and partner with X-Camp Academy. **Registration time:** April 19th &mdash; May 5th 8:00 AM(BJT)/ May 4th 5:00 PM PDT/ May 4th 8:00 PM EDT **Registration method:** Click [XinYouDui contest system](https://contest.xinyoudui.com/recommend) directly for registration. So register here while you can! (It is recommended to use Chrome, Firefox browser) **Registration requirements:** There are no age, level, or identity restrictions. These awesome problems and editorials are written, prepared, and tested by the XinYouDui from Hangzhou Xuejun High School. Quality is ensured by top-notch participants of IOI 2024 China National Team and NOI gold medalists. **Divisions:** Novice, Intermediate, Advanced - Novice group: The entry-level level of programming with basic language application and basic algorithms ...
2024-The 6th Turing Cup Tournament, **Turing Cup Tournament** The Turing Cup is an invitational competition that is organized by one

Full text and comments »

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

52.
By waipoli, history, 21 month(s) ago, In English
Eolymp Cup #4 ![ ](https://eolympusercontent.com/images/ak1nas6ed565j4mo28t7od66q0?width=1920) Eolymp Cup #4 ============= Get ready for the [final round of the Eolymp Cup](https://basecamp.eolymp.com/en/contests/ajbi7s2jld37fch2ulvjkvgi9g) happening on **Sunday, March 2**! Compete for a chance to **win free HSU scholarships, Eolymp subscriptions**, and our **exclusive T-Shirts**. Don’t miss out on the action—we’re excited to see you there! ### About **Eolymp Cup** is a programming competition for students. The competition consists of 4 rounds, held throughout the year. Each round features 6 problems, each designed to challenge participants' knowledge of algorithms, data structures and programming. The competition is open to everyone, but prizes will only be awarded to participants who are born after January 1, 2002. All other participants will compete unofficially. ### Format and Duration In each round, you are given 3 hours to solve 6 problems. Each problem is split into sub-t...
Eolymp Cup #4, ![ ](https://eolympusercontent.com/images/ak1nas6ed565j4mo28t7od66q0?width=1920) EolympCup #4

Full text and comments »

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

53.
By -is-this-fft-, history, 5 years ago, In English
[Tutorial] The command line: how to read input from file without #ifdef and much more #### Introduction Instead of algorithms and math, I'll be doing something completely different here. There is something that has bothered me for a long time: people not understanding the tools they use to participate in contests and thus failing to take real advantage of them. And it all goes back to not understanding the command line. Some of you might say, "well surely, the command line is something obsolete and you're only clinging to it because you [insert ridiculous amateur-psychology here]?" No! The command line is not obsolete, and unless competitive programming becomes so mainstream that software vendors start writing professional-grade tools aimed specifically at us, it won't be. [cut] $~$ What is the command line? Any of these: ![ ](/predownloaded/bd/b6/bdb6c157b9b3ce5ae046c9064e469e0081f8c0fe.png) As you can see, it comes in many background colors and fonts, but the basic idea is always the same. It's a box you can type commands in, which it will ...
. Lightweight modern code editors. Examples: Visual Studio Code, Sublime Text. 3 . Full-fledged IDEs

Full text and comments »

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

54.
By gKseni, 8 years ago, translation, In English
Открытие VK Cup 2018 Идет первый день VK Cup 2018! На открытии послушали вступительные слова организаторов. Участники заранее прислали забавные фотки и ответили на анкету с фактами о себе. На фотки мы приклеели стикеры с Персиком &mdash; символом и хранителем VK Cup в этом году, а самые интересные ответы рассказали, пока волонтеры выдавали участникам бейджи. Некоторые команды из топ-20 Раунда 3 отказались от участия в финале, чтобы сохранить попытку на следующих год. Мы пригласили следующих по рейтингу. Итого, финалисты этого года, встречайте! 1. Нижний Магазин SU: [user:V--o_o--V,2018-08-11] & [user:LHiC,2018-08-11] 2. ИТМО 2.0: [user:senek_k,2018-08-11] & [user:demon1999,2018-08-11] 3. 120 Minutes Adventure: [user:sinesight,2018-08-11] & [user:SpyCheese,2018-08-11] 4. Кекс столичный: [user:Melnik,2018-08-11] & [user:hloya_ygrt,2018-08-11] 5. Z: [user:egor_bb,2018-08-11] & [user:Nikitosh,2018-08-11] 6. Saint Veronika: [user:aytel,2018-08-11] & [user:Constantius,2018-08-11] 1. Road to the ...
The first day of VK Cup 2018, Открытие VK Cup 2018, The first day of every year championship for programming [VK Cup 2018](https://codeforces.com, Идет первый день VK Cup 2018! На открытии послушали вступительные слова организаторов. Участники

Full text and comments »

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

55.
By Zlobober, 12 years ago, In Russian
Финал Russian Code Cup Я сегодня получил такое письмо: > Уважаемые финалисты! > Спешим уведомить вас о нескольких изменения по проведению финала RCC 2014: > > - финал будет проведен в субботу 4 октября с 11:00 до 14:00 > > - формат проведения финала изменен с оффлайнового на онлайновый. Мы надеемся, что подобный шаг поможет снизить для всех вас дополнительный стресс, связанный с дорогой, и пройти финал в более комфортной для вас атмосфере > - как призовой фонд, так и количество призеров увеличены. Призовой фонд увеличен до $25000, и > по новым правилам призы получит не лучшая тройка, а лучшая десятка участников: за 1 место приз составит $10000, за 2 место &mdash; $5000, за 3 место &mdash; $3000, участники, занявшие 4, 5, 6, 7, 8, 9 и 10 места, получат по $1000. > - по месту проведения награждения призеров уведомим отдельно &mdash; выбираем между двумя вариантами > >Спасибо! > >Команда Russian Code Cup. Нет слов, чтобы описать моё разочарование. Ты, наконец-то, проходишь на онсайт ...
Финал Russian Code Cup, Russian Code Cup. Нет слов, чтобы описать моё разочарование. Ты, наконец-то, проходишь на онсайт, вариантами > >Спасибо! > >Команда Russian Code Cup.

Full text and comments »

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

56.
By Ilya_Is2022, 2 years ago, translation, In English
Community Code Cup 4 Hello, Codeforces! ================== I am pleased to invite you to participate in our new [Community Code Cup 4](https://cups.online/en/contests/contests_code_cup) round that will take place on the **All Cups** platform! The competition will take place [Friday, June 21, 2024, at 16:05]() and will be held according to the **ICPC** rules: - All solutions will be tested on a **full** set of tests; - **The penalty** for an incorrect attempt in this round will be $20$ minutes; - The rating table will be frozen in the **last hour**. **$7$** &mdash; **$12$** interesting tasks are expected for the participants of the competition. The duration of the round will be $4$ hours. The tasks have been prepared by: - Ilya Isaev [user:Ilya_Is2022,2024-01-02] - Stanislav Nekrasov [user:nekstas,2024-01-02] - Maksim Gorshunov [user:maksonchik20,2024-03-23] - Nikita Chigrin [user:Pozercpp,2024-06-10] - Vladislav Sidelnikov [user:vsidelnikov,2024-06-10] The illustrator of...
Community Code Cup 4, - **Top 3** competitors will receive branded **All Cups merch** and $6$ months of subscription **VK, - **Топ 3** участников соревнования получат фирменный мерч **All Cups** и $6$ месяцев подписки **VK

Full text and comments »

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

57.
By MikeMirzayanov, 8 years ago, translation, In English
Codeforces: Results of 2018 Hi Codeforces! February 2019 is already on the calendar, which means that I was late with the report for 2018. Better late than never! Let's remember last year. In 2018, [user:_kun_,2019-02-05], [user:300iq,2019-02-05] and [user:arsijo,2019-02-05] joined the team of coordinators. The work of the coordinators is headed (and is the coordinator of the coordinators) [user:KAN,2019-02-05]. I really hope that a more measured schedule of preparing rounds by a large team of coordinators will give a better insight into the contests. The main innovations in the platform are implemented by me and the developers [user:kuviman,2019-02-05], [user:fcspartakm,2019-02-05], [user:MaximShipko,2019-02-05]. Great work on the organization of events and prizes mailing was done by [user:gKseni,2019-02-05]. Special thanks to the writers of the problems and testers. It is your content that charges the community with life and unites all of us. Thank you for the problems! And now let's summarize...
held with their help, thank you! * **VK**, VK Cup — team competition for young Russian, проводится с их помощью, спасибо! * **VK**, VK Cup — командное соревнование для молодых

Full text and comments »

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

58.
By MIRZAPURI, history, 4 weeks ago, In English
Code Clash Hello Everyone, **IIITV Coding Club** is excited to invite you to participate in **Code Clash**, our annual Competitive Programming Contest held as part of **Cerebro 2026-27** &mdash; the annual technical fest of the **Indian Institute of Information Technology, Vadodara (IIITV)**. Ready to put your competitive programming skills to the test? Get your trio together and gear up for a national-level CP contest where every problem is a new challenge and every submission counts! ![Code Clash Poster](/predownloaded/6a/b0/6ab013b5ae6b8d8cf92774b78bfb5be11d388ea1.png) ### **Contest Details** - **Platform:** Codeforces (Online) - **Date & Time:** [time:2026-10-30 18:30] *(9:00 PM &mdash; 12:00 AM IST, 30th October 2026)* - **Duration:** 3 Hours - **Team Size:** 3 members (Team Event &mdash; you must form a team from the [Codeforces Teams tab] **UPDATE: The team size can be either 2 or 3 now!** (https://codeforces.me/teams) to register) - **Scoring System:** ICPC Style - ...
Code Clash, 1. 3 guys 1 cup ([user:Garvit_K,2026-11-14], [user:Chirag352,2026-11-14], [user:SankVid26,2026-11, :** ### **Winners:** 1. 3 guys 1 cup ([user:Garvit_K,2026-11-14], [user:Chirag352,2026-11-14

Full text and comments »

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

59.
By MidnightCodeCup, 5 months ago, In English
Midnight Code Cup Finals **UPD** Congratulation to our winners! 1. taxi with 14304.84 points! [user:jacobtpl,2026-07-07], [user:frodakcin,2026-07-07], [user:thomas0115,2026-07-07] 2. superfight: 12062.47 [user:-XraY-,2026-07-07], [user:Maksim1744,2026-07-07], [user:scanhex,2026-07-07] 3. itmo_1.2017: 11970.62 [user:izban,2026-07-07], [user:Belonogov,2026-07-07], [user:enot110,2026-07-07] <img src="/predownloaded/12/f2/12f2dee14f50c5043f4e461a3c4e3ad8a31f13c8.jpg" align="left" style="width: 100%;" alt="Omogen Heap"/> <img src="/predownloaded/1f/8a/1f8a39ef2fafcc9788f490f40a934a0808bb097e.jpg" align="left" style="width: 50%;" alt="GoodBye2023"/><img src="/predownloaded/a5/f9/a5f9c0729b72fbc53c60bdb518bd2ac38331be47.jpg" align="left" style="width: 50%;" alt="Jinotega"/> The Midnight Code Cup final round is happening this weekend, 4-5 of July in Belgrade, Serbia. Over 500 teams from all over the world [competed for the spot on the finals](https://codeforces.me/blog/entry/152874). Top 25 + wi...
Midnight Code Cup Finals, /a5f9c0729b72fbc53c60bdb518bd2ac38331be47.jpg" align="left" style="width: 50%;" alt="Jinotega"/> The MidnightCode Cup final, ], [user:scanhex,2026-07-07] 3. itmo_1.2017: 11970.62 [user:izban,2026-07-07], [user:Belonogov,2026-07

Full text and comments »

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

60.
By SecondThread, history, 2 years ago, In English
Meta Hacker Cup Round 2 Meta Hacker Cup Round 2 ================== It's <strike>Rabbit</strike> Hacker Cup Season! Round 2 begins in under 24 hours on the [Hacker Cup site](https://www.facebook.com/codingcompetitions/hacker-cup/2024/round-2). We hope to see you there after Round 979! As in previous years: - To qualify for the human track of Round 2, you must have finished within the top 5000 of Round 1. - For those competing in the human track, the **top 2000** placing participants will win a **limited edition Hacker Cup shirt**. We'll distribute shirts and share more information about this after Round 3. - The **top 500** placing human-track participants will advance to Round 3. As always, we recommend taking care to make sure your code is correct before making submissions, and making sure you are familiar with how to run code on large files without trying to paste megabytes of data by hand. I'd highly recommend reading [user:-is-this-fft-,2024-10-19]'s [blog post](https://codeforces.me/blog...
Meta Hacker Cup Round 2, edition Hacker Cup shirt**. We'll distribute shirts and share more information about this after Round3

Full text and comments »

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

61.
By Errichto, 11 years ago, In English
Codeforces Round #318 [RussianCodeCup Thanks-Round] Hello Codeforces community! Codeforces Round #318 (for both divisions) will take place on [August, 29 at 19:30 MSK](http://www.timeanddate.com/worldclock/fixedtime.html?day=29&month=8&year=2015&hour=19&min=30&sec=0&p1=166). It is the Thanks-Round devoted to Russian Code Cup. You will be given 5 problems and 2 hours to solve them. Scoring will be announced close to the round. I strongly recommend you to read all problems. ![ ](http://codeforces.me/predownloaded/97/f0/97f0ed2e07a03e20ded192532c533b620734da64.jpg) <a href="http://www.russiancodecup.ru/">RussianCodeCup</a> is the largest open programming competiton for Russian-speaking participants by Mail.Ru Group. Its history started in 2011. And since the first championship RCC offers great problems and generous prizes. This year finals will be held on September, 19th. Wish good luck to all the finalists! Thank you, RussianCodeCup, for your gift on the 5th anniversary of Codeforces! I am honoured to be a problem setter ...
&hour=19&min=30&sec=0&p1=166). It is the Thanks-Round devoted to Russian Code Cup. You will be given

Full text and comments »

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

62.
By CutieSmileHaruka, 7 months ago, In English
Spectral::Cup 2026 Round 1 (Codeforces Round 1094, Div. 1 + Div. 2) Hello, Codeforces! We are glad to invite you to take part in [contest:2222], which will start on [contest_time:2222]. You will be given **8 problems** and **2.5 hours** to solve them. This round will be combined for Division 1 and Division 2 and will be rated for everyone. <b>At least one problem will be interactive</b>, so please make sure to read the <a href="https://codeforces.me/blog/entry/45307">guide for interactive problems</a> before the contest. All problems are authored by [user:lizhous,2026-04-22], [user:Lyz09,2026-04-22], [user:ma2021tyoi0037,2026-04-22], [user:hzy_____,2026-04-22] and me. We would like to thank the following people for making this round possible: - [user:Um_nik,2026-04-22] for pre-reviewing the round. - [user:Error_Yuan,2026-04-22] for the coordination and helping with preparation. - [user:Alexdat2000,2026-04-22] for Russian translation. - [user:Rebex,2026-04-22] for providing some rejected problems and preparing some problems. - [user:_D...
Spectral::Cup 2026 Round 1 (Codeforces Round 1094, Div. 1 + Div. 2), ,2026-04-26] 2. [user:jiangbowen,2026-04-26] 3. [user:XVIII,2026-04-26] 4. [user:maroonrk,2026-04-26

Full text and comments »

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

63.
By Fremder, 3 years ago, In English
[Invitation, Prizes!] CodeRed and Humblefool Cup 2024 by IIIT Allahabad Hello Codeforces! After the great success of [Alkhwarizm 2024](https://www.codechef.com/START122), we are excited to invite you all to the following two flagship coding events of **Aparoksha** — the annual tech-fest of IIIT Allahabad. - CodeRed - Humblefool Cup Participation is open to all, but the prizes are only for Indian university/school students. We encourage everyone to participate in these contests. All of these contests are **unrated** and will be held as **CodeForces gym** contest. <img src="/predownloaded/5a/1e/5a1ea2614ccd6783e6fb2189f29479dee7939232.png" style="float: right;margin: 0 1.0% 5.0%;width: 48.0%;height: 48.0%;max-width: 60.0%;max-height: 60.0%;"> <img src="/predownloaded/cf/ba/cfbad826e78ebd0b3251ef43907ee7811e21ef4d.png" style="float: left;margin: 0 1.0% 5.0%;width: 48.0%;height: 48.0%;max-width: 60.0%;max-height: 60.0%;"> ____________________________________________________________________________________________________________________ ...
[Invitation, Prizes!] CodeRed and Humblefool Cup 2024 by IIIT Allahabad, to 3 in two rounds — Online Qualifiers and Onsite Finals., ** — the annual tech-fest of IIIT Allahabad. - CodeRed - Humblefool Cup Participation is open to

Full text and comments »

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

64.
By SecondThread, history, 4 years ago, In English
Meta Hacker Cup Round 1 Meta Hacker Cup Round 1 ======================= Good morning! [Meta Hacker Cup Round 1](https://www.facebook.com/codingcompetitions/hacker-cup/2022/round-1) starts on [Saturday, September 10th](https://www.timeanddate.com/countdown/generic?iso=20220910T10&p0=234&msg=Hacker+Cup+Round+1&font=sanserif) in under 48 hours! You're automatically registered for Round 1 if you solved at least 1 problem in the qualification round. ### Important info: - You'll qualify for Round 2 if you **score at least 15 points** in this round. - You won't know whether your submissions are correct or not until after the contest, so it may be wise to solve more problems than you need in case some of your submissions end up being incorrect. Just like in the qualification round, you'll be given validation data, but there may still be cases not in validation data which could trip you up. - The round will last 24 hours, and you may use as much of that as you would like solving problems. As usual, **you m...
Meta Hacker Cup Round 1

Full text and comments »

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

65.
By andrewzta, history, 10 years ago, translation, In English
Russian Code Cup — Eliminataion Round, Some News Hi all! During Elimination Round of Russian Code Cup 2017 we had a technical issue that caused almost all problem A solutions sent for evaluation from 5-th to 10-th minute of the contest be accepted. We found that issue when it was already too late, so it wouldn't be fair to rejudge the solutions. However, we understand that this issue created unfair circumstances for other contestants, that could lose to those lucky ones that submitted in the described time frame. We have rejudged all solutions after the round, and tried to simulate how could the contest proceed should they have been judged correctly. Of course, any simulation of this kind cannot be accurate, and there is no completely fair resolution. We have decided to do the following: 1) Increase the number of Final Round participants to 55. It gives partial compensation to those participants who could have qualified but failed to do so because of someone's incorrectly small penalty. 2) Increase number of t-shirts t...
Russian Code Cup — Eliminataion Round, Some News, Russian Code Cup — Изменение в подведении итогов отборочного раунда, чемпионата. Жюри и техническая группа Russian Code Cup приносят всем извинения за накладку. Мы, 2) Increase number of t-shirts to 205. So all participants who have at least 3 accepted problems, 2) Увеличить число получателей футболок до 205. Таким образом все, сдавшие хотя бы3 задачи, Hi all! During Elimination Round of Russian Code Cup 2017 we had a technical issue that caused

Full text and comments »

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

66.
By Ra16bit, history, 17 months ago, In English
Midnight Code Cup and historic Challenge24 results at the Competitive Programming Hall of Fame **Midnight Code Cup** onsite finals happened last weekend in Belgrade, Serbia. The results are now available at the Competitive Programming Hall of Fame: [https://cphof.org/standings/mcc/2025](https://cphof.org/standings/mcc/2025). This year the travel expenses were covered only for top-3 and student teams, so I classified it as a Collegiate Onsite. Nevertheless, many of the participants were not actually students, but came to Belgrade on their own. And I'm glad to tell that it was a really excellent and well-prepared event. Thanks a lot to the organizers! I hope Midnight Code Cup will become a regular annual competition. Additionally, there is a small surprise that might evoke nostalgia for some in our community. I think Midnight Code Cup was inspired by the older competition called **Challenge24**, so I decided to publish its historic results: [https://cphof.org/contest/ch24](https://cphof.org/contest/ch24). Unfortunately, team members are not available for most of the years...
Midnight Code Cup and historic Challenge24 results at the Competitive Programming Hall of Fame, **Midnight Code Cup** onsite finals happened last weekend in Belgrade, Serbia. The results are now, . Thanks a lot to the organizers! I hope Midnight Code Cup will become a regular annual competition.

Full text and comments »

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

67.
By -firefly-, history, 15 months ago, In English
Codeforces Round 1042 (Div. 3) Editorial I hope you all enjoyed the contest! <spoiler summary="Rating Predictions"> | Predictor | A | B | C | D | E | F | G | H | |------------------------------------|--------|--------|--------|--------|--------|--------|--------|--------| | [user:AksLolCoding,2025-08-10] | 800 | 900 | 1000 | 1400 | 1500 | 1800 | 1800 | &mdash; | | [user:ALnQ417,2025-08-10] | 800 | 900 | 1100 | 1300 | 1500 | 1600 | &mdash; | &mdash; | | [user:bookcat,2025-08-10] | 800 | 1200 | 1200 | 1500 | 1600 | 1600 | 1600 | 2000 | | [user:chromate00,2025-08-10] | 800 | 800 | 1000 | 1400 | 1400 | 1800 | 1800 | 2200 | | [user:cry,2025-08-10] | 800 | 1000 | 1200 | 1600 | 1700 | 2100 | 2100 | 2400 | | [user:Edeeva,2025-08-10] | 800 | 800 | 1000 | 1300 | 1400 | 1600 | 1900 | &mdash; | |...
Codeforces Round 1042 (Div. 3) Editorial, \cup S_k|$ for each $i$ in $O(2^{|P_i|})$ time. Because $2 \times 3 \times 5 \times 7 \times 11

Full text and comments »

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

68.
By Zlobober, 11 years ago, translation, In English
VK Cup 2015: online mirror and final thanks **The registrations before 00:00 have been deleted, because the form didn't support teams. Please, register again if your registration has been affected.** VK Cup 2015 Final Round has ended two days ago. It's very likely that you've seen our previous posts. The last event to happen is online mirror of the final round. It will be held on [Thursday, July 30th, at 19:00 Moscow time](http://www.timeanddate.com/worldclock/fixedtime.html?day=30&month=7&year=2015&hour=19&min=0&sec=0&p1=166). Individual contestants as well as teams consisting of two people may participate in this round. Round duration is three hours, problems will be shuffled in comparison with to the original order. Both division participants may take part, but we want to warn 2nd division contestants that problemset may be hard for them. This round is a rated Codeforces round. Finally, we want to thank all people that made this Championship. Following VK developers, Codeforces team members and the other people suggeste...
VK Cup 2015: online mirror and final thanks, , register again if your registration has been affected.** VK Cup 2015 Final Round has ended two

Full text and comments »

Announcement of VK Cup 2015 - Finals
  • Vote: I like it
  • +195
  • Vote: I do not like it

69.
By sammyuri, 6 months ago, In English
Spectral::Cup 2026 Round 2 (Codeforces Round 1100, Div. 1 + Div. 2) Editorial Thank you for participating in our round! We hope you enjoyed the problems as much as we enjoyed preparing them. <spoiler summary="Rate the contest!"> <spoiler summary="Quality"> - Absolute Cinema contest - Excellent contest - Good contest - Average contest - Bad contest - Horrible contest </spoiler> <spoiler summary="Difficulty"> - Trivial contest - Easy contest - Average contest - Hard contest - Impossible contest </spoiler> </spoiler> [problem:2229A] Idea by: [user:Intellegent,2026-05-23] Prepared by: [user:Intellegent,2026-05-23] Editorial by: [user:reirugan,2026-05-23] <spoiler summary="Hint 1"> Let $y$ denote the final position of all of the slimes. Then it is optimal to choose $x = y$ for every operation. </spoiler> <spoiler summary="Hint 2"> Let $\mathrm{mn}$ denote the minimum value in $a$, a...
Spectral::Cup 2026 Round 2 (Codeforces Round 1100, Div. 1 + Div. 2) Editorial, > ~~~~ #include using namespace std; typedef long long ll

Full text and comments »

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

70.
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...
/problem/H (3) //Make as least odd as possible http://code -festival-2017-qualc.contest.atcoder.jp

Full text and comments »

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

71.
By KAN, 9 years ago, translation, In English
VK Cup 2018 — Wild-card Round 1 Hi! Tomorrow, on [March 17th, 2018, at 15:35 UTC](https://www.timeanddate.com/worldclock/fixedtime.html?msg=VK+Cup+Wild-card+Round+1&iso=20180317T1835&p1=166&ah=2) the first Wild-card Round of VK Cup 2018 will be held. Along with it we will host a parallel unofficial round in which everyone can take part. The rounds will use **special rules, the rounds will be unrated.** The problems were prepared by Codeforces team: [user:fcspartakm,2018-03-16], [user:MikeMirzayanov,2018-03-16] and me. Thanks to [user:Vovuh,2018-03-16], [user:GreenGrape,2018-03-16], [user:neckbosov,2018-03-16], [user:glebodin,2018-03-16] and [user:gritukan,2018-03-16] for testing the round and their help to make the round better! The detailed rules will be added to this post around 30 minutes before the start. There will be 24-hours open hacks phase after the round, like in Codeforces Educational Rounds. **Round rules:** The round will be almost usual contest with ACM ICPC rules. There will be 10 proble...
VK Cup 2018 — Wild-card Round 1, /fixedtime.html?msg=VK+Cup+Wild-card+Round+1&iso=20180317T1835&p1=166&ah=2) the first Wild-card Round of VK

Full text and comments »

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

72.
By Errichto, 11 years ago, In English
VK Cup 2016 Round 1 — Editorial Codes in nicer format will be uploaded later. [problem:658A] and [problem:639A] &mdash; [codes](http://ideone.com/NYuwV8). [problem:639B] and [problem:639C] &mdash; [codes](http://ideone.com/GcUNZJ). [problem:639D] &mdash; [codes](http://ideone.com/FkE3DU). [problem:639E] &mdash; [codes](http://ideone.com/OoSLF3). [problem:639F] &mdash; [codes](http://ideone.com/PUSLI2). [problem:658A] &mdash; Iterate once from left to right to calculate one player's score and then iterate from right to left. It's generally good not to write something similar twice because you are more likely to make mistakes. Or maybe later you will find some bug and correct it only in one place. So, try to write calculating score in a function and run them twice. Maybe you will need to reverse the given arrays in some moment. [problem:639A] &mdash; You should remember all friends displayed currently (in set or list) and when you add someone new you must check whether there are at most $k$ people ...
VK Cup 2016 Round 1 — Editorial, :639B] — You may want to write some special `if` for $n = 2$. Let's assume $n \ge3$. If $d

Full text and comments »

Tutorial of VK Cup 2016 - Round 1
  • Vote: I like it
  • +104
  • Vote: I do not like it

73.
By CodemastersIntl, 3 years ago, In Russian
Турнир по программированию среди студентов Codemasters Code Cup 2023 Привет, Codeforces! Приглашаем принять участие в [Codemasters Code Cup 2023](https://www.codecup.online/) &mdash; Турнире по программированию среди студентов. Соревнования включают в себя отборочный раунд, который будет проходить онлайн, а также финал и награждение, которые состоятся в Туле. ![ ](/predownloaded/f1/0b/f10b7a37cf77c81552a6c3afe51641683ffa79eb.png) [Codemasters Code Cup](https://www.codecup.online/) &mdash; турнир, который проводит компания Codemasters International уже четвертый год подряд. Первые три соревнования проводились исключительно в Саранске и Туле, в этом году мы приглашаем к участию студентов со всей России. Соревнование будет организовано в партнерстве с Тульским государственным университетом и Центром олимпиадной подготовки по программированию МГУ им. Н.П. Огарёва. В турнире Сodemasters Code Cup могут принять [участие](https://www.codecup.online/#registration) **студенты и аспиранты очной формы обучения российских учебных заведений в возрасте от 17...
Турнир по программированию среди студентов Codemasters Code Cup 2023, сертификаты участника Codemasters Code Cup. 1. Все финалисты получат сертификаты финалиста, Привет, Codeforces! Приглашаем принять участие в [Codemasters Code Cup 2023](https

Full text and comments »

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

74.
By Ilya_Is2022, 3 years ago, translation, In English
Community Code Cup 1 Hello, Codeforces! ================== Me, [user:Alexfil,2024-01-02] and [user:nekstas,2023-12-25] are pleased to invite you to our new official [Community Code Cup 1](https://cups.online/en/contests/contests_code_cup ) round that will take place on the new platform **IT** championships **All Cups**! The competition will take place [Monday, January 8, 2024, at 17:05]() and will be held in accordance with the slightly modified Codeforces rules: - All solutions are tested on a full package of tests. - All decisions that do not receive a "Complete solution" verdict are penalized with 50 points. - No hacking system. **$2^3$** interesting tasks were prepared for the participants of the competition. The duration of the competition will be $3$ hours ($180$ minutes). **The final distribution**: - **$250$** &mdash; **$750$** &mdash; **$1250$** &mdash; **$1750$** &mdash; **$2250$** &mdash; **$3250$** &mdash; **$3250$** &mdash; **$3250$** The tasks have been prepared by: - ...
Community Code Cup 1, **$2^3$** interesting tasks were prepared for the participants of the competition. The duration of, **UPD 3**: TOP $10$ -> https://cups.online/ru/rounds/997/leaderboard, -25] are pleased to invite you to our new official [Community Code Cup 1](https://cups.online/en, 1. Gennady Korotkevich (tourist) 2. AllCupsIsTrash (AllCupsIsTrash) 3. Yury Pisarchyk (Ra16bit, 1. Геннадий Короткевич (tourist) 2. AllCupsIsTrash (AllCupsIsTrash) 3. Yury Pisarchyk (Ra16bit, ] рады пригласить Вас на наш новый официальный (наконец-то!) [Community Code Cup 1](https, Для участников соревнования было подготовлено **$2^3$** интересных задач. Длительность раунда

Full text and comments »

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

75.
By Nickolas, 11 years ago, translation, In English
VK Cup 2016 Wild Card Round 1 The contest is over; the editorial is available [here](http://codeforces.me/blog/entry/44292). --- The language of this round is [J](http://jsoftware.com/). The traditional A+B program (A and B are written in one line and separated with space) looks as follows: ~~~ print =: 1!:2&2 read =: 1!:1[3 in =. (read-.LF)-.CR print +/ ". in exit '' ~~~ The main source of information about the language is http://code.jsoftware.com/wiki/Main_Page. Version used is J804. [cut] Several notes: * to test your solutions locally, use jsonsole solution.ijs < input.txt. It's also possible to use jsonsole solution.ijs, in this case after entering test press Ctrl+z+Enter. * you can run your code on Codeforces platform, using Custom Test tab. * the language is not compiled, if your code has syntax error, you'll get verdict "Wrong answer on test 1". * note that Codeforces uses Windows-style line endings, #13#10. You can download language from http://www.jsoftware.com/down...
VK Cup 2016 Wild Card Round 1, read =: 1!:1[3 in =. (read-.LF)-.CR print +/ ". in exit '' ~~~ The main source of

Full text and comments »

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

76.
By Ilya_Is2022, 3 years ago, translation, In English
Community Code Cup 2 Hello, Codeforces! ================== Me and [user:nekstas,2023-12-25] are pleased to invite you to our new [Community Code Cup 2](https://cups.online/en/contests/contests_code_cup) round that will take place on the **All Cups**! The competition will take place [Wednesday, February 14, 2024, at 17:35]() and will be held in accordance with the slightly modified Codeforces rules: - All solutions are tested on a full package of tests. - All decisions that do not receive a "Complete solution" verdict are penalized with 50 points. - No hacking system. **$5$** interesting tasks were prepared for the participants of the competition. The duration of the competition will be $2$ hours and $15$ minutes. **Distribution**: **500** &mdash; **1000** &mdash; **(750+750)** &mdash; **2000** &mdash; **4000** With the support of the service from **VK** « _Другое Дело_ » Small prizes were provided for the participants of the competition: - **The absolute champion** of the competitio...
Community Code Cup 2, 2** соревнования получит **1500** баллов в сервисе « _Другое Дело_ » - **Топ 3 ** соревнования, you to our new [Community Code Cup 2](https://cups.online/en/contests/contests_code_cup) round that, » - **Top 3** competitions will receive **1000** points in the service « _Другое Дело_ » - **Top 4-10, пригласить Вас на наш [Community Code Cup 2](https://cups.online/ru/contests/contests_code_cup) раунд, **UPD 3**: Thank you all for participating! ![ ](/predownloaded/31/58, **UPD 3**: Спасибо всем за участие! ![ ](/predownloaded/30/89

Full text and comments »

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

77.
By RussianCodeCup, 12 years ago, In Russian
Russian Code Cup 2015 Всем привет! Идет регистрация на крупнейшую в России открытую ежегодную олимпиаду по спортивному программированию Russian Code Cup 2015. Первый квалификационный тур состоится уже в субботу, 28 марта, в 18-00 и продлится 2 часа. Russian Code Cup – это возможность для русскоязычных программистов со всего мира проверить свои силы и продемонстрировать мастерство, решая оригинальные задачи различной сложности, а также заявить о себе экспертному IT-сообществу. Олимпиада проходит в три этапа: квалификационные раунды, отборочный тур и финал, на каждом из которых участникам олимпиады предлагается от четырех до восьми разноплановых задач. Задания и техническую часть соревнования обеспечивают специалисты Mail.Ru Group и эксперты Университета ИТМО – соорганизатора Russian Code Cup. Квалификационные и отборочный раунды пройдут на сайте Russian Code Cup. Первый квалификационный раунд состоится [28 марта в 18:00](http://www.timeanddate.com/worldclock/fixedtime.html?day=28&month=3&year=2015&...
Russian Code Cup 2015, Квалификационные и отборочный раунды пройдут на сайте Russian Code Cup. Первый квалификационный

Full text and comments »

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

78.
By tibinyte2006, 4 years ago, In English
CodeTON Round 3 (Div. 1 + Div. 2) Editorial [A — Indirect Sort](https://codeforces.me/contest/1750/problem/A) ===== Authors: [user:mejiamejia,2022-10-31], [user:Ecrade_,2022-11-06] <spoiler summary="Solution"> We claim that we can sort the array if and only if $a_1 = 1$. **Necessity** We can notice that index $1$ cannot be affected by any swap operation. Let's see what happens to the value $1$. According to the definition of the operation, it can either increase or be swapped. In order to be increased, there must exist some $k$ such that $1 > a_k$, but since $1$ is the minimum possible value, it will never be true as other values in array $a$ can only increse as well. Since index $1$ can not be affected by a swap operation and $a_1>1$, we conclude that if $a_1 \neq 1$, the answer is **No**. **Sufficiency** Let's focus on the second operation. Since we have $a_1 = 1$, we can always choose $i=1$ and the operation then turns into picking some pair $2 \le j < k \le n$ and swapping $a_j$ with $a_k$. It's t...
CodeTON Round 3 (Div. 1 + Div. 2) Editorial, trivial to see we can always sort with such an operation.

Full text and comments »

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

79.
By Egor, 13 years ago, In English
Знакомство: Санкт-Петербургский ГУ Давайте познакомимся немного поближе с командой SPbSU 4 . В таком составе команда выступает уже второй сезон. В прошлом году Егор Суворов ещё учился в школе, то есть в ACM-ICPC участие команда не принимала. Это единственная команда-финалистка, обогнавшая NRU ITMO в командном соревновании этого года – они победили на украинском этапе Открытого Кубка. Последний сезон Кубка они завершили на третьем месте, а вот два предыдущих сезона завершили на 9-ом и 2-ом местах (на 3 балла опередив NRU ITMO). За этот сезон ребята одержали победу на 3 этапах и занимали второе и третье места. На последнем NEERC команда заняла 4-ое место (решив 4 задачи за последний час), несмотря на то, что за минуту до конца ребята были на втором месте. ![ ](https://lh3.googleusercontent.com/DhWPkDyKpnuT5XBmVeZJNkm8OAarAs0I5SMOdbxXfM5e5-MtLuGZFmbRuPKcN_7zcw1sKcgPN2V4rueZ9nFQZh_1UhVJZuv1h4vwXCexoZ5lUfXCGpCK3ZbFyA) Список личных достижений также великолепен: - **Егор Суворов** — рейтинг Codeforces [2607](/pro...
previous 2 seasons they finished 9th and 2nd (3 points ahead of NRU ITMO). During this seasons they, третьем месте, а вот два предыдущих сезона завершили на 9-ом и 2-ом местах (на 3 балла опередив NRU ITMO

Full text and comments »

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

80.
By Aksenov239, 12 years ago, In Russian
Russian Code Cup 2014 Final — Разбор задач **UPD:**Также специально для финала мы выпустили [видео-разбор](http://www.youtube.com/playlist?list=PLyQCF5K78w9_QRbUZHLsEeEe9RhJLu6ib). <div> <h2>Задача A. Игра</h2> <b>Идея:</b> Анна Малова<br> <b>Реализация:</b> Анна Малова<br> <b>Разбор:</b> Анна Малова<br> <p> Рассмотрим двудольный граф &mdash; первая команда, вторая команда. На ребре написано, какими подсказками владеет участник второй команды, которые еще не знает участник первой, то есть разность множеств подсказок участников. Оставим только те ребра, на которых записано одно число. Среди таких ребер оставим только те, на которых записано только одно число. </p> <p> Используя построенный граф, составим другой двудольный граф: вершинами первой доли являются участники первой команды, вершины второй доли &mdash; те подсказки, которые еще неизвестны первой команде. Между двумя вершинами есть ребро, если было ребро в предыдущем двудольном графе, выходящее из той же вершины, ...
Russian Code Cup 2014 Final — Разбор задач, длина правой части. Итого, для фиксированого числа l ответ будет равен ((l - 3, . Продолжая таким способом, мы получим итоговый ответ (2k - 1) · (2k - 3, ; (2k - 3) · ... · 3 · 1, что равно (2k - 1)!!.

Full text and comments »

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

81.
By AVdovin, 2 years ago, translation, In English
Community Code Cup 5 Announcement Hello, Codeforces! ================== I am pleased to invite you to participate in our new [Community Code Cup 5](https://cups.online/en/contests/contests_code_cup) round that will take place on the **All Cups** platform! The competition will take place [Friday, August 29, 2024, at 16:05 (UTC+3)]() and will be held according to the **ICPC** rules: - All solutions will be tested on a **full** set of tests; - **The penalty** for an incorrect attempt in this round will be $20$ minutes; - The rating table will be frozen in the **last hour**. **$6$** &mdash; **$9$** interesting tasks are expected for the participants of the competition. The duration of the round will be $4$ hours. The tasks have been prepared by: - Stanislav Nekrasov [user:nekstas,2024-01-02] - Maksim Gorshunov [user:maksonchik20,2024-03-23] - Anton Vdovin [user:AVdovin,2024-08-20] - Alexey Filippov [user:Alexfil,2024-08-21] Translators: - Roman Isaev [user:CUMberland,2024-01-04] - Jul...
Community Code Cup 5 Announcement, Анонс Community Code Cup 5, [Community Code Cup 5](https://cups.online/en/contests/contests_code_cup) round that will take place on, раунде [Community Code Cup 5] (https://cups.online/ru/contests/contests_code_cup), который пройдет на, I am pleased to invite you to participate in our new [Community Code Cup 5](https://cups.online/en, Я рад пригласить Вас принять участие в нашем новом раунде [Community Code Cup 5] (https

Full text and comments »

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

82.
By Egor, 13 years ago, In English
Preview: SPb NRU ITMO So, what is the last team I want to preview. Do you have any guesses? So many variants... Well, you must have guessed it right &mdash; it is SPb NRU ITMO 1. Let’s start with small facts about each of team members: - Mikhail won several trips to the next TCO through various side competitions (like photo competition) during TCO 2011 - Niyaz tweeted in April: “Playing dice with Gennady. This is the only game in which he can possibly lose” Well, I cheated &mdash; one fact for two teammates :) So, 2 of its participants are world champions already. And the third one will probably be. Why everyone thinks they will be champions again. Only once this team was behind another World Finals team in 2013. They won 13th OpenCup with overwhelming advantage (150 points ahead of second place, just 20 points shy of perfect score), although team finished third in previous edition. 7 wins and 4 second places on stages, OpenCup onsite win, NEERC championship &mdash; and that’s all in just 10 ...
months. Well, during last OpenCup they ousted a team that featured 2 TCO, 2 GCJ, 2 HackerCup and 3

Full text and comments »

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

83.
By nisritha35, history, 3 years ago, In English
Invitation to Turing Cup 2K24 — organized by Turing Hut, VNRVJIET (Prizes worth Rs 75,000) ![ ](https://d8it4huxumps7.cloudfront.net/uploads/images/opportunity/banner/65ccf5005ed53_turing-cup-2k24.png?d=1920x557) Greetings, codeforces community! We, Team Turing Hut, The coding club of VNRVJIET, Hyderabad present our flagship event &mdash; **Turing Cup 2K24** with a whopping **prize pool of Rs. 75,000**. This contest is open for all undergraduate students to participate! This competition will be held in **3 Rounds** **Round** **1** : [Saturday, March 9th, 2024 at 18:00 IST](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Turing+Cup+2K24+-+Round+1&iso=20240309T18&p1=505&ah=2). This round will last for **2 hours** and will be held on **Hackerrank (Online)**. Shortlisted teams for round 2 will be notified via e-mail. **Round** **2** **&** **3** : These rounds will be conducted on VNR VJIET Campus on **Thursday, March 28th, 2024**. Accommodation will be provided for teams based outside Telangana state. Shortlisted teams for round 3 will be notified on spot. ...
Invitation to Turing Cup 2K24 — organized by Turing Hut, VNRVJIET (Prizes worth Rs 75,000), -cup-2k24.png?d=1920x557) Greetings, codeforces community! We, Team Turing Hut, The coding club of

Full text and comments »

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

84.
By PersistentLife, history, 3 months ago, In English
As an CNOI Gold Medalist: How I Train CNOI Gold Medal Winning Competitive Programmers UPD: [Curated Problem Set #1](Thhttps://codeforces.me/blog/entry/156427) is released. Please join our Discord server to receive the latest updates: https://discord.gg/DsHSfmVgG UPD: Curated problem set #1 (both normal and advanced) **for subscribers** is ready! Feel free to join our Discord server and subscribe! This post is about: 1. The Main Two Abilities You Need in Competitive Programming 2. How to Choose Problems of an Appropriate Difficulty 3. How Should You Work on a Problem 4. When You Should Learn New Knowledge (Like New Algorithms) 5. How to Train Before an Important Contest 6. Free Content, Personalized Subscription Services, and Potential Opportunity for One-to-One Coaching 7. Survey About the Services I won a gold medal at NOI 2024 in my second year of high school and was admitted to the Turing Class at Peking University. After securing my admission, I continued pursuing competitive programming: I began studying new material at university in advance whi...
false sense of achievement, while your time is still wasted. 3. You memorize the editorial andcode

Full text and comments »

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

85.
By mridul1809, history, 8 years ago, In English
Invitation to Topcoder Humblefool Cup 2019 Hi everyone !!! <p>We at Indian Institute of Information Technology, Allahabad proudly share with you today <strong>The Humblefool Cup</strong>, the annual coding event of our Techfest <strong>Aparoksha’19</strong>, in memory of <strong>Harsha Suryanarayana <a href="https://www.topcoder.com/members/humblefool/" style="color: red;">(humblefool)</a></strong>. It is being hosted and sponsored by none other than <strong>TopCoder</strong>, with the prizes worth 550 USD. </p> <p> <img src="/predownloaded/33/82/338292161e933c903e22e0a5731430f52aa1acdc.jpg"></img> </p> <p> Humblefool was one of the first Indian red coders on Topcoder. He had been a member of Topcoder since 2005, and he was a proud graduate of Indian Institute of Information Technology, Allahabad. He was a fantastic competitor, participating in challenges across multiple tracks. More than that, he was a great community member and gave back to the community in countless ways. humblefool personally trained and moti...
Invitation to Topcoder Humblefool Cup 2019, with you today The Humblefool Cup, the annual coding event of our Techfest

Full text and comments »

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

86.
By Ecrade_, 20 months ago, In English
Codeforces Round 1010 (Div. 1, Div. 2, based on Zhili Cup 2025) Editorial Sorry for the late editorial. Our problem setters were so exhausted with the offline competition yesterday that they really need some good rest. Despite the unexpected and unpleasant incidents that occurred, we are truly surprised and grateful that so many of you still participated in this competition! We sincerely hope you enjoyed it! (Gratitude for all you guys from [user:Ecrade_,2025-03-16]: I felt so heartbroken when I heard about the unexpected issues, but seeing so many people in the comments comforting us, sharing thoughtful and positive messages that showed genuine empathy, and continuing to fully support our competition even after the wasted time, I was deeply moved. Thank you all! Codeforces truly embodies such a positive and uplifting community spirit!) [problem:2082A] <br> Idea: [user:Ecrade_,2025-03-16] <spoiler summary="Hint"> Do we really have to consider the problem on the whole matrix? </spoiler> <spoiler summary="Solution"> Let $r$ be the num...
Codeforces Round 1010 (Div. 1, Div. 2, based on Zhili Cup 2025) Editorial, > ~~~~~ #include using namespace std; typedef long long

Full text and comments »

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

87.
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...
[this Meta Hacker Cup problem](https://www.facebook.com/codingcompetitions/hacker-cup/2024/round-3

Full text and comments »

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

88.
By r3gz3n, history, 10 years ago, In English
Invitation to HackerEarth Collegiate Cup Hi everyone, Are you preparing for ACM International Collegiate Programming Contest (ICPC) ? ![ ](http://codeforces.me/predownloaded/04/f3/04f33f05fcbe9dd59b8484c92e3440596ea63e80.jpg) As we all know that ICPC is about to start. I am glad to invite all the college students to take part in [HackerEarth Collegiate Cup](https://www.hackerearth.com/hackerearth-collegiate-cup-qualifier/?utm_source=codeforces&utm_medium=organic&utm_campaign=collegiate_cup) on [Sep 03, 10:00 AM IST](https://www.timeanddate.com/worldclock/fixedtime.html?msg=HackerEarth+Collegiate+Cup+Qualifier&iso=20160903T10&p1=438&ah=2). It will add up in the practice for ACM-ICPC. This is a team contest where teams must consist of exactly 3 members and all members must be enrolled in a degree program at the same institution. The contest will have 4 rounds: **A. Qualifier Round:** It will be an online contest. All the teams who solve at least one problem will qualify to the next round. It will be a 24 hours c...
Invitation to HackerEarth Collegiate Cup, [HackerEarth Collegiate Cup ](https://www.hackerearth.com/hackerearth-collegiate-cup-qualifier

Full text and comments »

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

89.
By SecondThread, history, 12 months ago, In English
Meta Hacker Cup Round 3 [Hacker Cup Round 3](https://www.facebook.com/codingcompetitions/hacker-cup/2025/round-3) begins in about 1 hour! To compete, you must have placed in the top 500 in [Round 2](https://www.facebook.com/codingcompetitions/hacker-cup/2025/round-2) in the human track, or top 25 in the AI track. - Participants who place in the top 200 of Round 3 will have a special "Top-200" badge on their shirts. - The top 25 contestants in the human track will advance to the Final Round. As a reminder, in the human track, no communication with others or AI usage is allowed during the contest. (Likewise, in the AI track, no human code authoring or human decision making is allowed) I'll post an update later this week with information about the shirt-claiming process. Good luck, have fun, and we'll see you on the scoreboard!
Meta Hacker Cup Round 3, contest. (Likewise, in the AI track, no human code authoring or human decision making is allowed), [Hacker Cup Round 3](https://www.facebook.com/codingcompetitions/hacker-cup /2025/round-3) begins in

Full text and comments »

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

90.
By crbonilha, history, 10 years ago, In English
1st Collegiate Cup Brazil 2017 Hi everyone, HackerEarth and URI Online Judge are joining forces to bring you the 1st Collegiate Cup Brazil 2017. ![ ](https://hackerearth.global.ssl.fastly.net/static/hackerearth/images/collegiate_cup_brazil/ccb_logo.png) [Please find the link of registration here.](https://www.hackerearth.com/collegiate-cup-brasil-2017/?utm_source=HEURI&utm_medium=mailing&utm_campaign=CollegiateCup) The Collegiate Cup Brazil will be divided into two stages. A. Open Qualifier: It will be held online on the HackerEarth platform on May 27, 2017 at 9:30 P.M UTC. It will be a 24 hour long contest consisting of 4 algorithmic problems. [Check your time zone here.](https://www.timeanddate.com/worldclock/fixedtime.html?msg=1st+Collegiate+Cup+Brazil+2017+-+Open+Qualifier&iso=20170527T1830&p1=213&ah=23&am=55) B. Final Round: It will be held online on the URI platform on June 17, 2017 at 4:30 P.M UTC, in which top 100 Teams selected from the qualifier will participate. It will be a 4 hour lon...
1st Collegiate Cup Brazil 2017, Cup Brazil 2017. ![ ](https://hackerearth.global.ssl.fastly.net/static/hackerearth/images

Full text and comments »

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

91.
By Speedster1010, 10 months ago, In English
Invitation to Turing Cup 2K26 — organized by Turing Hut, VNRVJIET (Prizes worth Rs 75,000) ![ ](/predownloaded/71/2d/712da10e2c35147d671bce29b2500570decd1c03.png) Greetings, Codeforces community! We, [**Turing Hut**](https://turinghut.org), the official competitive programming club of VNRVJIET, Hyderabad, are thrilled to present our flagship event, [**Turing Cup 2K26**](https://turinghut.org/turingcup/) &mdash; _One Team, One Dream_, featuring an exciting **prize pool of ₹75,000!** This national-level coding contest is open to all undergraduate students. ### Format **Team Size**: 1-2 This competition will be held in 2 Rounds. **Round 1**: <s>Thursday, February 26th, 2026 at 20:30 IST</s> [**Saturday, February 28th, 2026 at 20:30 IST**](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Turing+Cup+2K26+Round-1&iso=20260228T2030&p1=505&ah=1&am=30). This round will last for **90 minutes** and will be held online. The contest link will be mailed to the participants 3 hours before the commencement of the round. Shortlisted teams for round 2 will be notifi...
Invitation to Turing Cup 2K26 — organized by Turing Hut, VNRVJIET (Prizes worth Rs 75,000), of VNRVJIET, Hyderabad, are thrilled to present our flagship event, [**Turing Cup 2K26**](https

Full text and comments »

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

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

Full text and comments »

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

93.
By sirknightingfail, history, 8 years ago, In English
More on Sprague-Grundy: Code, Exercises, Solution outlines, Proof. This is a follow-up blog to [this talk](https://codeforces.me/blog/entry/63054) Please let me know if there are any errors. I might not be able to reply rapidly as it is finals week for me.\ The previous post doesn't exactly explain how to actually work out the solutions to Sprague-Grundy problems, or how to code them. Within this follow-up blog, I shall attempt to explain some of my thought process on working through Sprague-Grundy and similar problems, as well as including some code. First, some pseudo-code of calculating the Sprague-Grundy, and how to find the MEX. <spoiler summary="Recursive Sprague-Grundy"> ~~~~~ # g is defined as a game (set of games), MAX is the maximum possible Sprague-Grundy value. define SG(g): # Make a set of sprague-grundy values seen = new boolean[MAX+1] for x in g: # It is important to also check if SG(x) fits inside of the bounds of the array, # And to ignore it if it does not. seen[SG(x)]=true curr = 0 w...
More on Sprague-Grundy: Code, Exercises, Solution outlines, Proof., problems, or how to code them. Within this follow-up blog, I shall attempt to explain some of my thought

Full text and comments »

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

94.
By yongwhan, 12 years ago, In English
2015 Facebook Hacker Cup Round 1 ## **General Comment** I did not spend too much time on thinking about the execution time since the 6-minute is usually much more than the required in the usual online contest (e.g., 2 seconds for CodeForces for instance). So, for each problem, I took whichever way leading me to code reliably. Also, for each problem, I did lots of stress testing since I screwed up few contests (e.g., the large input in the previous Google Code Jam) before by not fully testing my codes with respect to the full constraint given by the problem. For A and C, I generated the edge cases manually and compared the computed answers from the brute force approaches and made sure they match. For B and D, I generated the theoretical worst case to make sure they are handled properly using my codes. Thankfully, I hit few segmentation fault problems 4-5 hours into the contest, from which I tried few approaches to increase the stack size; manipulating the size limit in `#include<sys/resource.h>` did the trick ...
2015 Facebook Hacker Cup Round 1, CodeForces for instance). So, for each problem, I took whichever way leading me tocode reliably, ](http://codeforces.me/problemset/standings/page/3)) seriously. Foremost, I would like to thank

Full text and comments »

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

95.
By Qingyu, 13 months ago, In English
[Mirror] IOI 2026 China Mutual Tests As a part of the IOI 2026 China Team Selection, the IOI 2026 China Mutual Tests will be held on [QOJ](https://qoj.ac). The contest is in **IOI format** and opened for everyone. - Round 1: [contest_time:643561] [registration link](https://qoj.ac/contest/2555) - Round 2: [contest_time:643562] [registration link](https://qoj.ac/contest/2557) - Round 3: [contest_time:643563] [registration link](https://qoj.ac/contest/2560) - Round 4: [contest_time:643564] Statements will be provided in Chinese only. Each contest is 5 hours long with the IOI ruleset. In other words, you will receive feedback of your submissions, and you can get partial scores. ### Q&A s **Q: What's the difficulty of the contest? Can I participate if my rating is 1500/2000/2500/3000/4000?** A: The contest is typically harder than most Domestic/Regional Olympiad. We recommend you to participate in the contest if you can find joys in Codeforces Div. 1 contest. **Q: Can I use pre-written code / Google / AI ...
] [registration link](https://qoj.ac/contest/2557) - Round 3: [contest_time:643563] [registration link

Full text and comments »

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

96.
By adamant, history, 4 years ago, In English
Problems that I authored so far Hi everyone! Today I saw a discussion in AC Discord server about how many problems some people made for different competitions. It was sparkled by [this](https://codeforces.me/blog/entry/108595) CF entry. I haven't keep track of this before, so it made me curious to go through everything that I made and publish in a comprehensive list. I'm doing it mostly out of curiosity, but maybe it might be interesting for someone else too :) [cut]<br> | # | Date | Problem | Contest | Comment | |-|-|-|-| | 1 | Jan 2016 | [Sasha and Swaps](https://www.hackerrank.com/contests/infinitum14/challenges/sasha-and-swaps/problem) | Ad Infinitum 14 | Find a $T$-th root of a given permutation, while minimizing the number of swaps in which the root may be decomposed. | | 2 | Aug 2015 | [Sasha and swag strings](https://acm.timus.ru/problem.aspx?space=1&num=1799) | Ptz Summer 2015. MIPT Contest | Compute the total number of distinct substrings on all edges of a given string's suffix tree. | | 3 | ...
edges of a given string's suffix tree. | | 3 | Sep 2015 | [Alice and Bob (and string)](https, | Compute the total number of distinct substrings on all edges of a given string's suffix tree. | |3

Full text and comments »

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

97.
By OtterZ, 14 months ago, In English
maths for mincut problem:Do we really need to use Dinic to get mincut? # Introduction The max-flow min-cut theorem is a cornerstone of combinatorial optimization, providing a powerful framework for modeling a wide range of problems. While algorithms like Dinic’s are standard for computing maximum flows, their time complexity—often bounded by $\operatorname{O}({|V|}^2|E|)$ or $\operatorname{O}(|E|\sqrt{|E|})$ can become prohibitive for large-scale or specially structured graphs. This article explores an alternative strategy: instead of applying a generic flow algorithm, we directly analyze the min-cut formulation. The min-cut problem seeks the minimum total capacity of edges whose removal disconnects the source $s$ from the sink $t$. Formally, this is expressed as: $$ \min_{P,s\in P\land t\notin P}\{\sum_{u\in P,v\notin P}C(u,v)\} $$ By reformulating this combinatorial problem as a mathematical optimization task, we can often exploit the specific structure of the graph to derive highly efficient, custom-tailored solutions. This approach tra...
)\\ &= \min_P\{\sum_{u_i\in\complement_{V}P \cup SETA}A_i + sum_{v_i \in P\cup SETB}B_i + sum_{u_i\in P

Full text and comments »

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

98.
By ChthollyNotaSeniorious, history, 4 years ago, In English
Polynomial Round 2022 (Div. 1 + Div. 2) Editorial Thanks for your participation! I am so sorry for my careless review. We were preparing for this round for many months and made some problems which writers and testers are all like. We do want to give everyone a good time to enjoy the contest. But carelessness is deadly. In problem B, some test cases should have been made, but we missed them in not only the pretests but also the final tests. In fact, we had not noticed it until some suspicious hacks appeared. I and all co-authors sincerely regret our mistake and hope you can forgive us. Besides, few people are cyberbullying authors, please do not do so. If you have a bad experience, you can downvote me because of our fault. [problem:1774A] Idea: [user:cirno_9baka,2022-12-17] <spoiler summary="Solution"> The answer is the number of $1$s modulo $2$. We can get that by adding '-' before the $\text{2nd}, \text{4th}, \cdots, 2k\text{-th}$ $1$, and '+' before the $\text{3rd}, \text{5th}, \cdots, 2k+1\text{-th}$ $1$. </spoiler...
$. ~~~~~ #include using namespace std; char c[1005

Full text and comments »

99.
By CodemastersIntl, 2 years ago, In Russian
Codemasters Code Cup 2024: фокус на искусственный интеллект и бизнес-приложения Началась регистрация на пятый юбилейный турнир [Codemasters Code Cup 2024](https://codecup.online/) &mdash; всероссийское соревнование по программированию среди студентов. Отборочный раунд пройдет онлайн, а финал и церемония награждения состоятся в Туле. Codemasters Code Cup, который проводят компании Кодмастерс Мордовия и Кодмастерс Тула совместно с Тульским государственным университетом, с прошлого года стал Всероссийским событием. В 2023 году в турнире приняли участие около 370 студентов из 63 городов России &mdash; от Санкт-Петербурга до Владивостока. В 2024 году впервые в рамках турнира будет представлен трек «Разработка бизнес-приложений с использованием искусственного интеллекта». Второй традиционный трек &mdash; «Разработка бизнес-приложений». Участники могут принять участие в обоих треках на отборочном этапе, но в финале им придется выбрать один. Все задания рассчитаны на индивидуальное выполнение и разработаны специалистами-практиками компаний Кодмастерс Тула и Кодмастерс...
Codemasters Code Cup 2024: фокус на искусственный интеллект и бизнес-приложения, рублей за 1 место, 50 тысяч рублей за 2 место и 30 тысяч рублей за 3 место., Началась регистрация на пятый юбилейный турнир [Codemasters Code Cup 2024](https://codecup.online

Full text and comments »

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

100.
By tfg, history, 3 years ago, In English
A notorious coincidence (1854E) So one thing led to another and now I'm here to share my results. [Codeforces Round 889 (Div. 1)](https://codeforces.me/contest/1854) ------------------ As of writting this blog that's the most recent codeforces round and there was some controversy about some problems in it. I'm here to talk about a funny thing that happened involving its div1E. This story starts during the contest. <spoiler summary="You can skip this, it's just me talking about what happened to me before reaching E"> I was taking the contest and thinking about going to sleep after 1 hour without mindsolving anything but A1 but then I ended up solving CBA1. Without being able to notice that my solution to A1 was actually the intended solution to A2 and not having the faith in the gods of AC to just take the minimum of both constructions, I turned into E as I'm notoriously bad at interactive problems. </spoiler> Revisiting E after solving the other problems, I thought "maybe using a bunch of ones and hi...
". In my mind at that point there were 3 pieces of info: "the related problem had some idea of trying

Full text and comments »

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

101.
By MaximShipko, 13 years ago, In Russian
Russian AI Cup 2013 — CodeTroopers <img src="https://docs.google.com/uc?export=download&id=0B03R8YeB8otsWXp4aEhEeXBFUzA" style="float:right;margin:1em;"/> Всем привет! Как и было обещано, в этом году мы во второй раз проводим мероприятие **Russian AI Cup**, на этот раз **2013**. Участнику предстоит выступить в роли командира небольшого отряда бойцов в пошаговой тактической игре **CodeTroopers**. 4 ноября в 00:00 часов состоится запуск открытого бета-тестирования чемпионата, которое продлится одну неделю. Основная функциональность уже готова, однако в этот период мы продолжим насыщать игру контентом, в частности, планируется добавление новых карт. Также мы проверим стабильность работы системы и исправим возможные ошибки. В период бета-тестирования возможны существенные изменения в правилах игры. 11 ноября в 00:00 состоится релиз чемпионата, при этом рейтинг участников будет сброшен к начальному значению. Поучаствовать в мероприятии можно тут: [http://russianaicup.ru](http://russianaicup.ru) ## Что? Russian AI...
Russian AI Cup 2013 — CodeTroopers, серии мероприятий уже проводятся Russian Code Cup и Russian Design Cup. К участию в соревновании

Full text and comments »

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

102.
By The-Winner, history, 12 months ago, In English
[Tips; personal stuff] I got red rank. Here's some stuff I learned Hello everyone! This blog will be a collection of ideas, thoughts and personal experiences I gathered over the past ~7 years (darn, I am old). It might not contribute much to the world so feel free to skip it, but I do believe most people can get something interesting out of it. I waited on writing this until my opinion was actually worth something (still, take the following with a grain of salt or two). It is be a big wall of text (you have been warned). Sorry for taking a week to post this, University is crazy at times. [cut] Tips (and some personal experience) for problems solving (can probably extend to whatever else it is you want to do): - The most important thing: **Have fun**. If you don't have fun doing whatever it is you are doing, you are motivated by an external factor, that when removed from the equation will remove you from the action. Without a reason to come back, you will not, and the whole experience will slowly fade away (congrats, you wasted your time). ...
that code. - Pen and paper are your best friends. Thinking about every little detail is very hard

Full text and comments »

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

103.
By adamant, history, 4 years ago, In English
Permutation group basis construction (Schreier–Sims algorithm) Hi everyone! I had this blog drafter for quite a while, but the [$300 contest](https://codeforces.me/blog/entry/110840) motivated me to actually finish and publish it. I don't care about the prize that much as I think many other blogs published recently are talking about something even cooler. But I like to make people suffer, so I will apply anyway to make [user:peltorator,2023-01-12] read even more stuff >:) Besides, the contest makes it harder to stay on contribution top, so I got to do something to stay afloat. That being said... <hr> Today I'd like to write about an algorithm that solves the following problem: You're given a set of permutations $G = \\{g_1, \dots, g_m\\}$. Find the size $|\langle g_1, \dots, g_m \rangle|$ of the group generated by $G$. At first, I wanted to get into a lot of group-theoretic details with proofs and all, but then I felt like it would make the article harder to comprehend, so I will try to keep group-theoretic stuff to minimum, whi...
& 3 \newline 2 & 3 & 1\end{pmatrix}$ is perceived as a function $\sigma$, such that $\sigma(1) = 2

Full text and comments »

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

104.
By arknave, history, 2 years ago, In English
Compiling Meta Hacker Cup Inputs ![Why are you compiling the input data?](/predownloaded/4f/eb/4febf98037b96b365ca83ce0e713362c1a28dd74.png) Because it's fun :) Inspired by [user:SecondThread,2024-10-20]'s comment above, I thought I'd see how hard it would be to solve a Meta Hacker Cup problem at compile time. I chose to start with Round 2 A1, since the input is quite small. This is probably trivial since C++20 and above allow you to allocate memory in constexpr functions, so I gave it a whirl using C++17. This means no allocations are allowed, but the input/output parsing is luckily very straightforward for this problem. The code is a bit long (118 lines), so I've included it in the link below. It appears to work on the three major compilers: https://godbolt.org/z/cYG1rTfWr (v1) https://godbolt.org/z/3GdPKxrcj (v2). Note that the compiled binary returns a random value, To actually view the answer, you can view the compiled binary in a hex editor, or do what I did: ~~~~~ $ strings a.out | grep Case Ca...
Compiling Meta Hacker Cup Inputs, Case #1: 1 Case #2: 4 Case #3: 10 Case #4: 1 Case #5: 1 Case #6: 0 ~~~~~ This code is also

Full text and comments »

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

105.
By CristianoPenaldo, history, 4 years ago, In English
Rethink the Dijkstra algorithm -- Let's go deeper This is a blog for cp newbies (like me). For a long time I think the [Dijkstra algorithm (dij)](https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm) only has two usages: (1) Calculate the distance between vertices when the weights of edges are non-negative. (2) (Minimax) Given a path $p = x_1x_2...x_n$, define $f(p) := \max_{i=1}^{n-1}d(x_i, x_{i+1})$. Given source vertex $s$ and target vertex $t$, dij is able to calculate $min \\{f(p)|p\,\text{is a s-t path}\\}$. However, dij works for a function class, not only the sum/max functions. The sum/max functions are only the two most frequently used members of this function class, but the function class is far larger. Once the function $f$ satisfies several mandatory properties, you could use dij. The word "function class" is like an abstract class in C++: ~~~~~ struct f{ virtual bool induction_property() = 0; //bool: satisfy or not virtual bool extension_property() = 0; //bool: satisfy or not virtual bool dp...
) $\forall p$, for every vertex $v$ adjacent to the end of $p$ (`p.back()`), $f(p \cup v) \geq f(p)$. (3

Full text and comments »

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

106.
By RussianCodeCup, history, 10 years ago, translation, In English
Russian Code Cup Qual 1 — Editorial <h2>A. Martian Volleyball</h2> <p>First note that in order to end the game as soon as possible only the currently leading team must get points.</p><p>Consider the condition that one of the teams wins. It must score at least <i>k</i> points and have at least 2 points advantage.</p><p>So the answer is <i>max</i>(<i>k</i>,&thinsp;<i>min</i>(<i>x</i>,&thinsp;<i>y</i>)&thinsp;+&thinsp;2)&thinsp;-&thinsp;<i>max</i>(<i>x</i>,&thinsp;<i>y</i>).<h2>B. Painting the Wall</h2> <p>First note that if the maximal length of the continuous segment is <i>L</i>, at least <i>L</i> colors are needed to paint the wall. On the other side <i>L</i> colors is always enough.</p><p>Consider a square <i>L</i>&thinsp;&times;&thinsp;<i>L</i>, fill the first line with integers from 1 to <i>L</i>, fill the following lines with all its possible circular shifts. Use these squares to cover the given wall rectangle like this (<i>L</i>&thinsp;=&thinsp;4):</p><p><center> 1 2 3 4 1 2 3 4 1 2</p><p>2 3 4 1 2 3 4 1 2 3</p><...
Russian Code Cup Qual 1 — Editorial, Russian Code Cup Qual 1 — Разбор задач, 1 2 3 4 1 2 3 4 1 2, 2 3 4 1 2 3 4 1 2 3 , 3 4 1 2 3 4 1 2 3 4

Full text and comments »

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

107.
By RussianCodeCup, history, 9 years ago, In English
Russian Code Cup 2017 Finals — Results and Editorial Во-первых, поздравляем [user:moejy0viiiiiv,2017-09-10] с победой, [user:LHiC,2017-09-10] и [user:jcccccccccccccccccccccsb,2017-09-10] со вторым и третьим местом. Финал оказался сложным и мы рады, что борьба была жесткой. Задачи для раунда придумали и готовили [user:Aksenov239,2017-09-10], [user:GShark,2017-09-10], [user:izban,2017-09-10], [user:manoprenko,2017-09-10], [user:niyaznigmatul,2017-09-10], [user:qwerty787788,2017-09-10] и [user:SpyCheese,2017-09-10], руководитель жюри [user:andrewzta,2017-09-10]. Отдельно хочется отметить Илью Збаня [user:izban,2017-09-10], который является автором задач D, E и F, а также дал огромное количество полезных комментариев по всем задачам раунда. Теперь перейдем к разбору. <div class="problem-statement"><div class="header"><div class="title">A. Теория множеств</div></div><div class="tutorial"><p>Для начала докажем, что ответ всегда <span class="tex-font-style-tt">YES</span>.</p><p>Будем последовательно перебирать <span class="tex-span"><i...
Russian Code Cup 2017 Finals — Results and Editorial, Now let us move to a solution. Consider a query of type 3: you are , Перейдём к решению. Рассмотрим запрос типа 3: даны два спутника , class="upper-index">3)., типа 3 будем запрашивать максимум на суффиксе. Чтобы не учитывать два, ">max(B) есть O(n3, -span">O(n3) for each test case., -span">O(n3) в худшем случае, поэтому, в частности, >) is O(n3). That, >max(B) is O(n3

Full text and comments »

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

108.
By RussianCodeCup, history, 10 years ago, translation, In English
Russian Code Cup 2016 — Results and Tutorial Hi, everyone! Russian Code Cup 2016 is over, the problems for the Final Round were more difficult than usually, but the participants didn't give up. The champion is Gennady Korotkevich [user:tourist,2016-09-18], the second place winner is Vladislav Epifanov [user:vepifanov,2016-09-18], the third place winner is Nikolay Kalinin [user:KAN,2016-09-18]. Congratulations to the winners, the complete results are at the RCC web site http://russiancodecup.ru Before proceeding to the tutorial, we would like to thank [Mail.Ru Group](https://corp.mail.ru/) for organizing the tournament and providing the prizes, and the judges from [ITMO University](http://www.ifmo.ru) for problems. Chief judge Andrew Stankevich [user:andrewzta,2016-09-18], judges Vitaly Aksenov [user:Aksenov239,2016-09-18], Nikolay Budin [user:Budalnik,2016-09-18], Dmitry Filippov [user:DimaPhil,2016-09-18], Borys Minaiev [user:qwerty787788,2016-09-18], Ilya Peresadin [user:pva701,2016-09-18], Grigory Shovkoplyas [user:GShar...
Russian Code Cup 2016 — Results and Tutorial, Russian Code Cup 2016 — Итоги и разбор задач, row that adds 1 new L-tromino, and the last asterisk in a row adds 3 new L-trominoes. Let us stop, конец строки добавляется 3 новых уголка, в начало — 1. Прекращаем процесс как только, Hi, everyone! Russian Code Cup 2016 is over, the problems for the Final Round were more, Всем привет! Завершился Russian Code Cup 2016, задачи финала оказались очень сложными, но

Full text and comments »

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

109.
By shailesh_2004, 20 months ago, In English
Invitation to Turing Cup 2K25 — organized by Turing Hut, VNRVJIET (Prizes worth Rs 75,000) ![ ](/predownloaded/7e/e2/7ee274ee8b1738400bca53f799b6f62274b01d43.png) Greetings, Codeforces community! We, [**Turing Hut**](https://turinghut.org/), the official competitive programming club of VNRVJIET, Hyderabad, are thrilled to present our flagship event — [**Turing Cup 2K25**](https://turinghut.org/turingcup/) &mdash; _One Team, One Dream_, featuring an exciting **prize pool of ₹75,000**! This national-level coding contest is open to all undergraduate students. This competition will be held in **2 Rounds**. **Team Size : 1-2** **Round 1** : [Monday, April 7th, 2025 at 20:00 IST](https://www.timeanddate.com/worldclock/fixedtime.html?iso=20250407T20&p1=505). This round will last for **2 hours** and will be held on **HackerRank(Online)**. The contest link will be mailed to the participants 3 hours before the commencement of the round. Shortlisted teams for round 2 will be notified via e-mail. **Round 2** : This round will be conducted on VNRVJIET Campus on **Saturd...
Invitation to Turing Cup 2K25 — organized by Turing Hut, VNRVJIET (Prizes worth Rs 75,000), of VNRVJIET, Hyderabad, are thrilled to present our flagship event — [**Turing Cup 2K25**](https

Full text and comments »

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

110.
By MikeMirzayanov, 14 years ago, translation, In English
VK Cup 2012 — финал совсем скоро! <img src="http://assets.codeforces.com/images/vkcup-2012-star.png" style="width:200px;float:right;"/> Всем привет! Совсем скоро состоится финал чемпионата по программированию VK Cup 2012. Оргкомитет и жюри работают не покладая рук, чтобы мероприятие понравилось участникам. Напоминаю, что финал пройдет с 13-го по 16-е июля, а примут участие в нем лучшие 50 участников по результатам [contest:164]. Как только мы окончательно поймем, у кого получается приехать, список финалистов будет опубликован. Вот некоторая информация из штаба организационного комитета, которой нельзя не поделиться. Участники финала будут размещены в прекрасном отеле Кемпински, в самом центре Санкт-Петербурга на берегу Мойки. Отель находится в пешей доступности от офиса ВКонтакте, так что никаких изнурительных автобусов и знакомства с пробками Питера! Будете смотреть фотографии отеля – обратите внимание на ресторан на крыше с видом на Дворцовую площадь. <img src="http://assets.codeforces.com/images/v...
VK Cup 2012 — финал совсем скоро!, развлекательному мероприятию Code Game Challenge (special for VK Cup 2012). Также в этот день

Full text and comments »

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

111.
By low_, history, 4 years ago, In English
[Rated, Prizes!] DYTECHLAB Cup 2022 Round Announcement [Div.1 + Div.2] <img src="/predownloaded/ff/85/ff85322f740c69d9497bd061c096bad892766f13.png" align="right" style="height: 400px;" alt="text"/> > Hello Codeforces. Hoping you're having a wonderful day! ^_^ # DYTECHLAB Cup 2022 This October, we invite you to the **first ever [contest:1737]** that will start on [contest_time:1737]. The problems were prepared by members of our company who _share a passion for Competitive Programming_. It is an open and rated round for both divisions. The round will consist of **7 problems** and will be **150 minutes** long. We wish everyone good luck and have a positive delta! ### Prizes - 1st place: **US$200** cash prize - 2nd place: **US$100** cash prize - 3rd place: **US$50** cash prize Also, we understand that contestants like dope **MERCHANDISE**, so we are giving away lots of them! - **Top 20** will get a merchandise package which will include: a t-shirt **with your Codeforces handle on it**, a notebook, 2 pens, and a sports bag. - **3...
[Rated, Prizes!] DYTECHLAB Cup 2022 Round Announcement [Div.1 + Div.2], ! ^_^ # DYTECHLAB Cup 2022 This October, we invite you to the **first ever [contest:1737]** that will start

Full text and comments »

Announcement of Dytechlab Cup 2022
  • Vote: I like it
  • +118
  • Vote: I do not like it

112.
By errorgorn, 5 years ago, In English
Linear Basis (Xor Basis Extended) As part of the graduation requirements for my school, I have to complete a simple research project, so I decided to do something related to data structure and algorithms. I believe I have come out with a data structure that maintains the basis of vectors in $(\mathbb{Z}/m\mathbb{Z})^d$, where $m$ **may not be prime**. Since this was related to competitive programming, I think it is a good idea to share it here. Hopefully, this algorithm is actually novel :P I would like to thank: - [user:icypiggy,2021-12-26] for being my research mentor and tolerating my dumb questions - [user:rama_pang,2021-12-26] and [user:adamant,2021-12-28] for their helpful suggestions and comments Please comment under the blog or message me on codeforces if any parts are unclear or wrong. Also, I hope that some LGMs can help solve the open problems in this blog. # Introduction Maintaining the basis of vectors in $(\mathbb{Z}/2 \mathbb{Z})^d$, also known as the xor basis algorithm is a well-studie...
(n \cdot d^2 + \Omega(m) \cdot d^3 + d \cdot \log(m))$ pre-processing, where $\Omega(m)$ is the

Full text and comments »

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

113.
By RussianCodeCup, history, 10 years ago, translation, In English
Russian Code Cup 2017 Elimination Round — Editorial <h2>A. Small Numbers</h2> <p>First of all, find prime factorization of numbers <i>a</i> and <i>b</i>.</p><p>After that you need to notice that if <i>ab</i> is divisible by <i>p</i><sup>2</sup>, (where <i>p</i> is a prime number), it is either possible to divide both <i>a</i> and <i>b</i> by <i>p</i> instantly, or you will need to perform one of the latter two operations first to move one of <i>p</i> factors to the other number, and then divide both by <i>p</i>.</p><p>Obviously, parity of occurrence of prime numbers in the multiple <i>ab</i> remains unchanged in all operations. Therefore we can either remove <i>p</i> factor completely from <i>ab</i> or leave it occurring only once. After removing all primes, lets say the ones left are <i>p</i><sub>1</sub>,&thinsp;<i>p</i><sub>2</sub>,&thinsp;...,&thinsp;<i>p</i><sub><i>n</i></sub>. Let us call multiple of all these numbers <i>d</i>. Important observation is that <i>n</i> can't exceed 14 because multiple of first 15 prime numbers is mor...
Russian Code Cup 2017 Elimination Round — Editorial, Russian Code Cup 2017 Elimination Round — Разбор задач, 3) Given two lexicographically minimal subsequences SA and S , 3) Найдя две лексикографически минимальные подпоследовательности SA и , The total number of triangles is equal to the number of ways to choose 3 points ofn. , to the number of ways to choose 3 points of n. Now note the fact: each right or obtuse , ;= 3 и m = 1., > 3) Объединим две подпоследовательности в одну, получив тем самым лексикографически минимальную, >k-subtree. See the picture below for k = 3 and m = 1., n3.

Full text and comments »

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

114.
By Nickolas, 15 years ago, translation, In English
VK Cup 2012 Wild-card Round 1 The contest is over. My sincere respect to the winner in overall run [user:nab,2012-03-18] who solved all 10 problems in 1h 25m, and congratulations to the winner in the official contest [user:winger,2012-03-18] who repeated this heroic deed in 1h 52m. [Here](http://codeforces.me/blog/entry/4139) is the editorial. ----- The language of this round is Factor --- a stack-based functional language with a sophisticated system of built-in libraries (dictionaries). [cut] Sample programs: #### A + B (A and B are given in different lines): ~~~~~ USING: io kernel math math.parser ; readln string>number readln string>number + number>string print ~~~~~ #### 42 (given the quantity of numbers, and then the numbers themselves, one per line, output YES if their sum equals 42, and NO otherwise): Version 1 ([user:Nickolas,2012-03-18]) ~~~~~ USING: io kernel math math.parser sequences ; readln string>number iota 0 [ drop readln string>number + ] r...
VK Cup 2012 Wild-card Round 1, VK Cup 2012 Уайлд-кард раунд 1, examples at Progopedia](http://progopedia.com/language/factor/) * [examples at RosettaCode](http, Прогопедии (рус.)](http://progopedia.ru/language/factor/) * [примеры на Rosetta Code](http

Full text and comments »

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

115.
By MikeMirzayanov, history, 10 years ago, In Russian
VK Cup 2016 — Финал Ну вот и настал этот день! Именно сегодня, [3-го июля в 11:00](http://timeanddate.com/worldclock/fixedtime.html?day=3&month=7&year=2016&hour=11&min=0&sec=0&p1=166) состоится финал VK Cup 2016! Лучшие 20 команд по результатам отбора уже собрались в Санкт-Петербурге. Позади пробный тур (первое место заняли [user:Um_nik,2016-07-03] и [user:Umqra,2016-07-03] &mdash; наши поздравления и клевые толстовки от ВК!) и Code Game Challenge (особо удался в этом году!). Первое место Code Game Challenge заняли [user:I_love_Tanya_Romanova,2016-07-03] и [user:MrDindows,2016-07-03], браво! Впереди основной тур &mdash; финальный раунд VK Cup. Участники будут бороться за звание Чемпиона и солидные денежные призы: * **1 место — 1048576 рублей** * 2 местo — 524288 рублей * 3 местo — 262144 рубля * 4-8 места — 131072 рубля Желаю удачи участникам и побольше позитива на туре! Зрители смогут болеть по <a href="http://codeforces.me/vkcup2016/before-systests-contest-695-standings.html">этой ...
VK Cup 2016 — Финал, /fixedtime.html?day=3&month=7&year=2016&hour=11&min=0&sec=0&p1=166) состоится финал VKCup 2016

Full text and comments »

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

116.
By gKseni, history, 11 years ago, In Russian
Контесты в выходные: VK Cup R3, GCJ R1C и RCC Q1 Н &mdash; напоминалочка. В выходные пройдут вот такие контесты: - [VK Cup R3 + интернет-трансляции для обоих дивизионов](http://codeforces.me/contests/643,673,674) &mdash; [7 мая, 18:05-21:05]( http://timeanddate.com/worldclock/fixedtime.html?day=7&month=5&year=2016&hour=18&min=5&sec=0&p1=166), 3 часа - [Google Code Jam &mdash; Round 1C]( https://code.google.com/codejam) &mdash; [8 мая, 12:00-14:30]( http://timeanddate.com/worldclock/fixedtime.html?day=8&month=5&year=2016&hour=12&min=0&sec=0&p1=166), 2.5 часа - [Russian Code Cup &mdash; первая квалификация](http://www.russiancodecup.ru/ru/) &mdash; [8 мая, 19:00-21:00]( http://timeanddate.com/worldclock/fixedtime.html?day=8&month=5&year=2016&hour=19&min=0&sec=0&p1=166), 2 часа Лучший отдых &mdash; это смена деятельности. Даешь активные выходные: гуляем, решаем, наслаждаемся! Отдыхаем телом, умом и душой ;) Участвуйте &mdash; все получится. <img src="http://codeforces.me/predownloaded/96/64...
Контесты в выходные: VK Cup R3, GCJ R1C и RCC Q1, =0&p1=166), 3 часа - [Google Code Jam — Round 1C]( https://code.google.com/codejam

Full text and comments »

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

117.
By Joshik, 16 years ago, In Russian
Russian Code Cup <div><h1 style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; display: block; font-weight: normal; font-size: 26px; font-family: Arial, Verdana, sans-serif; "><a href="http://russiancodecup.ru/">Российский кубок по программированию</a>&nbsp;от Mail.ru Group</h1></div><div>Квалификационные туры (по 2 часа):<br></div><div><ol><li>8 мая, 11:00</li><li>14 мая, 11:00</li><li>15 мая, 17:00<br></li></ol></div>Отборочный раунд (3 часа):<div><ul><li>19 июня, 11:00<br></li></ul></div><div>Финал:<br></div><div><ul><li>17 сентября<br></li></ul><div><br></div>Раунды проводятся по правилам ACM.<div>С каждого квалификационного раунда первые 200 человек проходят в отборочный раунд.</div><div>Из отборочного раунда 50 человек проходят в Onsite финал.</div></div><div><br></div><div><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 10px; padding-left: 0px; margin-top: 0px; margin-right:...
Russian Code Cup, , прошедшие квалификацию, получат по почте футболки с символикой Russian Code Cup. Все участники RCC, Отборочный раунд (3 часа): * 19 июня, 11:00

Full text and comments »

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

118.
By WitchOfTruth, history, 6 years ago, In English
Contests hack statistics (Number of hacks by round) Just felt like gathering some data about hacks. Parsed around ~400 last contests Probably it would be worth it to also include SFT, but whatever Educational 96 is not finished yet but also whatever Last 100 ------------------ **847** Educational Codeforces Round 96 (Rated for Div. 2) **30** Codeforces Global Round 11 **248** Codeforces Round #674 (Div. 3) **0** 2020 ICPC, COMPFEST 12, Indonesia Multi-Provincial Contest (Unrated, Online Mirror, ICPC Rules, Teams Preferred) **97** Bubble Cup 13 &mdash; Finals [Online Mirror, unrated, Div. 2] **86** Bubble Cup 13 &mdash; Finals [Online Mirror, unrated, Div. 1] **20** Codeforces Round #675 (Div. 2) **1** Codeforces Round #672 (Div. 2) **70** Codeforces Round #671 (Div. 2) **58** Educational Codeforces Round 95 (Rated for Div. 2) **3** Codeforces Round #673 (Div. 2) **11** Codeforces Round #673 (Div. 1) **73** Codeforces Round #667 (Div. 3) **121** Grakn Forces 2020 **4** Co...
) **30** Codeforces Global Round 11 **248** Codeforces Round #674 (Div. 3) **0** 2020 ICPC, ** Codeforces Global Round 11 **248** Codeforces Round #674 (Div. 3) **0** 2020 ICPC, COMPFEST

Full text and comments »

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

119.
By MidnightCodeCup, 7 months ago, In English
Midnight Code Cup Qualification Is happening on [April 11th at 1 PM UTC](https://www.timeanddate.com/worldclock/fixedtime.html?day=11&month=4&year=2026&hour=13&min=00&sec=0) here on Codeforces. The qual lasts 4 hours. [MCC](https://codeforces.me/blog/entry/151741#comment-1358025) is a new generation programming contest, with a 24 hour onsite final, broad variety of problems (algorithmic challenges, optimization puzzles, plus some weird problems). You can participate in a team of 3 or less, the use of AI is allowed and encouraged. You can still register, but please do it by the end of the day April 10th to get you log in info in time. Register here: https://midnightcodecup.org/ If you already registered ------------------------- You'll get an email from Codeforces with your login information on April 10th. Log in with those credentials and wait for the problem statements to become available at 1PM UTC on Saturday! **Important:** If you registered through CF yesterday &mdash; this was a registrati...
Midnight Code Cup Qualification, puzzles, plus some weird problems). You can participate in a team of 3 or less, the use of AI is, , plus some weird problems). You can participate in a team of 3 or less, the use of AI is allowed and

Full text and comments »

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

120.
By bicsi, history, 4 years ago, In English
"Merging treaps" -- or how to merge sorted sets in good complexity... ... without doing much of anything. I've been obsessed for the last two days about problem [Data Centers](https://ubilo.tubitak.gov.tr/egoi2022/assets/tasks/DataCenters.pdf) from EGOI 2022. In particular, it has a subtask where $1 \leq N \leq 10^5$ and $1 \leq S \leq 5000$, where it seems $O(NS)$ wouldn't fit TL. I've been conjecturing that using treaps would amortize to good complexity, and after two days of burning grey matter, I've finally found a proof, and it's pretty cool to make a blog out of it. The problem basically starts with an array $[v_1, v_2, ..., v_N]$, where $1 \leq v_i \leq V$ for all $i$. It then asks us to iteratively simulate the operation: "Subtact $x_i$ from the biggest $m_i$ elements.". All this while keeping the array sorted. We'll show that just using treaps (or any BBST for that matter) yields a good amortized complexity. More exactly, we'll prove $O((N + Q) \log V \log N)$, and it should actually be better in practice. ### Naive solution with tr...
$) 2. Subtract $x_i$ from all elements of $B$ 3. Merge the resulting sequences $A$ and $B$ Using

Full text and comments »

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

121.
By RussianCodeCup, history, 10 years ago, translation, In English
Russian Code Cup 2016 — Разбор задач третьей квалификации <div class="problem-statement"><div class="header"><div class="title">A. Прямоугольник и квадраты</div></div><div class="tutorial"><p>При решении этой задачи нужно заметить, что важна лишь разность площадей исходного прямоугольника и собранного, а форма может быть любая. Тогда очевидно, что в качестве ответа, подойдет прямоугольник со сторонами <span class="tex-span"><i>C</i></span> и <span class="tex-span"><i>nC</i></span>, где <span class="tex-span"><i>n</i></span>&nbsp;&mdash; натуральное число.</p><p>Число <span class="tex-span"><i>n</i></span> несложно вычислить. Оно равно частному <span class="tex-span"><i>A</i>&middot;<i>B</i></span> и <span class="tex-span"><i>C</i><sup class="upper-index">2</sup></span> округленному либо вверх, либо вниз. Осталось выбрать из этих ответов наиболее выгодный и не забыть учесть, что нужно использовать хотя бы один квадрат <span class="tex-span"><i>C</i>&thinsp;&times;&thinsp;<i>C</i></span>.</div></div> <div class="problem-statement"><div class=...
Russian Code Cup 2016 — Third Qualification Round Editorial, Russian Code Cup 2016 — Разбор задач третьей квалификации, class="tex-span">n - 3 и n&thinsp, ">n - 3 and n - 4, ">n - 3 и n - 4, , ;- 3 and n - 4,

Full text and comments »

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

122.
By gojira, history, 13 months ago, In English
Invitation to EldarVerse October 2025 Long Challenge (Halloween) TL;DR: Come solve 3 spooky problems a day in [October 2025 Long Challenge](https://www.eldarverse.com/contest/halloween25) from [October 27](https://www.timeanddate.com/worldclock/converter.html?iso=20251027T040000&p1=224&p2=179&p3=16&p4=37&p5=166&p6=371&p7=176&p8=33&p9=236&p10=248&p11=152) through November 3, UTC 4am time. I'm hosting a Halloween-themed contest on EldarVerse! Each day will feature three problems of increasing difficulty &mdash; from something like Codeforces Div2 A to something like Div2 E. I want to thank [user:asdasdqwer,2025-10-20], [user:StupidGuy13,2025-10-20], [user:fextivity,2025-10-20], and [user:likithreddy949,2025-10-20] for their help testing the problemset. Special thanks to [user:Golovanov399,2025-10-26] for additional testing on a short notice <3 Hope to see you on the leaderboard! P.S. Contest format is a mix of Meta Hacker Cup (download inputs, submit outputs) and Advent of Code (each problem is worth 100 points, each subsequent solver g...
TL;DR: Come solve 3 spooky problems a day in [October 2025 Long Challenge](https

Full text and comments »

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

123.
By RussianCodeCup, history, 10 years ago, translation, In English
Russian Code Cup 2016 Elimination Round — Editorial <div class="problem-statement"><div class="header"><div class="title">A. Important Test</div></div><div class="tutorial"><p>For each variant consider all prefixes of tasks. It is optimal to copy the task that takes most time, so we keep track of maximal time and calculate the sum <span class="tex-span"><i>S</i></span> of <span class="tex-span"><i>t</i><sub class="lower-index"><i>ij</i></sub></span> of the prefix. If the maximal time is greater than <span class="tex-span"><i>t</i><sub class="lower-index">0</sub></span> it is better to copy this task, getting the total time needed be <span class="tex-span"><i>S</i>&thinsp;-&thinsp;<i>max</i>(0,&thinsp;<i>M</i>&thinsp;-&thinsp;<i>t</i><sub class="lower-index">0</sub>)</span>. Now compare this value to <span class="tex-span"><i>t</i></span> to check whether it is possible to write down that many tasks for this variant.</div></div> <div class="problem-statement"><div class="header"><div class="title">B. Centipede</div></div><div class="tu...
Russian Code Cup 2016 Elimination Round — Editorial, Russian Code Cup 2016 Отборочный раунд — Разбор задач, Note that if the tree has a vertex of degree greater than 3, it is impossible to fulfill the , Заметим, что если в дереве есть вершина степени больше 3, то задание выполнить не получится , vertex of degree greater than 3, it is impossible to fulfill the task, because in a complete binary, подвесить необходимое число вершин. Заметим, что если в дереве есть вершина степени больше 3, то

Full text and comments »

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

124.
By Aksenov239, 16 years ago, In Russian
Russian Code Cup QR 3 <p style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: verdana, arial, sans-serif; font-size: 12px; line-height: 20px; "><span class="Apple-style-span" style="font-family: verdana, arial, sans-serif; font-size: 12px; line-height: 20px; ">Здравствуйте! Хочется Вам напомнить, что через некоторое время - в 17-00 15 мая (воскресенье;) состоится третий и последний квалификационный раунд "</span><span class="Apple-style-span" style="font-family: verdana, arial, sans-serif; font-size: 12px; line-height: 20px; "><span class="Apple-style-span" style="font-family: Arial, Verdana, sans-serif; font-size: 16px; ">Russian Code Cup</span></span><span class="Apple-style-span" style="font-family: verdana, arial, sans-serif; font-size: 12px; line-height: 20px; ">" в данном турнире. В данном раунде распределятся последние 200 мест в следующем раунде, а также 200 футболочек. Хотите футбо...
Russian Code Cup QR 3, , sans-serif; font-size: 16px; ">Russian Code Cup

Full text and comments »

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

125.
By -is-this-fft-, history, 19 months ago, In English
Run-twice (aka communication) problems with Polygon and testlib.h ### Introduction _Run-twice_ problems (also called _multipass_ or _communication_ problems) are problems in which your program is executed twice. Here are some examples: - [problem:2054A] from the TON marathon. - Problems D, G and K from [Universal Cup Season 2 Stage 5](https://assets.ucup.ac/statements/statements-2-5.pdf). - All problems from [Universal Cup Season 2 Stage 16](https://assets.ucup.ac/statements/statements-2-16.pdf). - [Flash](https://boi2019.eio.ee/wp-content/uploads/2019/04/flash.en_.pdf) from BOI 2019 (this one is actually more complicated, but the premise is the same &mdash; there are multiple instances of your program which cannot share data except through the interactor. As you can see, there are many ways this format can be used, but the common themes are encoding/decoding, compression/decompression, constructing a bijection and similar ideas. The general principle is that you have to implement two functions and the second function has to somehow use t...
the TON marathon. - Problems D, G and K from [Universal Cup Season 2 Stage 5](https

Full text and comments »

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

126.
By sidhant, 7 years ago, In English
Tutorial on Zeta Transform, Mobius Transform and Subset Sum Convolution **Pre-requisite**: Go through the Zeta/SOS DP/Yate's DP blog [here](https://codeforces.me/blog/entry/45223) **Source**: This blog post is an aggregation of the explanation done by [user:arjunarul,2019-12-26] in this [video](https://youtu.be/UOTCTbm1NrQ?list=PLi0ZM-RCX5nsTc2Z6woHr5qoF6n3b-thO), a comment by [user:rajat1603,2019-12-26] [here](https://codeforces.me/blog/entry/57250?#comment-409117) and the paper on [Fast Subset Convolution](http://people.csail.mit.edu/rrw/presentations/subset-conv.pdf) **Notation**: 1. set $s$ and mask $s$ are used interchangeably meaning the same thing. 2. $a \setminus b$ would mean set subtraction, i.e subtracting set $b$ from set $a$. 3. $|s|$ refers to the cardinality, i.e the size of the set $s$. 4. $\sum_{s' \subseteq s} f(s')$ refers to summing function $f$ over all possible subsets (aka submasks) $s'$ of $s$. **Aim**: Given functions $f$ and $g$ both from $[0, 2^n)$ to integers. Can be represented as arrays $f[]$ and $g[]$ r...
thing. 2. $a \setminus b$ would mean set subtraction, i.e subtracting set $b$ from set $a$.3

Full text and comments »

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

127.
By legends_in_disguise, history, 21 month(s) ago, In English
Signs You’ve Been Coding Too Long Salam Codeforces! Salam Codeforces! Salam Codeforces! Spending too much time coding can do weird things to your brain. If you’ve ever found yourself debugging in your dreams or trying to Ctrl+Z your life, you might be in too deep. Here are a few signs it’s time to step away from the keyboard—at least for a little while. --- ### 1. **You Dream in Code** You go to bed thinking about a bug, and instead of peaceful dreams, your mind throws you straight into a debugging session. The worst part? You almost solve it—until your alarm goes off. > Midnight Thought: "Wait… did I forget to close that loop?" --- ### 2. **Error Messages Feel Personal** At some point, error messages stop being neutral feedback and start feeling like personal attacks. You swear the compiler has it out for you. > Emotional Response: "Oh, now you’re just being rude." --- ### 3. **You Try Keyboard Shortcuts in Real Life** Ever tried to "Ctrl+Z" a spilled drink or "Ctrl+F" to find y...
—at least for a little while. --- ### 1. **You Dream in Code** You go to bed thinking about

Full text and comments »

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

128.
By Aksenov239, 13 years ago, In Russian
Russian Code Cup 2013 ER Здравствуйте, друзья. В ближайшее воскресенье (16 июня) в [14-00 по Москве](http://www.timeanddate.com/worldclock/fixedtime.html?msg=Russian+Code+Cup+2013+ER&iso=20130616T14&p1=352&ah=3) состоится отборочный раунд, который позволит 50 людям из 600 пройти на онсайт раунд, который пройдёт в сентябре. Хочется обратить внимание, этот раунд будет длиться уже на один час больше, то есть ровно 3. Всем удачи! До свидания!
Russian Code Cup 2013 ER, /fixedtime.html?msg=Russian+Code+Cup+2013+ER&iso=20130616T14&p1=352&ah=3) состоится отборочный раунд, ://www.timeanddate.com/worldclock/fixedtime.html?msg=Russian+Code+Cup +2013+ER&iso=20130616T14&p1=352&ah=3) состоится, Хочется обратить внимание, этот раунд будет длиться уже на один час больше, то есть ровно3.

Full text and comments »

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

129.
By SecondThread, history, 5 years ago, In English
Facebook Hacker Cup 2021 Shirt Prizes - Last Call Good morning! If you earned a shirt in Facebook Hacker Cup 2021 by placing in the top 2000 of Round 2 and did not yet get an email with a code to claim your shirt, please DM me on CF with the following information: 1. Your place in Hacker Cup Round 2 in 2021 (such as 1999th place) 2. A link to your facebook account (such as [https://www.facebook.com/profile.php?id=100008893002051](https://www.facebook.com/profile.php?id=100008893002051) ) 3. The email address linked to your facebook account (such as [email protected]) Pi day, 2022, (March 14th, 2022) will be the last day that we ship 2021 shirts. For the 25 finalists, prizes are handled separately, and you can contact us individually.
Facebook Hacker Cup 2021 Shirt Prizes - Last Call, Good morning! If you earned a shirt in Facebook Hacker Cup 2021 by placing in the top 2000 of

Full text and comments »

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

130.
By xtalclr, 7 years ago, In English
Hacker Cup 2019 Round 2 "Seafood" Solution I participated in this year's Facebook Hacker Cup and have enjoyed all the problems so far. The only problem I couldn't solve during the contest was the last problem of Round 2 named "Seafood" ([link](https://www.facebook.com/hackercup/problem/404425766835121/)). Facebook always uploads solutions right after the contest, which I'm thankful for, so I checked the [solution](https://www.facebook.com/notes/facebook-hacker-cup/hacker-cup-2019-round-2-solutions/2860037857345430/) for that problem. However, I couldn't see why the solution works just from their description. Maybe I'm not thinking through it enough, but I found it hard to justify their approach in mathematical rigor. So I picked up key ideas from their description and filled out the details. I'm writing this for myself, and it turns out to be more complicated than I thought but I hope this helps some folks out there. If you have any simpler solution/description I'm happy to know. Here is a short synopsis of the problem. You...
Hacker Cup 2019 Round 2 "Seafood" Solution, I participated in this year's Facebook Hacker Cup and have enjoyed all the problems so far. The

Full text and comments »

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

131.
By MikeMirzayanov, 6 years ago, In Russian
Технокубок 2021 — олимпиада по программированию для школьников <img src="//assets.codeforces.com/images/tk-banner-2019.png"/> Mail.ru Group совместно с МФТИ, МГТУ им. Н. Э. Баумана и Codeforces в шестой раз запускает «Технокубок» — олимпиаду по программированию для школьников. В этом году «Технокубок» вошел в перечень олимпиад первого уровня. Сразиться за звание самого талантливого молодого программиста приглашаются учащиеся средних образовательных учреждений 8-11 классов. Победители и призеры олимпиады будут определены по результатам очного этапа, который будет проведен 7 марта 2021 года на базе МФТИ, МГТУ им. Н.Э.Баумана, а также на других региональных площадках, о которых будет сообщено позднее. [cut] <br/> ## Этапы соревнования #### Ознакомительные раунды Перед каждым отборочным раундом проходит двухдневный ознакомительный раунд, в котором можно потренироваться и проверить силы. Решение ознакомительных задач не влияет на результат. Также, в это время у участников олимпиады будет возможность ознакомиться с платформой Code...
Boot Camp, Russian Code Cup, Russian Design Cup, и другие, а также тесно сотрудничает с

Full text and comments »

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

132.
By pkhaustov, 14 years ago, In Russian
Проблемсет года 2012 Вот и пролетела вереница новогодних праздников, большинство из нас неохотно возвращаются к трудовым будням. Кроме того, конец новогодних праздников совмещен и с началом последнего этапа голосования "Итоги 2012 года" на сайте проекта SnarkNews. Собственно, об этом событии мне бы и хотелось поговорить в этом посте. Казалось бы, обычное голосование, которое вполне может быть результатом субъективности и чувства юмора участников олимпиадного движения. Но если взглянуть на это голосование под хотя бы сколько-нибудь отличным углом, то в нем можно увидеть неплохую попытку собрать в одном месте все самые значимые события и результаты прошедшего года, выделить людей, которые внесли наиболее значимый вклад в олимпиадное движение. Хотелось бы попросить не относиться пренебрежительно к такого рода голосованию. Если нет желания голосовать объективно &mdash; лучше просто не голосуйте. Год выдался крайне богатым на события: ИТМО стал четырехкратным чемпионом Мира, Евгений Капун стал третьим в и...
Hacker Cup 2012, Егор Куликов стал победителем TopCoder Open 2012, Геннадий Короткевич поступил в ИТМО, истории двукратным абсолютным чемпионом Мира, Роман Андреев стал победителем Facebook HackerCup

Full text and comments »

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

133.
By Sanae, history, 15 months ago, In English
Set algorithm(rev.2) # Set algorithm Part I Sometimes we may meet with some functions $S\rightarrow V$(S is a set,V is a value),and we need to handle some transformations on it. The article is for beginners whick is much easy, and I may continously update the article. There are some features. First the problem always give small $n$,such as $n\leq 15,n\leq20$. Second,the time complexity is always $O(n2^n),O(3^n),O(n^22^n)$. Let's do some assumption: The values form a ring and they contain ring operations like addition,substraction,multification or division in constant time. ## FWT/FMT The most classical one is FWT/FMT. ### Problem Define $a(S),b(S)(S\subseteq U)$ on a set. Get all $c(S)=\sum\limits_{i \oplus j=S}a_ib_j\qquad \oplus \text{is} \ \textrm{and,or,xor}$ The general idea: Let $a, b, c$ be maps (functions) from a set $S$ to a value domain $V=(N/Q/C\cdots)$. We define a transformation $\text{FWT}$ (Fast Walsh Transform) as a map from the space of such functi...
^n),O(3^n),O(n^22^n)$. Let's do some assumption: The values form a ring and they contain ring

Full text and comments »

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

134.
By Ilya_Is2022, 16 months ago, translation, In English
Приглашение на Community Code Cup 8! Привет, Codeforces! ================== Я рад пригласить Вас принять участие в нашем новом раунде [Community Code Cup 8] (https://cups.online/ru/contests/contests_code_cup), который пройдет на платформе **All Cups**! Соревнование состоится [вторник, 29 июля 2025 г., в 17:05]() и пройдет по немного измененным правилам **ICPC**: - Все решения будут тестироваться на **полном** наборе тестов; - **Штраф** за неверную попытку в этом раунде будет равен $20$ минутам; Для участников соревнования было подготовлено **$6$** интересных задач. Длительность раунда составит $2$ часа $15$ минут. Авторы соревнования: - Максим Горшунов [user:maksonchik20,2024-08-20] - Станислав Некрасов [user:nekstas,2025-07-28] - Тимур Пономарев [user:Tmitmi,2025-07-28] - Илья Донов [user:donovilia2007,2025-07-28] Переводчики соревнования: - Роман Исаев [user:CUMberland,2024-08-20] - Юлия Сизова [user:Niffler_qwerty,2024-08-20] Для российских участников соревнования предусмотрены призы: ...
Приглашение на Community Code Cup 8!, раунде [Community Code Cup 8] (https://cups.online/ru/contests/contests_code_cup), который пройдет на, - **Победитель** получит **Умная колонка VK Капсула Мини**, а участникики, занявшие **2-3** места

Full text and comments »

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

135.
By RussianCodeCup, 11 years ago, translation, In English
Russian Code Cup 2016 — Разбор задач <h2>A. Двоичная строка</h2> <p>Для начала заметим, что задача не имеет решений тогда и только тогда, когда выполняется одно из двух условий: <ul type="disc"> <li> Либо |<i>b</i>&thinsp;-&thinsp;<i>c</i>|&thinsp;&gt;&thinsp;1 </li><li> Либо <i>b</i>&thinsp;=&thinsp;0, <i>c</i>&thinsp;=&thinsp;0, и при этом <i>a</i>&thinsp;&ne;&thinsp;0 и <i>d</i>&thinsp;&ne;&thinsp;0 </li></ul></p><p>Для остальных случаев будем решать в два этапа: Сначала соберем минимальную строку, которая будет удовлетворять условиям на строки 01 и 10, а затем допишем после первого встреченного нуля <i>a</i>&thinsp;-&thinsp;1 ноль, а после первой встреченной единицы <i>d</i>&thinsp;-&thinsp;1 единицу. Очевидно, что условия на 01 и 10 от таких действий не испортятся. <h2>B. Поезд и туннель</h2> <p>Разобьем весь поезд на отрезки вагонов без света. Будем идти по каждой группе из таких вагонов, и в том вагоне, на котором суммарная длина вагонов становится не меньше <i>h</i>, будем включать свет. Очевидно, что данная стр...
Russian Code Cup 2016 — Разбор задач, выбрать пару ребер в двух деревьях и O(n3) — время работы, 2 способов выбрать пару ребер в двух деревьях и O(n3)

Full text and comments »

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

136.
By FazeCT, history, 4 years ago, In English
266 Coding Cup Editorial Link to the contest: https://codeforces.me/contests/397164 (Problems are at 1300- difficulty). **A. Another Sanity Check, Why Not?** Idea: [user:FazeCT,2022-09-17] <spoiler summary="Tutorial"> First, you have to check if $n$ is in one of the following $3$ ranges: $48 \le n \le 57$, $65 \le n \le 90$, $97 \le n \le 122$. If **no**, then output "Lmao". Else, use **char()** to output the character associated with the number $n$. </spoiler> <spoiler summary="Solution"> ~~~~~ #include <bits/stdc++.h> using namespace std; void solve() { int n; cin >> n; if(n<48 || (n>57 && n<65) || (n>90 && n<97) || n>122) cout << "Lmao" << endl; else cout << char(n) << endl; } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); solve(); } ~~~~~ </spoiler> **B. Seghhhhhhhhh** Idea: [user:junvalentine,2022-09-17] <spoiler summary="Tutorial"> If the length of the given string s is odd, then the answer is $NO$, since adding two strings...
266 Coding Cup Editorial, First, you have to check if $n$ is in one of the following $3$ ranges, ="Tutorial"> First, you have to check if $n$ is in one of the following $3$ ranges: $48 \le n \le 57$, $65, For instance, in the first example we had $a = ⟨3, 5, 2, 1, 4⟩$ and $b = ⟨4, 3, 2, 5, 1⟩$. Then, $c

Full text and comments »

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

137.
By MikeMirzayanov, 7 years ago, In Russian
Технокубок 2020 — олимпиада по программированию для школьников <img src="//assets.codeforces.com/images/tk-banner-2019.png"/> Mail.Ru Group совместно с МФТИ, МГТУ им. Н. Э. Баумана и Codeforces в пятый раз запускает олимпиаду по программированию для школьников &mdash; «Технокубок». В этом учебном году олимпиада вошла в перечень олимпиад школьников, повысив свой уровень до самого высокого &mdash; первого: теперь победители и призеры могут быть зачислены на профильные факультеты российских вузов без вступительных экзаменов. Кроме того лучшие участники получат ценные призы от компании Apple. Сразиться за звание самого талантливого молодого программиста приглашаются учащиеся средних образовательных учреждений 8-11 классов. Победители и призеры олимпиады будут определены по результатам очного этапа, который пройдет 1 марта 2020 года на базе МФТИ, МГТУ им. Н.Э.Баумана, а также на других региональных площадках по всей России, о которых будет сообщено позднее. [cut] <br/> ## Этапы соревнования #### Ознакомительные раунды Перед кажды...
сфере. Проект объединяет такие чемпионаты как Russian AI Cup, ML Boot Camp, RussianCode Cup, Russian

Full text and comments »

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

138.
By ruzana.miniakhmetova, 13 years ago, translation, In English
ABBYY Cup 3.0. Solutions Dear all, ABBYY Cup 3.0 online-part is over! Thank you for participating! We are sorry for inconveniences with testings. [user:MikeMirzayanov,2013-06-12] has informed us about plans to buy new testing machins. So we hope that there won't be such cases in the future. Solutions are the following: [Problem "Special task"](http://codeforces.me/contest/316/problem/A1) It was one of the easiest problems in the contest. A solution consists of considering several cases. The initial answer equals one. Firstly, let’s note that if there is a "?" in a string, so the number of every possible codes increases in 10 times. With the exception when "?" is at the beginning if a string so the number of every possible codes increases in 9 times. Next let’s consider the case when the letters are found in the strings. There are two cases here: <li> The first symbol of the string is not a letter. So one should multiply the answer by number of the arrangements of $10$ figures for the number...
ABBYY Cup 3.0. Solutions, Dear all, ABBYY Cup 3.0 online-part is over! Thank you for participating! We are sorry for

Full text and comments »

Tutorial of ABBYY Cup 3.0
139.
By nifeshe, 10 months ago, In English
Codeforces Round 1073 (Div. 1, Div. 2) Editorial Special thanks to [user:reirugan,2026-01-17], [user:weirdflexbutok,2026-01-17] and [user:intellegent,2026-01-17] for helping with editorials. [problem:2191A] - Idea: [user:nifeshe,2026-01-17] - Solution: [user:nifeshe,2026-01-17] - Editorial: [user:reirugan,2026-01-17] <spoiler summary="Hints"> <spoiler summary="Hint 1"> Without the "after sorting condition", there are only two ways to color the cards. </spoiler> </spoiler> <spoiler summary="Solution"> Without the "after sorting condition", there are only two ways to color the cards. We must have that $a$ is alternating in color. Without loss of generality, color the odd indices red and the even indices blue. This uniquely colors every card. Now, let's sort the array $a$, while also keeping track of the colors; one way to do this is by sorting it as a vector of pairs. Then we simply have to verify that no two adjacent cards are the same color. Alternatively, you can use the fact that $a$ is a permutation, ...
="Code"> ~~~~ #include using namespace std; void solve() { int n; cin

Full text and comments »

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

140.
By RussianCodeCup, 11 years ago, In Russian
Russian Code Cup 2015, Отборочный тур — разбор задач <h2>Благодарности</h2> Прежде чем перейти к разбору задач, мы хотели бы поблагодарить всех, кто помогал делать отборочные раунды Russian Code Cup. Руководитель подготовки задач Андрей Станкевич [user:andrewzta,2015-06-15] Члены жюри, авторы и разработчики задач: <ul> <li>Виталий Аксенов [user:Aksenov239,2015-06-15] <li>Артем Васильев [user:VArtem,2015-06-15] <li>Николай Ведерников [user:Niko,2015-06-15] <li>Илья Збань [user:izban,2015-06-15] <li>Георгий Корнеев <li>Анна Малова <li>Борис Минаев [user:qwerty787788,2015-06-15] <li>Дмитрий Филиппов [user:DimaPhil,2015-06-15] <li>Григорий Шовкопляс [user:GShark,2015-06-15] </ul> Координатор разборов Виталий Аксенов [user:Aksenov239,2015-06-15] Прорешивали раунды: <ul> <li>Антон Банных [user:anton.bannykh,2015-06-15] <li>Адам Бардашевич [user:subscriber,2015-06-15] <li>Роман Елизаров [user:elizarov,2015-06-15] <li>Владислав Исенбаев [user:winger,2015-06-15] <li>Геннадий Короткевич [user:tourist,2015-06-15] <li>...
Russian Code Cup 2015, Отборочный тур — разбор задач, очереди, можно отвечать на запрос типа 3 за O(2k): ответ на него положителен, помогал делать отборочные раунды Russian Code Cup. Руководитель подготовки задач Андрей Станкевич, превышать 106·sqrt(103)=107.5.

Full text and comments »

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

141.
By E869120, 7 years ago, In English
My winning theory in IOI 2018 & 2019 — Why I won 2 golds in IOI Dear Codeforces community.<br /> According to [IOI 2019 Results](http://stats.ioinformatics.org/results/2019), I got the 25th place and got successful gold medals twice in a row.<br /> Although it was pretty close to the gold-medal border (only 6.14pts / 600 difference) and it was lower performance than IOI 2018, which I participated when I was orange in Codeforces, I had many chances to get more points in this IOI, even for top 10. Since there are not so many people who have got two gold medals in IOI (and there were many requests like "I want [user:E869120,2019-08-14] to talk about how to get gold in IOI" like [this comment](https://codeforces.me/blog/entry/66909?#comment-510127) and [this comment](https://codeforces.me/blog/entry/66909?#comment-513129)). I want to write something about IOI, which may be useful for people who will participate in IOI next year and also some years later.<br /> ![ ](https://i.ibb.co/TLmqRRX/E869120-IOI-01.png)<br /> <br /> ### A. First of all At...
Informatics (BOI)](https://oj.uz/problems/source/40), [info(1) cup ](https://oj.uz/problems/source/319

Full text and comments »

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

142.
By RussianCodeCup, history, 11 years ago, translation, In English
Russian Code Cup 2016 — Going International Hi! We are pleased to announce that in 2016 Russian Code Cup goes international! Problems will be available in two languages: Russian and English, everyone is welcome to participate! Championship rules and time table will be announced next week, meanwhile we would like to invite you to take part in Warm Up round on [Saturday, April 23, 18-00 Moscow Time (UTC+3)](http://www.timeanddate.com/worldclock/fixedtime.html?msg=Russian+Code+Cup+Warmup+Round&iso=20160423T18&p1=166&ah=2). Register at http://russiancodecup.ru and participate! Good luck and see you at Russian Code Cup 2016!
Russian Code Cup 2016 — Going International, ://www.timeanddate.com/worldclock/fixedtime.html?msg=Russian+Code+Cup +Warmup+Round&iso=20160423T18&p1=166&ah=2, Hi! We are pleased to announce that in 2016 Russian Code Cup goes international! Problems will

Full text and comments »

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

143.
By RussianCodeCup, 10 years ago, translation, In English
Russian Code Cup 2017 — Announcement Hi, everyone! We are pleased to announce Russian Code Cup 2017! Qualification rounds will start in April, the Final round will be held online in September. Each of the three Qualification rounds will allow 200 participants to qualify for Elimination round, top 50 from Elimination round will proceed to Final round. The problems will be both in Russian and in English. The full schedule of the tournament can be found at http://russiancodecup.ru, you can also register there. Note that you must register for the new season even if you took part in the previous tournaments. We still have more than two weeks before the first Qualification, so we would like to invite everyone to the warm up round that will take plance on [Sunday, March 19, 14-00 Moscow time](https://www.timeanddate.com/worldclock/fixedtime.html?msg=RCC+2017+Warmup&iso=20170319T14&p1=166&ah=2). Visit http://russiancodecup.ru to take part in the round, it will be 2 hours long. Good luck to everyone and see you at Russ...
Russian Code Cup 2017 — Announcement, Russian Code Cup 2017 — Анонс, contest the waiting time in most cases was limited to 2-3 minutes. We will make sure there would be no, середины тура задержки уже не должны превышать 2-3 минут. Мы не допустим образования очередей в, Hi, everyone! We are pleased to announce Russian Code Cup 2017! Qualification rounds will start, Всем привет! Мы рады представить Russian Code Cup 2017! Отборочные раунды начнутся в апреле, а

Full text and comments »

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

144.
By CodemastersIntl, history, 3 years ago, In Russian
Завтра заканчивается регистрация на Codemasters Code Cup Завтра, 9 сентября, в 23.59 регистрация на Всероссийский турнир по программированию среди студентов Codemasters Code Cup будет закрыта. Утром 10 сентября начнется отборочный тур. Турнир проводится по двум трекам: Спортивное программирование и Разработка бизнес-приложений. На отборочном этапе можно принять участие в двух треках, в финале нужно будет выбрать только один трек​. Все задания как отборочного раунда, так и финала, рассчитаны на индивидуальное выполнение. Подать заявку на участие в Codemasters Code Cup можно до 23.59 9 сентября на сайте [www.codecup.online](www.codecup.online). ![ ](/predownloaded/eb/6d/eb6d1752aca10f78fcc457b6cf5a7e088d1506f9.jpg) Отборочное соревнование в треке “Спортивное программирование” будет проходить один день 10 сентября с 11:00 &mdash; 16:00 часов по Москве. Результаты будут объявлены 12 сентября. На выполнение задания в треке “Разработка бизнес-приложений” дается 5 дней. За это время участникам нужно будет реализовать приложение с н...
Завтра заканчивается регистрация на Codemasters Code Cup, Codemasters Code Cup будет закрыта. Утром 10 сентября начнется отборочный тур. Турнир, Призовой фонд Codemasters Code Cup — 360 тысяч рублей. Победители в каждом треке получат 100

Full text and comments »

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

145.
By MikeMirzayanov, 12 years ago, In Russian
VK Cup 2015 — Informational Letter Hi Codeforces! The VK company (vk.com), the largest social network in Europe and the most popular site in Russia and Ukraine, announces the competition for russian-speaking programmers VK Cup 2015. As you can see, the reborn VK Cup is focused on Russian-speaking programming lovers. Indeed, the whole VK developer team speaks Russian, most social network users communicate in Russian and the head office of the company is located in St. Petersburg. Those are the reasons we decided to concentrate on the competition for russian-speaking participants &mdash; most of the social network code is written by medal winners and ACM-ICPC finals champions. We believe that when we support the enthusiasm of young people towards solving problems and studying algorithms, that we make the world better and invest for the future of our company. That is not the only innovation of the championship: unlike many other championships conducted by companies, VK Cup 2015 will have two-man teams competing ...
VK Cup 2015 — Informational Letter, popular site in Russia and Ukraine, announces the competition for russian-speaking programmers VKCup

Full text and comments »

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

146.
By radoslav11, history, 8 years ago, In English
Bubble Cup 2018 Round 2 — Neo Hello! Bubble Cup 2018 Round 2 just finished, so I decided to ask about a correct solution problem [NEO](http://www.spoj.com/problems/NEO2/). I guess a lot of people passed it in $\mathcal{O}(N^2)$ with the C++ pragma optimizations or with some greedy optimizations. My team also passed it like that. In this blog I'll share my idea. If someone has solved it in a similar way I will really appreciate if he shares his code because honestly the idea is really annoying to implement. If anyone has another solution, which is better than $\mathcal{O}(N^2)$ I will really love to know the idea. So the solution I had in mind is $\mathcal{O}(N \log^2 N)$ or $\mathcal{O}(N \log^3 N)$ depending how we implement our query. First we will have the standard DP: $dp_i = \max_{j<i}(dp_j + sum_i*i + sum_j*j-j*sum_i-i*sum_j )$ which can be reformed to $dp_i = sum_i*i + \max_{j<i}((dp_j+sum_j*j) + (-j*sum_i) +(-i*sum_j) )$. Well we can still reform this equation the the following: $dp_i = sum_i*i + \...
Bubble Cup 2018 Round 2 — Neo, Hello! Bubble Cup 2018 Round 2 just finished, so I decided to ask about a correct solution

Full text and comments »

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

147.
By Ashu_Aditya, 10 months ago, In English
Inter Campus Algorithmic Cup, ICAC — 2026 | Registrations Open!! Hello everyone! We, [Google Developers Groups &mdash; KIET](https://gdg.community.dev/gdg-on-campus-kiet-group-of-institutions-ghaziabad-india/), are excited to invite you to our upcoming event ICAC-2026, a competitive programming contest. ![ICAC](/predownloaded/30/8f/308f87a920e9b3370f5eccd1709e273d872d1892.jpeg) ICAC isn't just a programming contest -it's a full scale battlefield where logic becomes your weapon, speed becomes your shield, and precision decides your fate. Gear up for an adrenaline charged showdown where only the sharpest minds survive the grind. Step into the arena to crack brutal problems, outsmart rival teams, and race against the clock as every second pulls you closer to victory or elimination. Whether you're a seasoned warrior of code or a rising contender hungry for glory, ICAC is your moment to rise, dominate, and etch your name onto the leaderboard. Think fast. Code faster. Escape the Upside Down. Because only your strongest make it back. **Regist...
Inter Campus Algorithmic Cup, ICAC — 2026 | Registrations Open!!, closer to victory or elimination. Whether you're a seasoned warrior of code or a rising contender

Full text and comments »

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

148.
By Error_Yuan, history, 2 years ago, In English
Refact.ai Match 1 (Codeforces Round 985) Editorial Thank you all for participating in the round! We apologize for the wrong checker in problem E at the beginning of the contest, as well as the weak tests in problem B. To be honest, all the hacked submissions have similar logic and codes in B, which made me suspicious. Anyway, we are sorry for the inconvenience! >_< <spoiler summary="Rating Predictions"> | |A|B|C|D|E|F|G|H|I| |:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:| |[user:Error_Yuan,2024-11-7]|800|1200|**1600**|**2100**|**2300**|2600|**3000**|3400|**3500**| |[user:sszcdjr,2024-11-7]|800|1100|1600|2000|2300|**2600**|2900|**3300**|3500| |[user:wyrqwq,2024-11-7]|800|**1000**|1400|2200|**2300**|2600|**3000**|3500|3500| |[user:Otomachi_Una,2024-11-7]|**800**|1000|1600|2200|2400|2600|3200|3500|3500| |[user:dxqwq,2024-11-7]|900|1100|1700|2200|2400|2600|3200|3500|3500| |[user:Kubic,2024-11-7]|800|1000|1600|2400|2200|2800|3000|3500|3300| |[user:wsc2008qwq,2024-11-7]|800|1100|1600|1900|2200|2700|3100| | | |[user:chroma...
--) { solve(); } } ``` ```python for

Full text and comments »

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

149.
By Aksenov239, 14 years ago, In Russian
Russian Code Cup 2012 QR 3 Здравствуйте! Приглашаю поучаствовать в третьем и последнем квалификационном раунде [Russian Code Cup](http://russiancodecup.ru), который пройдёт в ближайшее воскресенье --- 10 июня. Естественно допускаются все желающие, кроме тех, кто уже прошёл в следующий раунд. Не забудьте зарегистрироваться. А то последний розыгрыш футболок "Russian Code Cup 2012" пройдёт мимо вас. И да пройдут сильнейшие из вас! Удачи! И да покорятся вам эти великолепные задачи с лёгкостью, и да поимеете вы удовольствие с этого раунда. P.S.: Выложен официальный разбор задач --- http://russiancodecup.ru/round/8/analysis. **P.S.: [Видео-разбор](http://www.youtube.com/playlist?list=PL3D51A4AE43BA53D4&feature=plcp), сделан с помощью телефона [user:andrewzta,2012-06-10].**
Russian Code Cup 2012 QR 3, Code Cup](http://russiancodecup.ru), который пройдёт в ближайшее воскресенье --- 10 июня. Естественно, Не забудьте зарегистрироваться. А то последний розыгрыш футболок "Russian Code Cup 2012" пройдёт, Приглашаю поучаствовать в третьем и последнем квалификационном раунде [Russian Code Cup](http

Full text and comments »

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

150.
By CodemastersIntl, history, 3 years ago, In Russian
До окончания регистрации на Codemasters Code Cup осталось 5 дней **10 сентября стартует отборочный онлайн-раунд Всероссийского турнира Codemasters Code Cup. Финал состоится 28-29 сентября 2023 года в Туле.** Турнир проводится по двум трекам: Спортивное программирование и Разработка бизнес-приложений. На отборочном этапе можно [принять участие](https://www.codecup.online/#registration) в двух треках, в финале нужно будет выбрать только один трек​. Все задания как отборочного раунда, так и финала, рассчитаны на индивидуальное выполнение. ![ ](/predownloaded/45/b2/45b23405ff2cb44698622b049cffd2ff42daa215.jpg) Отборочный раунд будет проходить онлайн, поэтому [принять участие](https://www.codecup.online/#registration) в Турнире могут студенты любого российского вуза. Для участия в Codemasters Code Cup уже зарегистрировались учащиеся таких вузов как МГУ им. Ломоносова, ТулГУ, Сколтех, СТАНКИН, МАИ, ЛЭТИ, МИСИС, МФТИ, ИТМО, РТУ МИРЭА, МТУСИ, НИУ ВШЭ, МГУ им. Огарева, МТУСИ, СПбГУ и пр. География турнира &mdash; от Владивостока до Санкт-Петербурга....
До окончания регистрации на Codemasters Code Cup осталось 5 дней, **10 сентября стартует отборочный онлайн-раунд Всероссийского турнира CodemastersCode Cup. Финал, Призовой фонд Codemasters Code Cup — 360 тысяч рублей. Победители в каждом треке получат 100

Full text and comments »

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

151.
By phpduke, history, 13 months ago, In English
[Guide] Meta HackerCup AI Meta HackerCup is unique, as it is the only place as far as I know that allows anyone to compete their AI models against top human competitors live! Without a lot of introductory blogs on how to get started competing in AI track, it becomes daunting to start & hence this blog. Received a dozen messages asking how we built a winning solution to last year's Meta Hacker Cup, will write separate post on that maybe. A lot has changed from last year to this, thinking models are already very good at competitive programming model out of the box. This is good because it lowers bar of entry participation while pushing bar for creating a differentiated top solution. Goal of contest is to build an automated system that generates solution to competitive programming problems WITHOUT any human intervention. That is you cannot nudge/hint your AI system leveraging your human intuitions. Anatomy of a typical solution ============================= A lot of the solutions/ideas can be dissect...
messages asking how we built a winning solution to last year's Meta Hacker Cup , will write separate post

Full text and comments »

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

152.
By suncup224, history, 4 years ago, In English
What will happen to Google Code Jam this year? Since the layoff announcement, the Google Code Jam and Kickstart contest pages have been changed to say that the registration has been delayed. Layoffs are definitely difficult times for everyone and the company, but I just want to say that Google Code Jam is a milestone contest for me each year. I do competitive programming for a hobby (I don't work in a technical role or industry) and I practice regular to do better at subsequent year's Code Jam competitions. I hope everyone will get to share in the excitement of CP by competing in one of the largest contests of each year. (Hopefully Meta Hacker Cup will continue this year!) **Update**: Google will be discontinuing all its competitions. This is literally a shock to me as I that they would just suspend for a year or two. While I came on CP only around late 2020 as a new lockdown hobby, I still managed to make some bittersweet memories of competing on Google Code Jam and Kickstart. I still remember taking part in my first Kic...
What will happen to Google Code Jam this year?, Since the layoff announcement, the Google Code Jam and Kickstart contest pages have been changed to

Full text and comments »

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

153.
By defnotmee, history, 4 years ago, In English
Brazilian Bizarre Adventures at the TST Hello codeforces! I was reminiscing about the brazilian TST that just happened and figured it was way too crazy not to share with everyone how it went. So as a follow up to [this blog](https://codeforces.me/blog/entry/109950) I'll be going through my experiences at the event. Get ready for a ride, because this is gonna be a long one. Day of Arrival: Coming out of the closet ------------------ The people of my school all gathered in a bus to go to the hotel we were staying at. That bus made a beeping noise every time we passed 90 km/h, and considering we were travelling at night, we were hearing that noise way too often! While in the ride, I stole [user:LFFB_,2022-12-11]'s laptop and started playing Osu on it. Even though I was playing on the touchpad and the bus was bumping around, I was able to clutch out an S on "Pepsi Man", which was quite a challenge despite being on relax mode. ![ ](https://media.discordapp.net/attachments/1049687529298866216/1051480070755201107/indi...
Code while still inside the bus. Arriving at the hotel, they got us something to eat and after

Full text and comments »

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

154.
By ko_osaga, history, 4 years ago, In English
[Tutorial] On Range LIS Queries, Part 2 ## Previous article * [On Range LIS Queries. Part 1](https://codeforces.me/blog/entry/111625) ## Chapter 4. Fast algorithm for $\boxdot$ operator We stopped at the point where we learned how to: * Implement the $\boxdot$ operator in $O(N^3)$ time * Use the $\boxdot$ operator for $O(N^2)$ time I actually didn't introduce the name to avoid unnecessary scare, but the [original paper](https://arxiv.org/abs/0707.3619) calls this operator as *unit-Monge matrix-matrix distance multiplication*. Throughout the article, we will call it as the **unit-Monge multiplication (of permutation)** or just $\boxdot$ operator as we did before. Let's see how to compute the $\boxdot$ operator in $O(N \log N)$ time. For a matrix $\Sigma(A), \Sigma(B)$ consider the partitioning $\Sigma(A) = [\Sigma(A)_{lo}, \Sigma(A)_{hi}], \Sigma(B) = \begin{bmatrix} \Sigma(B)_{lo} \newline \Sigma(B)_{hi} \end{bmatrix}$, where $lo$ denotes the first $N/2 + 1$ entries, and $hi$ denotes last $N/2$ entries. We ...
to: * Implement the $\boxdot$ operator in $O(N^3)$ time * Use the $\boxdot$ operator for $O(N^2

Full text and comments »

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

155.
By dacin21, history, 8 years ago, In English
On the mathematics behind rolling hashes and anti-hash tests This blog assumes the reader is familiar with the basic concept of rolling hashes. There are some math-heavy parts, but one can get most of the ideas without understanding every detail. The main focus of this blog is on how to choose the rolling-hash parameters to avoid getting hacked and on how to hack codes with poorly chosen parameters. # Designing hard-to-hack rolling hashes ## Recap on rolling hashes and collisions Recall that a rolling hash has two parameters $(p, a)$ where $p$ is the modulo and $0 \leq a < p$ the base. (We'll see that $p$ should be a big prime and $a$ larger than the size $\left|\Sigma\right|$ of the alphabet.) The hash value of a string $S = s_0 \dots s_{n-1}$ is given by $$ h(S) := \left(\sum\limits_{i=0}^{n-1} a^{n-1-i} s_i\right) \mod p $$ For now, lets consider the simple problem of: given two strings $S, T$ of equal length, decide whether they're equal by comparing their hash values $h(S), h(T)$. Our algorithm declares $S$ and $T$ t...
this bound is slightly worse than the one for randomizing the base. It is around $3 \cdot 10^{-4

Full text and comments »

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

156.
By Aksenov239, 14 years ago, In Russian
Russian Code Cup 2013. Здравствуйте. Уже пришло время анонсировать соревнование [Russian Code Cup 2013](http://russiancodecup.ru). Собственно, на данный момент уже известно расписание раундов (дублирование с официального сайта):<br> Первый квалификационный раунд 2 часа 13 апреля, 19:00 <br> Второй квалификационный раунд 2 часа 11 мая, 12:00 <br> Третий квалификационный раунд 2 часа 2 июня, 14:00 <br> Отборочный раунд 3 часа 16 июня, 14:00 <br> Финальный раунд 3 часа 23 сентября, 11:00 <br> Дальнейшая информация будет выложена позднее. Но несмотря на это, жюри уже начало подготовку. :-)! P.S.: Регистрация уже объявлена открытой. P.S.S.: По поводу технических проблем с регистрацией обращайтесь к [службе-support](http://russiancodecup.ru/feedback/).
Russian Code Cup 2013., Здравствуйте. Уже пришло время анонсировать соревнование [Russian Code Cup 2013](http, Уже пришло время анонсировать соревнование [Russian Code Cup 2013](http://russiancodecup.ru

Full text and comments »

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

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

Full text and comments »

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

158.
By PrinceOfPersia, history, 10 years ago, In English
Codeforces Round #362 (Editorial) [Here](https://gitlab.com/amirmd76/cf-round-362/tree/master) is git repository to solutions of problems of this contest. ### Div.2 A You should check two cases for YES: 1. $x\ mod\ s = t\ mod\ s$ and $t \leq x$ 2. $x\ mod\ s = (t + 1)\ mod\ s$ and $t+1 < x$ ![ ](http://espresso.codeforces.com/72731d179aee0e03fb8a446ab4bb2d2c333953b9.png) Time Complexity: $\mathcal O(1)$ [Codes](https://gitlab.com/amirmd76/cf-round-362/tree/master/2A) ### Div.2 B Nothing special, right? just find the position of letters `.` and `e` with string searching methods (like `.find`) and do the rest. ![ ](http://espresso.codeforces.com/67436d52032041dc54647c27e506f956e344f5cb.png) Time Complexity: $\mathcal O(n)$ [Codes](https://gitlab.com/amirmd76/cf-round-362/tree/master/2B) ### A Do what problem wants from you. The only thing is to find the path between the two vertices (or LCA) in the tree. You can do this in $\mathcal O(lg(n))$ since the height of the tree is...
. Here's a code for LCA: ~~~~~ LCA(v, u): while v != u: if depth[v

Full text and comments »

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

159.
By SlavicG, history, 4 years ago, In English
[Tutorial] Finding N bits using O(N / log(N)) sums ### Introduction Hi everyone, because we noticed there was no good tutorial in English explaining this idea, [user:KrowSavcik,2022-07-23] and I have decided to write a tutorial blog on it! This idea finds the values of each element from a binary array using $O(N / log(N))$ sum queries, more specifically it solves problems of the type: Given a binary array $b$ (an array consisting only of zeroes and ones) of $n$ elements, you can ask queries of the following format: What is the sum of the subsequence of the values on positions: $p_1, p_2, ..., p_k$. In other words you will give the subsequence $p_1, p_2, ..., p_k$ to the interaction and it will return you the value of ($b_{p_1} + b_{p_2} + ... + b_{p_k}$). And after asking $O(N / log(N))$ queries we should be able to tell the value of each index. The technique was mentioned [here](https://codeforces.me/blog/entry/82924) too but it was not as detailed and not easy to find. ### Concept The idea is to use a divide...
**non last** query in $S_{k_1}$ and $S_{k_2}$. First one is $S_{k_1}[i] \cup S_{k_2}[i]$. Second one

Full text and comments »

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

160.
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...
,1] - Average round: - Bad round: - Horrible round: [likes:all,4

Full text and comments »

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

161.
By abhijeetballabh_23, 7 months ago, In English
CodeBlitz — A Blitz-Style Duelling Platform for Competitive Programming Hi everyone, Over the past few months, I’ve been working on something I personally felt was missing in competitive programming: **A duelling experience based on the Codeforces Blitz Cup matches format.** No waiting for contests, just challenge someone and compete in code. Today, I bring to you **[CodeBlitz](https://codeforces-blitz.vercel.app/)** &mdash; an arena for real-time head-to-head competitive coding battles. What is CodeBlitz? ------------------ CodeBlitz is a real-time competitive coding arena where you can: - Challenge friends or rivals instantly - Play short, high-intensity matches within flexible rating ranges - Solve Codeforces problems under pressure - Compete through a dedicated rating system ![ ](/predownloaded/4b/0f/4b0f3922c65e15dbf8d56ba2fbc3d4ede4100940.png) How a Match Works? ------------------ 1. Create a room (rated or unrated) 2. Share a 6-digit join code or send invite to a friend 3. Both players hit Ready 4. Match starts with a s...
. Share a 6-digit join code or send invite to a friend 3. Both players hit Ready 4. Match starts with a

Full text and comments »

162.
By Aksenov239, 13 years ago, In Russian
Russian Code Cup 2013 QR3 Здравствуйте, друзья. Приглашаем всех тех, кто не прошёл/забыл/проспал/что-то иное, поучаствовать в третьем и последнем в это году квалификационном раунде за право участвовать в отборочном раунде. Собственно, состоится он в это воскресенье (2 июня) в [14:00 по Москве](http://www.timeanddate.com/worldclock/fixedtime.html?msg=Russian+Code+Cup+QR+3&iso=20130602T14&p1=166&ah=2) и будет длиться стандартные 2 часа. Всем удачи! Пока!
Russian Code Cup 2013 QR3, /worldclock/fixedtime.html?msg=Russian+Code+Cup+QR+3 &iso=20130602T14&p1=166&ah=2) и будет длиться, ?msg=Russian+Code+Cup+QR+3&iso=20130602T14&p1=166&ah=2) и будет длиться стандартные 2 часа.

Full text and comments »

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

163.
By Arpa, history, 4 years ago, In English
Ten years of Competitive Programming Hey Codeforces! I’m AmirReza PourAkhavan, Codeforces Contest Coordinator. I let the story become complete and I’m sharing it now. The story is about a 16-year competitive programmer, who left his family and migrated to another city alone to follow competitive programming. After seven years, he advanced to the International Collegiate Programming Contest World Finals, twice. ### Why I’m writing this Six years ago someone asked me [here](https://codeforces.me/blog/entry/45186?#comment-297837) to write my story. I think it can help you to never give up. ### A brief about me I've been doing competitive programming for ten years. I advanced to ICPC (International Collegiate Programming Contests) World Finals twice, in 2019 at Porto and 2020 at Moscow. At ICPC World Finals 2020, our team took high-honored place twenty-four, which is equal to the top 0.03% of 200k students participating in ICPC. <center> <br> <img width="50%" src="/predownloaded/c2/0c/c20c501bba688...
received a simple big cup with the HelliNet logo. It was nice for me. 9th grade === In the

Full text and comments »

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

164.
By cry, 3 years ago, In English
Codeforces Round 887 (Div 1, Div 2) Tutorial We hope you enjoyed these problems :) This contest has been in the works for almost a year. <spoiler summary = "About the Authors"> This round was mostly made possible by problemsetters from the [CerealCodes](https://www.cerealcodes.org/) initiative! CerealCodes is an organization based in the United States dedicated to running high quality competitive programming contests. You can check out our previous contest [here](https://codeforces.me/gym/103886). </spoiler> **UPD: D1D Editorial have been updated** **UPD 2: D1D Editorial now has images by [user:EmeraldBlock,2023-08-01]. As an apology gift for being so slow, the image generator is programmatic and available [here](https://artofproblemsolving.com/texer/codeforces).** #### [problem:1853A] Problem Credits: [user:buffering,2023-06-02] Analysis: [user:buffering,2023-06-02] <spoiler summary="Hint 1"> To make $a$ not sorted, we just need to pick one index $i$ so $a_i > a_{i + 1}$. How do we do this? </spoiler...
can just output $0$. The time complexity is $O(n)$.

Full text and comments »

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

165.
By balbit, history, 5 years ago, In English
Let's Solve Some More Hard Problems! Inspired by ivan100sic's [problem list blog](https://codeforces.me/blog/entry/98630), I'll pick 10 nontrivial-seeming recent POI (Polish Olympiad in Informatics) problems that I haven't solved and track my progress here. It seems to me that POI is better suited for this format as their editorials are quite difficult to find (if possible [at all](https://szkopul.edu.pl/problemset/problem/v2Y2_UW56ENMcbwP22tkTb7a/site/?key=statement)). While Ivan's original challenge was supposed to last an entire year, I'm not nearly as patient, so I won't look for editorials only until February 1st (in just over 2 weeks). Hopefully I'll have completed at least 80% by that time. Until then, GLHF!!! The List: 1. [Multidrink 2013](https://szkopul.edu.pl/problemset/problem/GyDCbdIgFY5FsMa9iIsBl3hf/site/?key=statement) [Solved Jan 15] <spoiler summary="Fun-ness:"> 5/10 <spoiler summary="Comments"> My thought process on this problem went like "ew this is disgusting implementation" => ...
you have it written out.

Full text and comments »

Tags pow, odz, eni, abh, ai
  • Vote: I like it
  • +149
  • Vote: I do not like it

166.
By RussianCodeCup, 9 years ago, translation, In English
RCC 2017 — Финал + трансляция на CF Всем привет! [10 сентября 2017 года, в 13:00 по московскому времени](https://www.timeanddate.com/worldclock/fixedtime.html?msg=RCC+2017+Finals&iso=20170910T13&p1=166&ah=3) состоится финал Russian Code Cup 2017! Раунд продлится 3 часа. 55 участников финального раунда сразятся за призы, и мы все с нетерпением ждем возможности поболеть за них на сайте http://russiancodecup.ru. Ну а для всех остальных участников мы подготовили сюрприз: если вы хотите попробовать свои силы в решении задач, приходите на codeforces.com после финала, [в 16:35 по московскому времени](https://www.timeanddate.com/worldclock/fixedtime.html?msg=RCC+2017+Finals+CF+Round&iso=20170910T1635&p1=166&ah=3) состоится раунд по задачам RCC 2017, открытый для всех желающих. Несколько уточнений: - Раунд пройдет по правилам ACM; - Раунд будет нерейтинговым; - Сложность задач будет близка к Div 1 раунду; - Мы просим участников финала после окончания официального соревнования воздержаться от публикации и обсужде...
/fixedtime.html?msg=RCC+2017+Finals&iso=20170910T13&p1=166&ah=3) состоится финал RussianCode Cup 2017, /worldclock/fixedtime.html?msg=RCC+2017+Finals&iso=20170910T13&p1=166&ah=3) the final round of RussianCode, ?msg=RCC+2017+Finals&iso=20170910T13&p1=166&ah=3) the final round of Russian Code Cup 2017 will take, Code Cup 2017! Раунд продлится 3 часа. 55 участников финального раунда сразятся за призы, и мы все

Full text and comments »

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

167.
By Nickolas, 15 years ago, translation, In English
VK Cup 2012 Wild-card Round 1: editorial So here goes the editorial. Note that Factor allows pretty random codes, feel free to put all words in one line, but all words must be separated by at least one space, don't try to skip a space between a bracket and a word or something like that. #### [problem:162A] This problem was almost the same as [problem:130A] from Befunge round. Data input and output is done exactly as in the sample code, and besides them the program needs only basic stack operations. ~~~~~ USING: io kernel math math.parser ; readln string>number dup 3 * 1 - * 2 / number>string print ~~~~~ Factor has a very system of built-in libraries which liberate the programmer from solving a lot of basic routine tasks. So after the first (trivial) probllem I gave several one-liners [cut] which needed only to find a proper library for the task. #### [problem:162B] This problem can be solved in several ways; the shortest one is to use >bin word from math.parser dictionary which does exactly what ...
VK Cup 2012 Wild-card Round 1: editorial, code, and besides them the program needs only basic stack operations. ~~~~~ USING: io kernel

Full text and comments »

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

168.
By Romka, 15 years ago, In Russian
И опять футболки >_< <p>Футболки, футболки, футболки... Футболки разыгрывают все, кому не лень. Каждый месяц на codechef.com, каждый год на Topcoder и Code Jam, в этом году добавились Hacker Cup, Russian Code Cup и Yandex.Algorithm. Футболки раздают в ЛКШ. Футболки дают на АСМ/ICPC (1/4 финала, финал). Участвуя в полуфинале NEERC, можно стать счастливым обладателем футболки от Яндекса, а в прошлом году и от Codeforces. Футболку получает каждый участник Петрозаводских сборов, кроме этого, на последних сборах проводился спонсорский Codeforces Beta Round, за который тоже давали футболки. И это ещё не говоря о различных малоизвестных контестах, таких как, например, <a href="http://www.bitwise.iitkgp.ernet.in/home">Bitwise</a>. Школьникам дают футболки на ВКОШПе, на международной олимпиаде, на белорусской республиканской олимпиаде (не знаю, дают ли на всеросе, не имел возможности в нём поучаствовать). Довольно-таки однообразно, не находите?</p><div>[cut]<br /></div><div><br /></div><div>А теперь ещё и вот, <a h...
codechef.com, каждый год на Topcoder и Code Jam, в этом году добавились Hacker Cup, Russian Code Cup и

Full text and comments »

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

169.
By brycesandlund, 11 years ago, In English
DQed from Google Code Jam Round 3 I competed in Google Code Jam Round 2 last Saturday and managed to get 341st place. Unfortunately, I now sit in 1215th place. What happened was that in my solution to B-large, I encountered a bug after downloading the input file. It wasn't until I had only 40 seconds left on the counter that I found it. I managed to fix it, rerun the program, and upload the output file in that 40 seconds, but I had about 3 seconds to find and upload the source file, among a directory with 200 other files (I'm kicking myself for forgetting to create a new directory for the competition as I usually do). So I double clicked some random file and got the submission in literally as the countdown hit 0. The output was correct, but on Monday, Google informed me that they rejected my submission since I didn't have the proper source file, dropping me to 1215th place. It doesn't look like there is anything I can do at this point, but I wanted to inform the community: Google manually checks every submission! I ...
DQed from Google Code Jam Round 3, : Google manually checks every submission! I pulled something similar in Facebook HackerCup, I competed in Google Code Jam Round 2 last Saturday and managed to get 341st place. Unfortunately

Full text and comments »

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

170.
By JoeyWheeler, 12 years ago, In English
My sad and happy story For Fox Rocks in round 3 of hacker cup I started my timer and went to download the input file but suddenly it disconnected from facebook.com. I was able to successfuly ping google.com but i had 100% packet loss to facebook D:. I screenshoted everything to document what was happening and with just a minute left on the timer it started responding again! I tried downloading the input but I watched as it completely failed to download in time due to an extremely slow connection D:. I submitted a feedback request asking for help and sent my code+the screenshots as proof and it appeared I would be recieving a manual judgement! :D Soon after the contest though I recieved the judgement that my soln was incorrect on a few cases D: After correct code was accessible I compared my output to Gleb's to find my bug but my soln gave the same results (withing 2e-6) so I also compared to Anta's output with the same result. :S I sent off another email explaining this and a while ago recieved ...
For Fox Rocks in round 3 of hacker cup I started my timer and went to download the input file but

Full text and comments »

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

171.
By Hohol, 14 years ago, In Russian
Мое выступление на Russian AI Cup Расскажу о своем участии в Russian AI Cup. Когда мы прочитали объявление о начале конкурса, первая реакция была: "Опять саратовские танки! Сколько можно-то?". Кто не в курсе &mdash; объясняю. Организаторы Russian AI Cup &mdash; Одноклассники и Саратовский Государственный Университет. На четвертьфинале ACM ICPC в Саратове каждый год проходит неофициальный игровой конкурс Code Game Challenge. Суть все та же &mdash; напишите бота, который всех порвет. И хотя боты оказываются то волшебниками в шляпе и с посохом, то гоночными автомобилями, то суднами на воздушной подушке &mdash; мы всегда звали их танчиками. Наша команда успела поучаствовать в CGC аж 5 раз, и конкурс особого энтузиазма у меня поначалу не вызвал. Но познакомившись с правилами поближе, решил, что все-таки конкурс мне все же интересен. Привлекали следующие пункты: 1. Большая чем обычно была в CGC сложность игрового мира. Гусеницы танка управляются по-отдельности. Башня движется отдельно от корпуса. Объекты мира ...
Мое выступление на Russian AI Cup, Расскажу о своем участии в Russian AI Cup. Когда мы прочитали объявление о начале конкурса

Full text and comments »

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

172.
By MikeMirzayanov, history, 8 years ago, In Russian
Технокубок 2019 — олимпиада по программированию для школьников <img src="//assets.codeforces.com/images/tk-banner-2019.png"/> Mail.Ru Group совместно с МФТИ, МГТУ им. Н. Э. Баумана и Codeforces в четвертый раз запускает «Технокубок» — олимпиаду по программированию для школьников. В прошлом учебном году олимпиада вошла в перечень олимпиад школьников, повысив свой уровень до второго — круг учебных заведений, дающих льготы победителям и призерам, значительно расширился. Лучшие участники получат ценные призы от компании Apple. Сразиться за звание самого талантливого молодого программиста приглашаются учащиеся средних образовательных учреждений 8-11 классов. Победители и призеры олимпиады будут определены по результатам очного этапа, который будет проведен 3 марта 2019 года на базе МФТИ, МГТУ им. Н.Э.Баумана, а также на других региональных площадках по всей России, о которых будет сообщено позднее. [cut] <br/> ## Этапы соревнования #### Ознакомительные раунды Перед каждым отборочным раундом проходит двухдневный ознакомительный рау...
Russian AI Cup, ML Boot Camp, Russian Code Cup, Russian Design Cup, и другие, а также тесно

Full text and comments »

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

173.
By Koo_Pung-Kei, 20 months ago, In English
Codeforces Round 1012 (Div. 2) Amateur Selfmade Editorial for ABCD > Read before: > This blog should be just taken as a witness of my progressions as well as ideas to inspire readers and will inevitably feature bad-looking code styles or non-best solutions. Better solutions to problems mentioned in the blog are welcome in your readers' comments. > All codes in this blog can be compiled in Java. Hello, Codeforces! The Tsinghua University buddies have fought back against the failure of the based-on-Zhili-Cup [contest:2082], accompanied by a brand new rated [contest:2090] which was held on [contest_time:2090]. Having taken the round as the only chance to establish an academic link with the top college in mainland China throughout my lifetime as a Chinese resident <i style="color:#ddd"><s>again</s></i>, I struggled out of my noon break to take the meaningful challenge. This blog is an editorial that will show my understanding of 3 problems of the 8 (or 6 if taking the 2 subtasks as 1) in the contest and the corresponding code blocks for so...
to inspire readers and will inevitably feature bad-looking code styles or non-best solutions

Full text and comments »

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

174.
By huangzirui, history, 4 years ago, In English
Editorial of Codeforces Round 796 [problem:1688A] Idea: [user:huangzirui,2022-06-03]. Solution: [user:huangzirui,2022-06-03]. Preparation: [user:huangzirui,2022-06-03]. Good problem Average problem Bad problem Did not solve <spoiler summary="Hint"> Consider $x=2^k$ and $x\ne 2^k$ separately. </spoiler> <spoiler summary="Solution"> Let $p_i$ be the $i$-th bit of $x$, $q_i$ be the $i$-th bit of $y$ (both indexed from $0$). $x\ \texttt{and}\ y > 0\Leftrightarrow \exists i,\ p_i= q_i = 1$. $x\ \texttt{xor}\ y > 0\Leftrightarrow \exists i,\ p_i\ne q_i$. To satisfy the first condition, find the minimum integer $k$ satisfying $p_k=1$, and assign $1$ to $q_k$. If $x\ne 2^k$, the second condition is satisfied now. Otherwise, find the minimum integer $j$ satisfying $p_j=0$, and assign $1$ to $q_j$. The time complexity is $O(1)$. </spoiler> <spoiler summary="Code (C++)"> ```cpp #include<bits/stdC++.h> ...
complexity is $O(1)$. ```cpp #include

Full text and comments »

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

175.
By Misuki, 2 years ago, In English
Editorial of Codeforces Round 967 (Div. 2) Except hints/solutions, I try to add a "general idea" section discuss about some general strategy and standard ideas used to solve the problem, hope you would like it :) [problem:2001A] idea & solution: [user:Misuki,2024-08-20] <spoiler summary="Hint 1"> What's the most obvious lower bound of the answer? </spoiler> <spoiler summary="Hint 2"> Is the lower bound achievable? </spoiler> <spoiler summary="General idea"> One standard way to solve optimization problem is to make observation on lower(upper) bound of the answer and prove such bound is achievable, it's useful in lot of problems. </spoiler> <spoiler summary="Solution"> Let $x$ be one of the most frequent elements in $a$, then the answer must be at least $(n - \text{frequency of } x)$, and this lower bound is always achievable by keep erasing a non-$x$ element from $a$, and we can prove it's always possible to do so. proof: If all elements of $a$ are $x$, we are done. Otherwise, let $y$ denote ...
, ..., 4, 5, 2, 3, 1\}$). ~~~~~ #include

Full text and comments »

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

176.
By errorgorn, 5 years ago, In English
[Tutorial] Knapsack, Subset Sum and the (max,+) Convolution **Edit**: I have realized that this blog has been sent quite a lot on discord servers, so I am adding a content page at the start to help organize this blog better. ## Prerequisites Let us first define the classical knapsack, unbounded knapsack and subset sum problems. #### Subset Sum There are $N$ items. The $i$-th item has weight $w_i$. Find a set $S$ such that $\sum\limits_{i \in S} w_i = C$. #### Knapsack There are $N$ items. The $i$-th item has weight $w_i$ and value $v_i$. Find a set $S$ such that $\sum\limits_{i \in S} w_i \leq C$ and $\sum\limits_{i \in S} v_i$ is maximized. #### Unbounded Knapsack There are $N$ items. The $i$-th item has weight $w_i$ and value $v_i$. Find a **multiset** $S$ such that $\sum\limits_{i \in S} w_i \leq C$ and $\sum\limits_{i \in S} v_i$ is maximized. You should know how to do both versions of knapsack in $O(NC)$ and subset sum in $O(\frac{NC}{32})$ before reading this blog. In this blog post, I will just show some res...
sum of weights less than $C$. We can solve it in $O(DC)$. | | Knapsack Speedup 3 | Suppose $w

Full text and comments »

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

177.
By Konjac, 12 years ago, In English
[Spoiler Alert!!!] Hints for Crypto Cup 1.0 Really a funny contest. Hope for more. Here are some hints. #### Problem A RSA #### Problem B Case #1 ~~~~~ c..r..h .h..z.. ..a..e. ~~~~~ #### Problem C msg[i] = (26 + cipher[i]-cipher[i-1] ) mod 26 + 'a' #### Problem D The first character is Z/O we guess it means zero or one. Z,1,2,3,2,1,2,1,1,4,2,4,1,1,3,2,1,2,4,1,1,2,2,2,1,1,1,1,2,1,1,3 Means start with zero, we have 1 zero then 2 ones, 3 zeros, 2 ones, 1 zero … The last step is the same to Problem I. #### Problem E Morse code. #### Problem F 2715 seems like base 27 and base 15. 26 letters in base 27 and 15 letters in base 15. Maybe the 26 letters are 1-26 instead of 0-25. #### Problem G brute force + search + good luck. Some online anagram websites will be helpful. ps: The answer may not be unique? For example, "yvuoedloreoic" could both be "I love your code" or "I love you coder". But the system test only accept "I love you coder". #### Problem H 26 integers in first line...
[Spoiler Alert!!!] Hints for Crypto Cup 1.0, have 1 zero then 2 ones, 3 zeros, 2 ones, 1 zero … The last step is the same to Problem I

Full text and comments »

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

178.
By lightning_mcqueen, history, 12 months ago, In English
Weak test cases in meta hacker cup round 2 problem B Problem B has weak test cases. <spoiler summary="Spoiler"> ~~~~~ def check(arr,brr,mid,d): count = 0 count2 = 0 for i in range(mid): count += d[arr[i]]*(mid- i) count2 += d[arr[i]] prev = 0 count3 = 0 j = mid -1 for i in range(len(brr)-1,-1,-1): if brr[i] >= count2: count3 += count2 count2 -= d[arr[j]] count2 = max(0,count2) j -= 1 j = max(0,j) else: count3 += brr[i] if count3 >= count : return True else: return False with open("input.txt", "r") as f_in, open("output.txt", "w") as f_out: data = f_in.read().splitlines() idx = 0 t = int(data[idx]); idx += 1 for _ in range(t): n,m = map(int, data[idx].split()); idx += 1 arr = list(map(int, data[idx].split())) ; idx += 1 brr = list(map(int, data[idx].split())) ; idx += 1 brr.sort() ...
Weak test cases in meta hacker cup round 2 problem B, ) ~~~~~ My code got ac verdict but fails on test case

Full text and comments »

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

179.
By Ashwanth.K, history, 2 years ago, In English
Meta Hackercup Practice D2 problem #### Problem D2: Line of Delivery (Part 2) [Link](https://www.facebook.com/codingcompetitions/hacker-cup/2024/practice-round/problems/D2) Hello everyone, I'd like to talk about Problem D2 from the recent Meta Hacker Cup 2024 Practice Round. The solution suggests that we can use a treap data structure to efficiently handle the operations described in the problem. Operation 1) Insert a stone at $E_i^{th}$ empty position. Operation 2) Move all stones to the left of the inserted stone by 1 unit in the negative direction. Yes, treaps can be used to solve this problem, but I’ve come up with a simpler solution using a vector approach. Let's maintain an array called `emptyPlaces` that stores information about all the empty spots. In this array, I track how many balls are located immediately to the right of each empty position. So `emptyPlaces[i]` denoted how many consecutive balls are immediately right towards $i^{th}$ empty ...
/hacker-cup/2024/practice-round/problems/D2) Hello everyone, I'd like to talk about

Full text and comments »

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

180.
By square1001, history, 7 years ago, In English
TopCoder SRM 761 Announcement (from 3:00 PM UTC today!) Hi Codeforces!<br> <br> It seems like (possibly) TopCoder SRM admins are busy with preparing online qualifier of <a href="https://codeforces.me/blog/entry/67769">"ltaravilse Cup"</a> which will be held tomorrow, there was no announcement written by TopCoder SRM admins. Therefore...<br> <br> I will announce that <b>TopCoder SRM 761</b> will be held today! Here are some informations.<br> <ul> <li><b>Start Time:</b> <a href="https://www.timeanddate.com/worldclock/fixedtime.html?msg=TopCoder+SRM+761&iso=20190622T11&p1=179&ah=1&am=35">11:00 AM UTC-4</a></li> <li><b>Duration:</b> 75-minute Coding Phase + 5-minute Intermission Phase + 15-minute Challenge Phase + Systest!</li> <li><b>Number of Problems:</b> 3</li> <li><b>Writer:</b> I don't know the exact writer, but I guess it's [user:misof,2019-06-22] :)</li> </ul> <br> As usual, this match is <b>rated</b> (I hope). And I am looking forward to this match.<br> <br> Don't forget that <span style="red">registeration phase will en...
TopCoder SRM 761 Announcement (from 3:00 PM UTC today!), online qualifier of "ltaravilse Cup" <https://codeforces.me/blog/entry/67769> which will be

Full text and comments »

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

181.
By RussianCodeCup, 12 years ago, In Russian
Russian Code Cup 2015, Первый квалификационный раунд Всем привет! Уже в эту субботу, [28 марта в 18:00](http://www.timeanddate.com/worldclock/fixedtime.html?day=28&month=3&year=2015&hour=18&min=0&sec=0&p1=166) состоится первый квалификационный раунд Russian Code Cup 2015. Раунд продлится 2 часа. По итогам раунда 200 лучших выйдут в отборочный раунд, где сразятся за выход в финал. Те, кому удача в субботу не улыбнется, а также те, кто по тем или иным причинам не смогут принять участие в раунде, смогут попробовать свои силы во втором отборочном раунде 25 апреля в 12:00, а при необходимости и в третьем – 31 мая в 13:00. В отборочный тур, назначенный на 13:00 14 июня, пройдут 200 лучших участников из каждого квалификационного раунда. Для того чтобы принять участие в Russian Code Cup, нужно зарегистрироваться на сайте http://russiancodecup.ru/ (регистрация будет открыта до начала третьего квалификационного раунда). Подробнее о чемпионате, правилах и призах и читайте на сайте http://russiancodecup.ru, по всем вопросам обращайтесь...
Russian Code Cup 2015, Первый квалификационный раунд, раунд Russian Code Cup 2015. Раунд продлится 2 часа. По итогам раунда 200 лучших выйдут в отборочный, &month=3&year=2015&hour=18&min=0&sec=0&p1=166) состоится первый квалификационный раунд RussianCode

Full text and comments »

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

182.
By lolzxii, 12 days 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...
$360 = 2^3 \cdot 3^2 \cdot 5^1$. Only squarefree $d$ matter, because the other $d$ have $\mu(d)=0

Full text and comments »

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

183.
By MikeMirzayanov, 10 years ago, In Russian
Технокубок 2017 — олимпиада по программированию для школьников <img src="http://assets.codeforces.com/images/technocup-2016-banner.jpg"/> Mail.Ru Group совместно с МФТИ, МГТУ им. Н. Э. Баумана и Codeforces во второй раз запускает Технокубок — совместную олимпиаду по программированию для школьников. В этом учебном году олимпиада вошла в перечень олимпиад школьников и получила третий уровень. На кону — дополнительные баллы и льготы при поступлении во многие высшие учебные заведения России и ценные призы от компании Apple. Сразиться за звание самого талантливого молодого программиста приглашаются учащиеся средних образовательных учреждений 8 &mdash; 11 классов. Победители и призеры олимпиады будут определены по результатам очного этапа, который будет проведен в Москве весной 2017 года на базе площадок МГТУ им. Н.Э.Баумана и МФТИ. [cut] <br/> ## Этапы соревнования #### Ознакомительные раунды * 12 октября 12:00 — 15 октября 11:00 * 16 ноября 12:00 — 19 ноября 11:00 У участников олимпиады будет возможность ознакомиться с платф...
сфере. Проект объединяет чемпионаты Russian AI Cup, Russian Code Cup и Russian DevelopersCup

Full text and comments »

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

184.
By Egor, 13 years ago, translation, In English
Знакомство: команда университета Shanghai Jiao Tong Вторая на очереди команда &mdash; команда Мифрил из университета Shanghai Jiao Tong. В целом, об этой команде мне известно не слишком много подробностей. Этот университет трехкратный чемпион мира &mdash; победы в 2002, 2005 и 2010 годах. В соответствии с правилами ACM-ICPC студент может принять участие не более чем в двух финалал, но насколько я слышал (поправьте меня, если я неправ) согласно сложившимся в Китае правилам студент не может принимать участие более чем в одном финале мира. Поэтому Bin Jin начал как замена в своей команде. Университет SJTU победил в соревнованиях Jinhua (опередив второе место на две задачи) и полуфинале в Дхака. В Битве Гигантов (командном матче между Россией и Китаем) они завоевали самое высокое место среди китайских команд (3-е место). ![ ](https://lh3.googleusercontent.com/fzxYt5heJ-L431G9gS4d1wGxF1kw2OGTBMUYjDlWPf9E2L7Y-NIuGyZx1UtjGh-grn_xIw2nMPWuoZRf-cDCCVcJWUAFY2bbfmnc1eEQSJeEirVb1Uc8LgQMZw) Состав: **Xiaoxu Guo** &mdash; pейтинг Codeforce...
и Китаем) они завоевали самое высокое место среди китайских команд (3-е место). ![ ](https://lh3

Full text and comments »

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

185.
By Nickolas, 12 years ago, translation, In English
Surprise Language Round #7 The contest is over. 13 people solved all problems &mdash; you guys are amazing! The editorial will be available [here](/blog/entry/13777). ------------ Today's language is FALSE, stack-based esoteric programming language invented over 20 years ago. The traditional A+B problem (integers A and B are separated with a space) can be solved [like this](http://rosettacode.org/wiki/A%2BB#FALSE). To test your solutions, you can: * download source code in C of the original interpreter [here](http://assets.codeforces.com/rounds/470/false_int.c). Testing system uses this interpreter with -q option. * use ["Custom Invocation"](/contest/470/customtest). * use online interpreters (they differ from the reference interpreter a bit but make debugging much easier): [1](http://morphett.info/false/false.html), [2](http://www.quirkster.com/iano/js/false-js.html). Useful links: * [language description by its author Wouter van Oortmerssen](http://strlen.com/false/false.txt) * [Pro...
#FALSE). To test your solutions, you can: * download source code in C of the original interpreter, ) * [статья в Прогопедии](http://progopedia.ru/language/false/) * [сборник программ в RosettaCode

Full text and comments »

Announcement of Surprise Language Round 7
  • Vote: I like it
  • +153
  • Vote: I do not like it

186.
By FatalEagle, history, 10 years ago, In English
Invitation to HackerEarth Collegiate Cup Qualifier Round Hello Codeforces! As mentioned in the previous post regarding the [HackerEarth Collegiate Cup](http://codeforces.me/blog/entry/46714), I would like to invite you to participate in [HackerEarth Collegiate Cup Qualifier Round](https://www.hackerearth.com/hackerearth-collegiate-cup-qualifier/). It's a 24 hours contest that will start on [Sep 03, 10:00 AM IST](https://www.timeanddate.com/worldclock/fixedtime.html?msg=HackerEarth+Collegiate+Cup+Qualifier&iso=20160903T10&p1=438&ah=2). The problem set consists of 3 traditional algorithmic tasks. **There will be no partial scoring**. All the teams who solve at least one problem will qualify to the next round. Check the contest page for more details about in-contest schedule and rules. I'm a tester of the problem set you'll be working on — thanks to [user:Xsquare,2016-09-02] and [user:magieNoire,2016-09-02] for preparing these tasks. Happy Coding :)
Invitation to HackerEarth Collegiate Cup Qualifier Round, Hello Codeforces! As mentioned in the previous post regarding the [HackerEarth CollegiateCup

Full text and comments »

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

187.
By Nickolas, 13 years ago, translation, In English
Friday the 13th, Programmers' Day This time the language is **Ada**, chosen not for being particularly crazy (it's too Pascal-like to my taste) but for its name. Indeed, a language named for Ada Lovelace seems to be a perfect fit for programmers' professional holiday. I tried to balance the lack of language weirdness by problems somewhat less trivial than usual. Here is the traditional solution for "A+B" problem (integers A and B can be given in one line): ~~~ with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; procedure AplusB is A, B: Integer; begin Get(Item => A); Get(Item => B); Put(Item => A + B, Width => 1); end AplusB; ~~~ The testing system uses gnat 4.7.2. To test your programs before submitting, you can: * use “Custom test” tab in the contest interface. * use ideone, language Ada (gnat-4.6). Remember that by default programs submitted by anonymous are shown in “recent codes”; to avoid this I recommend registering and using "private" privacy option or at least us...
file.adb` to compile the code and create the executable. If you have mingw installed, you can run

Full text and comments »

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

188.
By spike1236, 21 month(s) ago, translation, In English
Virtual trees method This article explores the concept of *virtual trees*, proves their key properties, describes an efficient algorithm for their construction, and then applies the method to solve a specific problem using dynamic programming (DP) on trees. ## Introduction Many tree-related problems require working with a subset of vertices while preserving the tree structure induced by their pairwise lowest common ancestors (LCA). The concept of a *virtual tree* allows us to transition from the original tree $T$ with $N$ vertices to a substructure whose size linearly depends on the size of the selected set $X$. This significantly accelerates algorithms, particularly for DP computations. ## Definition of a Virtual Tree Let $T$ be a given rooted tree, and $X$ be some subset of its vertices. A **virtual tree** $A(X)$ is defined as follows: $$ A(X) = \{ \operatorname{lca}(x,y) \mid x,y \in X \}, $$ where $\operatorname{lca}(x,y)$ denotes the lowest common ancestor of vertices $x$ and $y$ in tr...
. > **Lemma 1.** For any integer $n \ge 3$, if $\operatorname{lca}(x_1,x_n) \neq l$, then

Full text and comments »

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

189.
By Bahamin, history, 16 months ago, In English
Atto Round 1 (Codeforces Round 1041, Div. 1 + Div. 2) Editorial ### ✨ **Hope you enjoyed the problems!** ✨ <span style="font-size: 20px;">[problem:2127A]</span><br> **Idea:** [user:Bahamin,2025-08-04]<br> **Preparation:** [user:Hamed_Ghaffari,2025-08-04] <spoiler summary="Hints"> <spoiler summary="Hint 1"> What happens if $\operatorname{mex}([a_i, a_{i+1}, a_{i+2}]) = 0$? </spoiler> <spoiler summary="Hint 2"> Now what happens if $\operatorname{mex}([a_i, a_{i+1}, a_{i+2}]) \neq 0$? </spoiler> </spoiler> <spoiler summary="Solution"> Let's see when does $\operatorname{mex}([a_i, a_{i+1}, a_{i+2}])$ equal $\max([a_i, a_{i+1}, a_{i+2}]) - \min([a_i, a_{i+1}, a_{i+2}])$. **Case 1:** $\operatorname{mex}([a_i, a_{i+1}, a_{i+2}]) = 0$ This implies that all numbers are equal and non-zero, since otherwise $\min$ would be less than $\max$ and the difference wouldn't be $0$. **Case 2:** $\operatorname{mex}([a_i, a_{i+1}, a_{i+2}]) \neq 0$ In this case $\min([a_i, a_{i+1}, a_{i+2}])$ should be $0$ because $0$ is in the seque...
summary="Code"> ~~~~~ #include using namespace std; int main() { int tc

Full text and comments »

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

190.
By RussianCodeCup, history, 11 years ago, In Russian
Russian Code Cup 2015 — Отборочный тур Всем привет! Чемпионат Russian Code Cup 2015 приближается к финишной прямой. В ближайшее воскресенье [14 июня в 13:00](http://www.timeanddate.com/worldclock/fixedtime.html?day=14&month=6&year=2015&hour=13&min=0&sec=0&p1=166) состоится отборочный тур RCC-2015. В отборочном туре примут участие 604 лучших по итогам трех квалификационных раундов &mdash; борьба была такой напряженной, что в первой и третьей квалификациях 200-е место оказалось поделено, и в отборочный раунд прошло по 202 участника. Обратите внимание, что отборочный тур длиннее квалификационных и продлится 3 часа. По итогам отборочного раунда 200 лучших раунда получат фирменную футболку наших соревнований, а топ 50 участников пройдут в финальный раунд и получат возможность сразится за ценные призы. Финал состоится 19 сентября и, как и в прошлом году, пройдет онлайн. В соответствии с правилами соревнований в финал могут пройти только те, кому на момент проведения финала исполнится 18 лет. Приглашаем квалифицировавш...
Russian Code Cup 2015 — Отборочный тур, Всем привет! Чемпионат Russian Code Cup 2015 приближается к финишной прямой. В ближайшее, Обратите внимание, что отборочный тур длиннее квалификационных и продлится 3 часа.

Full text and comments »

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

191.
By Sammarize, 12 years ago, translation, In English
Way of problemsetter *The mystery of creating rounds unveiled by author of the 4 of them! The guide for preparing the round without horror-fiction and pastorals!* Thanks for [user:RodionGork,2014-06-13], who push me to writing this post and thanks for [user:lucAbalo,2014-06-13], who push [user:RodionGork,2014-06-13] to pushing me to writing this post. Also, many thanks to [user:RodionGork,2014-06-13] for the translation of this post to English. ##1. Inventing problems It's hard to advise anything on this point. There's no some standard way of creating problems &mdash; and if one have existed we'll have only "complicated algorithmic exercises" instead of "problems". People who participated in Russian Code Cup do know well the tasks of that sort. To cook good and interesting problem there should be some **idea!** which came to your mind (and later to minds of participants of the contest). Even the simplest problems of `A` level for the `Div2` should have some **idea**. So here is the war...
Russian Code Cup do know well the tasks of that sort. To cook good and interesting problem there, стандартные алгоритмы, как половина задач на [Russian Code Cup ](http://www.russiancodecup.ru/). Чтобы

Full text and comments »

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

192.
By spidy7, history, 6 years ago, In English
Invitation to CodeRed 2021 by IIIT Allahabad Hello everyone! We are proud to invite you all to **CodeRed 2021**, A flagship coding event of [Aparoksha](https://www.aparoksha.in/) &mdash; The annual TechFest of IIIT Allahabad. **CodeRed 2021** will be a **3.5 hour-long** team event with a maximum size of the team being **3 members**. The participants need not be from the same college/institution/organization. You will be given **eight problems** of varying difficulty. [CodeRed 2021](https://www.codechef.com/CRED2021) is scheduled for [April 11-2021, at 14:30 IST](https://www.timeanddate.com/worldclock/fixedtime.html?msg=CodeRed+2021&iso=20210411T1430&p1=2408&ah=3&am=30). CodeRed, Alkhwarizm (Rated for all CodeChef contest), and Humblefool cup (which happened on April 9th on Topcoder) are all among the flagship coding events of Aparoksha — Techincal fest of Indian Institute of Information Technology (IIIT), Allahabad. Last year, [CodeRed 2020](https://www.codechef.com/CORE2020) had 958 registered teams, we are expect...
2021** will be a **3.5 hour-long** team event with a maximum size of the team being **3 members**. The

Full text and comments »

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

193.
By wangmarui, history, 11 months ago, In English
Hello 2026 Editorial We'd like to thank you all for participating in the contest, and hope you enjoyed it. Any feedback would be appreciated! <spoiler summary="Rate The Contest!"> - Great contest - Good contest - Average contest - Bad contest </spoiler> ## [2183A &mdash; Binary Array Game](https://codeforces.me/contest/2183/problem/A) Idea & Preparation: [user:wangmarui,2025-12-23] <spoiler summary="Rate The Problem!"> - Good Problem - Okay Problem - Bad Problem - Didn't Solve </spoiler> <spoiler summary="Hint 1"> If the sequence $a$ consists entirely of $1$ s, what will Alice do? </spoiler> <spoiler summary="Hint 2"> Consider discussing the values of $a_1$ and $a_n$. </spoiler> <spoiler summary="Solution"> First, if the entire sequence consists of $1$ s, Alice wins immediately by operating on the whole sequen...
summary="Rate The Problem!"> - Good Problem - Okay

Full text and comments »

Tutorial of Hello 2026
  • Vote: I like it
  • +146
  • Vote: I do not like it

194.
By Black_Fate, 4 years ago, In English
[Educational] Combinatorics Study Notes (1) Hello Codeforces! Today I'll be writing about what I have learnt about combinatorics, which played, and, in my opinion, will still be playing a important role in both Codeforces and CP (short for competitive programming). However, combinatorics is such a great subject that made that impossible for me to write it all in one blog. So, this is just the very first blog, which is for beginners. If you are interested, please, pay attention to this account and I'll give posts as series for a long term. If you have found some mistakes in the text, or if you have some questions about the topic, please, leave a comment, and I'll check it weekly and reply. Also, if you find some grammar mistakes, a kind comment will be also welcomed. ### Thanks - [user:happyivan,2022-12-21], [user:Ptilon,2022-12-22], [user:ck1ne,2022-12-22] for pointing out some problems in the text. - [user:kill_all_placeholder,2022-12-21], [user:hydracody,2022-12-22] for providing possible topics. ### Content...
. ### Content 1. addition / multiplication principle 2. factorial, permutation and combination3. special

Full text and comments »

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

195.
By pani.natalia, 6 years ago, In English
How to be red: Arpa [user:Arpa,2021-02-28]'s interview: _-Salam AmirReza_ -Salam Natalia _-Do you remember becoming red?_ -Yes, exactly one year ago, for the first time, I touched red just with 2405 :)) [cut] _._ _-Did you celebrate it?_ -For sure, I celebrated it in my mind for several days. But if you mean a real celebration, with others' participation and some sweet, drink and food, no. I was in my hometown at that time, and my little brother and my parents became happy. _-Was becoming red the most special for you, or getting some other color was more emotional?_ -I remember when I reached Candidate Master. I was 15 at that time. Note that at that time, purple was starting from 1700. That was very nice. But for sure, becoming red was much more emotional. _-What color was your goal when you started?_ -I rarely had a goal. Becoming red became my goal in 2019. Especially, I never imagined that I could sometime reach IGM. I exactly remember the contest Globa...
learn to code. _-Do you teach your younger brother or let him find his own way?_ -Yes. I'm

Full text and comments »

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

196.
By satyam343, 3 years ago, In English
Problems that I authored so far Hi everyone! I wanted to write such a blog for a long time. I finally decided to do it after Codeforces Round $934$. I would like to thank [user:Non-origination,2024-03-21], [user:GoatTamer,2024-03-21] and [user:KingRayuga,2024-03-21] for discussing the problems with me. For each problem, I tried to include the some interesting stuff if I could remember. I tried to avoid using spoilers for the problems. So you can look at the comments even if you have not tried the problem. | # | Date | Problem | Difficulty | Contest | Comment |----|-----------|---------------------------------|------------|--------------------------------------|--------------------------------------| | 1 | Aug 2021 | [Tree Distance Sum](https://www.codechef.com/problems/TREEDIST) | Div 2 E | Codechef Starters 10 | My first problem which appeared in some contest. I noticed some nice properties about the dfs traversal and de...
| SnackDown 2021 — Online Round 1A| | | 3 | Feb 2022 | [Or Sum](https://www.codechef.com

Full text and comments »

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

197.
By nikgaevoy, 4 years ago, In English
Push-Free Segment Tree ![ ](/predownloaded/95/ad/95ad3397de22cc8b20c52a1eccc87ac0c34e76cb.jpg) Figure 1: Tiffany A pdf version of this text could be found [here](https://acm.math.spbu.ru/trains/push_free_segment_tree.pdf). Prerequisites ------------- First of all, who this article is aimed at. This article assumes you already know what a segment tree is. Have you never heard about the segment tree, the Fenwick tree (aka binary indexed tree, BIT) or the RMQ problem, you should better read about it [somewhere else](https://codeforces.me/catalog) and then come back here right after to learn a bunch of cool stuff. The model target audience is the people able to solve [this problem](https://judge.yosupo.jp/problem/range_affine_range_sum) at least in theory. But even if you can't, this article could still be helpful. However, I think this article contains some ideas that were never published before, thus making it interesting even for people who are closely familiar with different variants o...
make those super-easy to understand. Also, there will be a link to the code at the end, which you may

Full text and comments »

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

198.
By RussianCodeCup, history, 10 years ago, translation, In English
Russian Code Cup 2017 - Третий квалификационный раунд Всем привет! Пока более 400 участников уже готовятся сразиться в отборочном раунде Russian Code Cup 2017, тех, кто пока не квалифицировался, мы приглашаем принять участие в третьем квалификационном раунде, который состоится [в субботу, 29 апреля, в 14-00](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Russian+Code+Cup+2017+Qual+3&iso=20170429T14&p1=166&ah=2). Лучшие 200 участников смогут также принять участие в отборочном раунде и побороться за выход в финал Russian Code Cup 2017. Всем удачи и до встречи на [russiancodecup.ru](http://russiancodecup.ru)!
Russian Code Cup 2017 - Третий квалификационный раунд, Russian Code Cup 2017 — Third Qualification Round, Round of Russian Code Cup 2017. If you are still among those who has not qualified yet, we invite, /fixedtime.html?msg=Russian+Code+Cup+2017+Qual+3&iso=20170429T14&p1=166&ah=2). Лучшие 200 участников, ?msg=Russian+Code+Cup+2017+Qual+3&iso=20170429T14&p1=166&ah=2). Лучшие 200 участников смогут также, ](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Russian+Code+Cup +2017+Qual+3&iso

Full text and comments »

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

199.
By ifsmirnov, history, 11 years ago, translation, In English
Codeforces Round #349 Editorial [problem:667A] To know how much water you consume per second you should divide consumed volume, $v$, by the area of the cup, $\dfrac{\pi d^2} 4$. Then you should compare thisit with $e$. If your speed of drinking is greater, then you'll drink all the water in $\dfrac{h}{\tfrac{4v}{\pi d^2}-e}$ seconds. Otherwise you would never do it. [problem:667B] It is possible to make a convex polygon with given side lengths if and only if a generalized triangle inequality holds: the length of the longest side is less than the sum of lengths of other sides. It is impossible to make a convex polygon from a given set, so there is a side which is longest than (or equals to) than sum of others. Assume it is greater by $k$; then it is sufficient to add a rod of length $k+1$. More, it is clear that adding any shorter length wouldn't satisfy the inequality. Thus the answer for the problem is $\texttt{max}(l_1, \dots, l_n) - (l_1 + \dots + l_n - \texttt{max}(l_1, \dots, l_n)) + 1$. [probl...
, $v$, by the area of the cup, $\dfrac{\pi d^2} 4$. Then you should compare thisit with $e$. If your

Full text and comments »

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

200.
By adamant, history, 4 years ago, In English
Nimbers and Sprague-Grundy theorem Hi everyone! Today I'd like to write about the so-called Grundy numbers, or nimbers. I will start by providing a formal recap on the Sprague-Grundy theorem and then will advance to the topic that is rarely covered in competitive programming resources, that is I will write about nimber product and its meaning to the game theory. _I was asked to add the following to the blog: THANK SIR MASTER [user:ADAM_GS,2022-06-12] FOR GREAT AND VALUABLE REVIEW SIR_ ## Prerequisites Familiarity with the following concepts: - Basic [set theory](https://en.wikipedia.org/wiki/Set_theory) notion: [union](https://en.wikipedia.org/wiki/Union_%28set_theory%29), [cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) and [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) of sets, [set of all subsets](https://en.wikipedia.org/wiki/Power_set) denoted as $2^A$, etc; - [Groups](https://en.wikipedia.org/wiki/Group_%28mathematics%29) and [fields](https://en.wiki...
. **Def. 3**. An impartial game is **progressively bounded** if there is an upper bound for every

Full text and comments »

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

201.
By andrewzta, 13 years ago, In Russian
RCC Qual 3 + Обновление языков на RCC Всем привет! В ближайшую субботу, 24 мая 2014 года, в 19-00 по московскому времени, состоится третий квалификационный раунд Russian Code Cup 2014. Зарегистрироваться и участвовать можно на сайте http://russiancodecup.ru Участвовать могут все, кроме 401 участника, которые уже квалифицировались в первом и втором раундах. 200 лучших проходят в отборочный раунд, а остальные смогут попробовать свои силы в четвертом квалификационном раунде 1 июня. И немного приятных новостей: мы обновили версии компиляторов почти всех языков, добавили возможность отправлять на C++11 под GNU C++ (а Visual C++ 2013 и так поддерживает C++11) и добавили Java 8 (Java 7 тоже пока остается). Актуальные версии компиляторов и строки компиляции на странице с правилами чемпионата http://www.russiancodecup.ru/rules Всем удачи! [UPD] Всем спасибо за участие, раунд завершен. У нас снова 201 прошедший, поздравляем! Разбор будет опубликован в ближайшее время.
RCC Qual 3 + Обновление языков на RCC, квалификационный раунд Russian Code Cup 2014.

Full text and comments »

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

202.
By MikeMirzayanov, 11 years ago, In Russian
Технокубок: олимпиада по программированию для школьников <img src="http://assets.codeforces.com/images/technocup-2016-banner.jpg"/> В 16:00 (московское время) 4 марта 2016 г. Mail.Ru Group совместно с МФТИ, МГТУ им. Н. Э. Баумана и Codeforces запускает Технокубок &mdash; первую совместную олимпиаду по программированию для школьников. На кону &mdash; дополнительные баллы при поступлении в престижные технические вузы России и ценные призы. Сразиться за звание самого талантливого молодого программиста приглашаются учащиеся средних образовательных учреждений. Кроме того, любой желающий сможет попробовать свои силы в решении сложных и интересных задач в разделе Тренировок после онлайн-раундов. ### Организаторы олимпиады <a title="Московский физико-технический институт" href="https://mipt.ru/"><img src="http://assets.codeforces.com/images/mipt-logo.png"/></a> <br/> <small>Московский физико-технический институт</small> <a title="Московский Государственный Технический Университет им. Н. Э. Баумана" href="http://www.bmstu.ru/"><img s...
профессионально развиваться в этой сфере. Проект объединяет чемпионаты Russian AICup, Russian Code Cup и

Full text and comments »

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

203.
By adamant, 5 months ago, In English
OCPC 2026 Summer Hi everyone! <center><a href="https://ocpc.camp"><img src="https://ocpc.camp/images/ocpc_light.svg?nocache" height="80px"></a> <a href="https://icpc.foundation/"><img src="https://ocpc.camp/images/ICPC.svg?nocache" height="80px"></a></center> The [OCPC](https://ocpc.camp/) (Osijek Competitive Programming Camp), an [award-winning](https://www.linkedin.com/feed/update/urn:li:activity:7368330111089131522/) camp for university students preparing for ICPC and other coding competitions, is back this **Summer 2026** — this time with **two onsite editions**: - **Hong Kong** — **8–16 August 2026**, hosted at the City University of Hong Kong. - **Iași, Romania** — **12–20 September 2026**, hosted at Alexandru Ioan Cuza University of Iași. Both editions are organized by us together with local hosts at each site, and use the **same contest set** — so you take part in **one** of them. As a rough guide, the **Iași** edition is most convenient for teams based in Europe, and **Hong Kong*...
] — problemsetter for ICPC Asia East contests and Universal Cup staff; - [user:Claris,2026-06-20] — ICPC

Full text and comments »

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

204.
By GShark, 11 years ago, In Russian
Раскрытие тайны цифрового корня. Всем привет. Недавно мне посчастливилось подготовить задачу про цифровой корень на Russian Code Cup. В результате прорешивания, а также комментариев к разбору, я заметил, что, к сожалению, отнюдь не каждый осведомлен о свойствах данной функции. Я просто не мог остаться равнодушным к этой проблеме. Для начала рассмотрим определение цифрового корня, взятое с англоязычной Википедии с моим переводом: <i> Цифровой корень натурального числа &mdash; это цифра, полученная в результате итеративного процесса суммирования цифр, на каждой итерации которого для подсчета суммы цифр берут результат, полученный на предыдущей итерации. Этот процесс повторяется до тех пор, пока не будет получена одна цифра. <br> Например цифровой корень 65,536 это 7, потому что 6 + 5 + 5 + 3 + 6 = 25 и 2 + 5 = 7. </i> Для начала заметим очевидное свойство ($dr(n)$ &mdash; цифровой корень числа $n$): <br> $$dr(n) = n,~~~ n \le 9$$ Дальше докажем следующий факт: <i>Сумма цифр числа ...
Всем привет. Недавно мне посчастливилось подготовить задачу про цифровой корень на RussianCode

Full text and comments »

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

205.
By Mishazher, history, 16 months ago, In English
MACSO 2025 Qualification Results, Schedule and Prizes Hello Codeforces! ================== We are excited to share important updates regarding the MACSO Finals and Congratulations to all participants for your hard work and dedication! ### You're qualified for MACSO Finals if Scored 221 points on MACSO Qualification Round 2025 Finished top 10 in your state (US) or country in MACSO Quals 2025 Finished top 10 in MACSO Finals 2024 (both online and in-person). All finalists will receive an invitation email. If you receive the email today, you are invited to MACSO 2025. We would also like to announce that if you registered but didn't submit anything, we will count it as 1 point on our qualification round. So make sure to check your mail in any case. Congratulations to people who've successfully qualified! We are highly encourage everybody to come In-Person if you can (if you have issues with transportation, we can pick up a couple of you and then bring back home so be free to message me if you really need a ride) as it woul...
for the in-person Winners! Gold Medalist: Golden Cup + Medal + MACSO Plushy Whale + Sponsored

Full text and comments »

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

206.
By CAP, 14 years ago, translation, In English
About Facebook Hacker Cup **How do I compete?** 1. Before the competition starts, we'll post a link that you can use to access the problems for that round. 2. Write a program to solve the problem. You can use any programming language that has a free compiler or interpreter available. Your program will need to solve the input file in less than 6 minutes. 3. Make sure that your program exactly follows the input and output formats. When you run your program on the sample input, it should produce the sample output. 4. When you are confident that your program is correct, download the input file. This will start a 6-minute timer. You must upload your output and your source code before the timer ends to get credit for the problem. 5. If you accidentally submit the wrong files or you realize that there is a problem with your program, you can resubmit as many times as you need to during the 6 minutes. Once the 6 minutes has ended, you may not submit again for that problem. The last submission within the 6 minute...
About Facebook Hacker Cup, /worldclock/fixedtime.html?msg=Facebook+Hacker+Cup +2013+Round+1&iso=20130202T10&p1=1240)3. Online Round 2

Full text and comments »

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

207.
By MikeMirzayanov, history, 9 years ago, In Russian
Технокубок 2018 — олимпиада по программированию для школьников <img src="http://assets.codeforces.com/images/technocup-2016-banner.jpg"/> Mail.Ru Group совместно с МФТИ, МГТУ им. Н. Э. Баумана и Codeforces в третий раз запускает Технокубок — совместную олимпиаду по программированию для школьников. В этом учебном году олимпиада вошла в перечень олимпиад школьников, повысив свой уровень до второго &mdash; круг учебных заведений, дающих льготы победителям и призерам, значительно расширился. Лучшие участники получат ценные призы от компании Apple. Сразиться за звание самого талантливого молодого программиста приглашаются учащиеся средних образовательных учреждений 8 &mdash; 11 классов. Победители и призеры олимпиады будут определены по результатам очного этапа, который будет проведен в Москве весной 2018 года на базе площадок МГТУ им. Н.Э.Баумана и МФТИ. [cut] <br/> ## Этапы соревнования #### Ознакомительные раунды * 14 сентября 15:00 — 17 сентября 15:00 * 12 октября 10:00 — 15 октября 10:00 * 9 ноября 18:00 — 12 ноября 18:00 ...
профессионально развиваться в этой сфере. Проект объединяет чемпионаты Russian AICup, Russian Code

Full text and comments »

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

208.
By nocriz, history, 5 years ago, In English
Detailed Editorial for problem "The Struggle" from XXII Opencup, Grand Prix of XiAn Hello, Codeforces! ["The Struggle"](https://codeforces.me/gym/103329/problem/F) (Codeforces Gym 103329F) is a problem I authored which appeared in the HDU Multi-university Training, the Ptz Summer Camp and the Open Cup. Despite appearing in contests where there are a total of ~1300 three people teams, I know of few (possibly no more than 5) people who have learned and independently implemented the solution. The problem is pretty much fun and the solution is quite easy to implement (actual implementation < 2kb). hos_lyric [said that](https://codeforces.me/blog/entry/95341?#comment-844166) this is a good problem! From this blog you will easily learn how the algorithm works and how to implement the solution effortlessly. There shall be no more mystery, and you will become able to solve this OpenCup problem that few people have solved right today! The problem statement is very simple: Given an ellipse $E$ that is contained in $(0,4 \times 10^6) \times (0,4 \times 10^6)$, calcu...
Summer Camp and the Open Cup. Despite appearing in contests where there are a total of ~1300 three people

Full text and comments »

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

209.
By Aveiro_quanyue, history, 4 years ago, In English
A note on a nowcoder problem -- Centroid decomposition (点分治) Nowcoder problem (Chinese) [link](https://ac.nowcoder.com/acm/contest/51721/E). The submission is private because I don't want to publish my Nowcoder account, but you can copy the code at the end of this blog and paste it to the answer sheet, it will get AC. [English version](https://codeforces.me/blog/entry/114434) First I would like to thank [user:ShaoNianTongXue5307,2023-03-28] for his idea! This is a learning note, most for myself. Most of this blog is not original. **Part 1: Problem Statement:** A tree $T=(V, E)$ has $n$ vertices and $n-1$ edges, the weight of each vertex $i$ is $a_i$. For each edge $e$, you can determine its direction, i.e., for two vertices $u, v$, there are two states: $u \rightarrow v$ and $v \rightarrow u$. There are $2^{n-1}$ states in total. For each state $S$, we define $f(S)$ as $f(S) := \sum\limits_{(u, v) \in V \times V, v\,\text{is reachable from}\,u} |a_u - a_v|$. Compute the sum of $f(S)$ over all $2^{n-1}$ states $S$, mo...
private because I don't want to publish my Nowcoder account, but you can copy thecode at the end of

Full text and comments »

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

210.
By evergreen1124, history, 4 months ago, In English
A Competitive Programmer’s Investigation Into Whether Argentina Secretly Found the 2026 WC Editorial ##**A Competitive Programmer’s Investigation Into Whether Argentina Secretly Found the 2026 World Cup Editorial &mdash; or ....... maybe FIFA is just rigging it in their favor** As competitive programmers, we are trained to look for patterns. A strange output. A suspiciously optimized solution. A hidden trick that explains everything. After analyzing Argentina’s entire 2026 World Cup campaign, I have discovered something deeply concerning: Argentina may have found the editorial. Not because they win. Champions are supposed to win. The suspicious part is HOW they win. Argentina has repeatedly allowed opponents to believe they solved the problem... before revealing that they were only looking at the sample tests. Here is the evidence. --- ## Exhibit A: Argentina 3-0 Algeria Group Stage The investigation begins with the least suspicious match. Which makes it the most suspicious. Argentina did not struggle. They did not require a comebac...
Cup Editorial — or ....... maybe FIFA is just rigging it in their favor** As competitive

Full text and comments »

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

211.
By chromate00, 13 months ago, In English
Codeforces Round 1058 Editorial Thanks for the participation! We hope you enjoyed the contest. <spoiler summary="Rate the contest!"> - Epic - Good - Moderate - Bad - Horrendous </spoiler> <strike>The solution codes will be added shortly after the system tests are finished.</strike> They have been added. [problem:2160A] Problem Credit: [user:Proof_by_QED,2025-10-12] <spoiler summary="Rate the problem!"> - Epic - Good - Moderate - Bad - Horrendous </spoiler> <spoiler summary="Solution"> First, let $m=\operatorname{mex}(A)$. We can ignore all elements that are greater than $m$. This is because since $m$ is the mex, $m$ does not appear in $A$, and consequently it also cannot appear in any of the partitions. Thus, which of the partitions each element goes to does not matter. Now, let's consider the n...
$. That is, $m$ is the only possible score.

Full text and comments »

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

212.
By NeoYL, history, 2 years ago, In English
NPCAPC user editorial (partially) WARNING: Do not look at this blog if you are part of the Universal Cup as some of these problems will be used for Universal Cup. If you haven't tried the NPCAPC contest before and you want to do some kind of virtual participation, this editorial is not for you. I do not intend to spoil the questions and the contest experience. Problems link: https://atcoder.jp/contests/npcapc_2024/tasks?lang=en Link to codes: https://atcoder.jp/contests/npcapc_2024/submissions?f.User=yongly <spoiler summary="C: Solve with Friends"> Solution: This problem is an easy one. You can first consider we use all by A and C first. Now, we want to consider when is it better to choose B and D instead. B[i] + D[front] <= A[i] + C[back] Now we move stuff related to i to the left, B[i] &mdash; A[i] <= C[back] &mdash; D[front]. Now, we notice that B[i] &mdash; A[i] should be minimized. This inspires us to sort the indices concerning the values of B[i] &mdash; A[i]. Then the rest is brute force. </sp...
WARNING: Do not look at this blog if you are part of the Universal Cup as some of these problems

Full text and comments »

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

213.
By algoslayer, 13 months ago, In English
Meta Hacker Cup 2025 — Round 1 Editorial Hey everyone I recently participated in **Meta Hacker Cup 2025 Round 1** and I’m thrilled to share that I secured **Rank 333 / 13,676** with a **perfect score of 105/105**, successfully solving every problem from **A1 → D**! I've qualified for Round 2 of the Meta Hacker Cup 2025! Round 1 was a fantastic set of problems, and I managed to solve all of them for a full score. This post includes **my hints, solution approaches, and final codes** for all problems — written to help learners strengthen their **DSA and problem-solving** intuition. [A1: Snakes Scales (Chapter 1) :](https://www.facebook.com/codingcompetitions/hacker-cup/2025/round-1/problems/A1) <spoiler summary="Hint"> Snake must walk from platform 1 to N. To get from platform $i$ to $i+1$, he needs a ladder of height $|A_i - A_{i+1}|$. Since he brings only one ladder, it must be tall enough for the hardest (i.e., highest) adjacent jump in the entire path. </spoiler> <spoiler summary="Solution"> The s...
Meta Hacker Cup 2025 — Round 1 Editorial, Hey everyone I recently participated in **Meta Hacker Cup 2025 Round 1** and I’m thrilled to

Full text and comments »

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

214.
By shivamg_isc, 9 years ago, In English
Invitation to CodeRed- 2018 ![ ](/predownloaded/db/f7/dbf7dd2726ef0b40fe4e4dc5905da8b36ba36fba.png) Hello Codeforces! [Aparoksha](https://aparoksha.org/) presents to you an all-new flagship event **CodeRed** in association with ACM. If you have the appetite for algorithmic problem solving, then don't miss it out! It will be a 5-hour long **team event** with a maximum size of the team being **3 members**. The preliminary round will be held on Codechef, and the onsite round will be held during Aparoksha. The total prize money is worth **INR 50,000**. The **best 40 teams** will make it to the onsite round. Also, top **2** teams in the **online round** will get **INR 3000 and 2000** respectively, along with Codechef Laddus. All teams making it to the onsite round will get CodeRed T-shirts. Contest link is here &mdash; [CodeRed 2018](https://www.codechef.com/CODR2018) The problem set comprises **6 problems** of varying difficulty level. So be ready to have a nail-biting exper...
! It will be a 5-hour long **team event** with a maximum size of the team being **3 members

Full text and comments »

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

215.
By Gheal, 4 years ago, In English
Codeforces Round #875 (Div.1 + Div. 2) Editorial [1831A &mdash; Twin Permutations](https://codeforces.me/contest/1831/problem/A) ------------------ Author: [user:Gheal,2023-05-25] <spoiler summary="Hints"> <spoiler summary="Hint 1"> If $a_i+b_i \le a_{i+1}+b_{i+1}$, then $a_i+b_i$ can be equal to $a_{i+1}+b_{i+1}$. </spoiler> <spoiler summary="Hint 2"> Building on the idea from the first hint, can we build a permutation $b$ such that $a_1+b_1=a_2+b_2=\ldots=a_n+b_n$? </spoiler> </spoiler> <spoiler summary="Solution"> Since $a_i+b_i \le a_{i+1}+b_{i+1}$, then $a_i+b_i$ can be equal to $a_{i+1}+b_{i+1}$. Therefore, any permutation $b$ which satisfies $a_1+b_1=a_2+b_2=\ldots=a_n+b_n$ is a valid answer. If $b_i=n+1-a_i$, then: 1. $b$ is a permutation; 2. $a_1+b_1=a_2+b_2=\ldots=a_n+b_n=n+1$ Consequently, $b=[n+1-a_1,n+1-a_2,\ldots,n+1-a_i,\ldots,n+1-a_n]$ is a valid answer. Time complexity per test case : $O(N)$ </spoiler> <spoiler summary="Code (Gheal, C++)"> ~~~~~ #include<bits/stdc++.h>...
), giving us a time complexity of $O(\log^3)$.

Full text and comments »

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

216.
By andrewzta, 12 years ago, In Russian
RCC 2014 Elimination Round Всем привет! Итак, четыре квалификации позади и приближается основное событие отборочного цикла Russian Code Cup 2014 &mdash; отборочный раунд. 802 участника сразятся за право войти в 50 лучших, которые будут приглашены в Москву в начале октября для участия в финальном раунде RCC-2014. Отборочный раунд начнется в 14-00 по московскому времени в воскресенье, 8 июня, и продлится 3 часа. Раунд завершен, поздравляем финалистов!
Russian Code Cup 2014 — отборочный раунд. 802 участника сразятся за право войти в 50 лучших

Full text and comments »

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

217.
By joelgun14, 8 months ago, In English
The ICPC NAC 2026 Experience Preamble ------------------ I thought writing a short blog about my experience at the NAC would be interesting, so here we are. This year's NAC was held in UCF from March 18-23. This is the third time in a row that the NAC is hosted in UCF. I will put all comments regarding the problems in spoiler tags, since this contest may or may not be used in a future universal cup. Since this is my third year at the NAC hosted at the exact same place, there is a sense of familiarity with how things are run. For example, the food, hotels, and contest location hasn't changed much in the last couple of years. Arrival Day ------------------ The flight to Orlando was very eventful for our team. We had a tight connection at Toronto and our initial flight was significantly delayed. It was so bad to the point that during the flight all of us received emails that we got rebooked to different flights. Despite this, we tried our best to make the flight to Orlando. We ran across the airport to catc...
spoiler tags, since this contest may or may not be used in a future universal cup. Since this is my

Full text and comments »

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

218.
By __fn__, history, 3 years ago, In English
Weekend Contest for Newbies | Pupils Hello Codeforces ☀️☀️☀️ We are glad to invite you to participate in [this weekend contest](https://codeforces.me/contestInvitation/1eefe67203496eb5c4cd0899502ce6faf51e6f02) which will take place on [contest_time:490250] You will be given **12** problems and **2** hours and **15** minutes to solve them. All the problems are written and prepared by [user:LiquidFun,2023-12-03] and based on an onsite competition hosted at FSR Informatik. Note that the problems difficulty are **easy** so all **newbies** and **pupils** are invited to participate in this contest. **Specialists** and above should be able to finish the contest and are also invited to participate for fun. Have a nice contest ✨ !! **UPDATE 1** You can now register for the contest via [this link](https://codeforces.me/contests/490250) **UPDATE 2** Starting soon. Get ready ![ ](/predownloaded/b6/1a/b61ad1f464bd558f4632b7b73082102b84185e0c.jpg) **UPDATE 3** Congratulations to the winners! <tabl...
/b61ad1f464bd558f4632b7b73082102b84185e0c.jpg) **UPDATE 3** Congratulations to the winners

Full text and comments »

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

219.
By Black_Fate, history, 4 years ago, In English
[Educational] Combinatorics Study Notes (4) Hello Codeforces! Today I'll be writing about what I have learnt about combinatorics, which played, and, in my opinion, will still be playing an important role in both Codeforces and CP (short for competitive programming). However, combinatorics is such a great subject that made that impossible for me to write it all in one blog. So, this is just the **fourth** blog, which is friendly to beginners. If you are interested, please, pay attention to this account and I'll give posts as series for a long term. If you have found some mistakes in the text, or if you have some questions about the topic, please, leave a comment, and I'll check it weekly and reply. Also, if you find some grammar mistakes, a kind comment will be also welcomed. ### Previous Blogs - [Combinatorics (1)](https://codeforces.me/blog/entry/110376), basics. - [Combinatorics (2)](https://codeforces.me/blog/entry/110390), implementations. - [Combinatorics (3)](https://codeforces.me/blog/entry/110799), ar...
/entry/110390), implementations. - [Combinatorics (3 )](https://codeforces.me/blog/entry/110799

Full text and comments »

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

220.
By MikeMirzayanov, 5 years ago, In English
Top 50 Voted Blog Posts in 2021 Hi. Here is the list of top-voted blog posts in 2021. Find something interesting for yourself? | # | Post | Votes | Author | | - | - | - | - | | 1 |<a href="/blog/entry/95106">The Ultimate Topic List (with Resources, Problems and Templates)</a> | 4383 | [user:YouKn0wWho,2022-01-02] | | 2 |<a href="/blog/entry/96333">Codeforces Round #752</a> | 3156 | [user:YouKn0wWho,2022-01-02] | | 3 |<a href="/blog/entry/87882">User activity in the profile! [new, Feb. 2021]</a> | 3055 | [user:geranazavr555,2022-01-02] | | 4 |<a href="/blog/entry/89227">Codeforces Round #712</a> | 2866 | [user:Monogon,2022-01-02] ...
] | | 3

Full text and comments »

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

221.
By pilliamw, 13 months ago, In English
PHSCO Fall 2025 Editorial Thanks to everyone who participated in the Fall 2025 PHSCO! Over 40 teams participated across both divisions, which is a new record and extremely inspiring for our second-ever hosted contest. Things went a lot more smoothly this year and we hope that all (or at least a majority) of the problems were enjoyable. On a personal note, being able to run PHSCO is an amazing opportunity and I can't thank all of you enough for making it possible. Anyways, without further ado, congratulations to all of the winners in each prize pool! Please check your emails for prizes, which should be sent out within this week. (If you don't receive anything after a week, please contact me!) **Standard Division (Pre-College):** - 1st &mdash; Entropy &mdash; [user:TheInfiniteLoop,2025-10-26] &mdash; Narayana Educational Institution - 2nd &mdash; 1 orz 1 norz &mdash; Eason Li, Ethan Chang ([user:easonli416,2025-10-26], [user:spoonspoon1006,2025-10-26]) &mdash; Ellen Fletcher Middle School, Davidson Acad...
> ~~~~~ print(int(input())*2) ~~~~~

Full text and comments »

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

222.
By _istil, 2 years ago, In English
Good Bye 2024: 2025 is NEAR Editorial Thank you for participating in this round! Problems A and G are authored by [user: Cocoly1990,2024-11-23] and the rest by me. Currently, I'm not sure if the editorials are fine enough. Please feel free to tell me where I can improve. <spoiler summary=" Rating Predictions"> | | A | B | C | D | E | F | G | H | I | | :--------------------------------: | :--: | :---------: | :--: | :----------: | :--: | :--: | :----------: | :--: | :----------: | | [user:wyrqwq,2024-12-20] | 800 | 1200 | 1400 | 1700 | 1900 | 2500 | [2800, 3300] | 3200 | [800, 3000] | | [user:Cocoly1990,2024-12-20] | 800 | 1300 | | | | | 3000 | | | | [user:TheScrasse,2024-12-20] | 800 | 1200 | ? | 1800 | | 2500 | 3000 | 3000 | 3500 | | [user:LMydd0225,2024-12-20] | 800 | ...
)$? Are sets that are very large really necessary?

Full text and comments »

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

223.
By tnowak, 7 years ago, In English
Really weird differences in runtime? — Explanation and tutorial I know the post is a bit long, but I think it is worth to know the whole story. I attempted to solve [div1D](https://codeforces.me/contest/1314/problem/D) from [round #623 (VK Cup)](https://codeforces.me/contest/1314) with a randomized solution (that is one of the official solutions). After writing the code, I wondered how many iterations of this randomized algorithm I could do to fit in TL. So, I generated [a maxtest](https://pastebin.com/raw/Eyakqtsd) (that is, n=80 and k=10 in this task) and I ran it in custom invocation. I saw that I could do 60 000 iterations in about 2.4 &mdash; 2.5 seconds. Good enough, right? After all, the more iterations, the smaller chances of being hacked / getting WA (even though this number of iterations is ridiculous). So I submitted [the code](https://codeforces.me/contest/1314/submission/71715691) (and [here](https://codeforces.me/contest/1314/submission/71814887) is a bit prettier code without templates/defines). As you can see, I got TLE. A...
solve [div1D](https://codeforces.me/contest/1314/problem/D) from [round #623 (VKCup)](https

Full text and comments »

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

224.
By Hexagons, 2 years ago, In English
OMORI CONTEST Editorial Thank you for joining the [contest](https://codeforces.me/contestInvitation/fc8da6d6845e77adc452e754d3d84c1086148c59) &#128522;. <spoiler summary="How did you find the contest?"> - Great - Good - Average - Bad - Trash </spoiler> <spoiler summary="Which problem is your favourite?"> - SUNNY - AUBREY - HERO - KEL - MARI - BASIL - OMORI </spoiler> #### [A. SUNNY](https://codeforces.me/gym/551481/problem/A) <spoiler summary="Editorial"> <spoiler summary="Problem Tags"> `bijections` `dynamic-programming` </spoiler> <spoiler summary="Hint 1"> Try to find a bijection, meaning try to find another problem such that its solution is equivalent to the original problem but is easier to solve. </spoiler> <spoiler summary="Hint 2"> Try to notice what happens to the difference array of $a$ when Sunny plays a note. </sp...
- Good - Average - Bad - Trash

Full text and comments »

Tutorial of OMORI CONTEST
  • Vote: I like it
  • +133
  • Vote: I do not like it

225.
By dalex, 15 years ago, translation, In English
Codeforces Beta Round 76 - Analysis <p>At first I tell about the contest at all.<br></p>My problems in the contest were A-div2,&nbsp; B-div2,&nbsp; C-div2/A-div1,&nbsp; E-div2/C-div1,&nbsp; D-div1. I wanted to make only div.2 round, but then we decided to give you seven problems at both divisions. <a class="rated-user user-admin" href="../../../profile/MikeMirzayanov" title="Штаб, MikeMirzayanov">MikeMirzayanov</a> prepared the problem about milk pouring and <a class="rated-user user-orange" href="../../../profile/anonymous" title="Майор anonymous">anonymous</a> gave E-div1 problem. Also <a class="rated-user user-admin" href="../../../profile/RAD" title="Штаб, RAD">RAD</a> gave some advices to complicate problems Azembler and Flags a bit.<br><p>And now let's start analysis.<br><br><br><b>Problem A (div.2) - Restoring Password</b><br><br>Password was very easy to restore. You should just iterate over groups of 10 characters in the first string and over all codes. Then, if some number's code is equal to the group - print t...
characters in the first string and over all codes. Then, if some number's code is equal to the group - print

Full text and comments »

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

226.
By andrewzta, 12 years ago, In Russian
RCC 2014 Qual 4 Всем привет! Все помнят, что исходно в RCC-2014 планировалось только 3 квалификационных раунда, но из-за ряда технических трудностей при проведении первой квалификации было решено провести четвертый раунд. Поэтому в ближайшее воскресенье, 1 июня 2014 года, в 13-00 по московскому времени, состоится четвертый квалификационный раунд Russian Code Cup 2014. Зарегистрироваться и участвовать можно на сайте http://russiancodecup.ru Участвовать могут все, кроме тех участников, которые уже квалифицировались в первом, втором или третьем раундах. 200 лучших проходят в отборочный раунд, а остальным мы желаем удачи на других соревнованиях этого сезона и ждем на Russian Code Cup в следующем году. Тем же, кто уже прошел в отборочный раунд, не стоит расслабляться, ведь он совсем скоро, 8 июня. Раунд завершен. Поздравляю всех квалифицировавшихся!
, состоится четвертый квалификационный раунд Russian Code Cup 2014. Зарегистрироваться и участвовать

Full text and comments »

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

227.
By mambo, history, 12 months ago, In English
Hello your computer has virus: A case analysis how the current issues on CF and how to solve them Now I know what you're thinking... "oh no. hes being racist again" however, if you would so kindly look at any recent standings, especially ones which favour the timezone of indians... (like the last div1,div2 combined round...), you would notice quite the coincidence. And if you think, oh well Codeforces is fucked... you would be wrong Codeforces gets the short end of it, just look at meta hacker cup round 3, and compare it to any other year. Now is calling out Indians racist? Without valid reasoning that they are the supermajority causing issues, yes. However, I believe I have valid enough reasoning. If the pure statistics don't convince you that we must target punishments towards India/bangladesh/pakistan?/basically that geographic region, then why not use logic instead? Why do these people want to cheat? Well I've asked a few who obviously, I will keep anonymous. Simply put, its peer pressure. Somehow, most likely due to government corruption and other political things...
meta hacker cup round 3, and compare it to any other year. Now is calling out Indians racist

Full text and comments »

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

228.
By eugenechka.boyko.2_0-0, 2 weeks ago, translation, In English
Codeforces Round 1132 (Div. 2) Editorial #### [problem:2284A1] <spoiler summary="Hint"> It is sufficient to apply operations to only two points. </spoiler> <spoiler summary="Solution"> Let us prove that the maximum area is achieved if we shift one of the points by $\lfloor \frac{n}{2} \rfloor$ steps up, and the other by $\lceil \frac{n}{2} \rceil$ steps to the right. To do this, consider the bounding rectangle of the resulting triangle after all point shifts; let its side lengths be $a$ and $b$, respectively. We will show that its maximum area is precisely $\frac{ab}{2}$. Since triangle $ABC$ is inscribed in our rectangle, at least one of its vertices must coincide with a vertex of the rectangle. Without loss of generality, let this be vertex $A$. If we denote the angles adjacent to it by $\alpha$ and $\beta$, it can be shown that the maximum area is achieved when the value $\tan \alpha \cdot \tan \beta$ is minimized, which means it is equal to $0$ for $0 \le \alpha + \beta < \frac{\pi}{2}$. ![Fig. 1](/predownload...
} \rceil$. ~~~~~ def INT(): return int(input()) def MAP

Full text and comments »

229.
By shsh, history, 9 months ago, In English
HPI 2026 Editorial Thank you to everyone who attended this year's Harker Programming Invitational (HPI)! If you haven't already, we would really appreciate it if you filled out our [feedback form](https://forms.gle/opwQmMZPBtM7uWCt9) so we can make our contest even better next year. Also, [Novice](https://codeforces.me/gym/106410) and [Advanced](https://codeforces.me/gym/106409) problems have been uploaded to the Gym for upsolving. *Note:* Only solutions for the Advanced division are presented here, but solutions for Novice-only problems (Yash is Cross-Eyed, Repetition, Skills) can be provided upon request. ## Harker!! <spoiler summary="Solution"> Pretty straightforward: most languages have a standard library function for finding a given substring in a string, so you can just use that. </spoiler> <spoiler summary="Code (Team Aarav)"> ```python def solution(s): if "harker" in s: return 1 return 0 T = int(input()) for _ in range(T): s = input() prin...
for $m$. In total, this takes $\mathcal{O}(N^3)$ time.

Full text and comments »

Tutorial of HPI 2026 Advanced
Tutorial of HPI 2026 Novice
  • Vote: I like it
  • +28
  • Vote: I do not like it

230.
By low_, history, 7 years ago, In English
First season HNOI Civil War conclusion _Dear Codeforces community,_ Lately, we have successfully organized a high-schoolers' contest: HNOI Civil War. The contest was born as a "rivalry" between two of the best Hanoi-based gifted high schools: Hanoi-Amsterdam High School and Nguyen Hue High School. 3-people organizing committee includes: Trung Lan Nguyen ([user:lantrungseo,2019-07-21]) &mdash; as the Head Organizer, Bao Quoc Ngo ([user:b21quocbao,2019-07-21]) &mdash; as the Head Problemsetter and coach for Nguyen Hue informatics team for this contest, and me, Dung Tuan To [user:low_,2019-07-21] &mdash; as the Head Coordinator and coach for Hanoi-Amsterdam team. ![ ](/predownloaded/0d/47/0d47e43a3a1c387fae35fbfff1e4f54234f72fec.jpg) [cut] . The competition consists of two contests: an Individual-based OI-formatted round and a Team-based ACM-formatted round. You can visit the rounds as information listed below: - **Individual Round One** _(July 14)_: written by low_ and lantrungseo, consists of 4 OI problems:...
schools: Hanoi-Amsterdam High School and Nguyen Hue High School. 3-people organizing committee

Full text and comments »

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

231.
By markysha, 9 years ago, translation, In English
Useful and not so useful links _Some time ago I collected useful links from Codeforces, some of them are really cool, some are not._ _Dtaft was created about a year ago, now it is June of 2019._ _My friend asked me to give him some cool blogs from Codeforces, and I remembered about that blog._ _So that is the reason why this blog is posted)_ _P.S. some blogs are only in russian_ <spoiler summary="algorithms"> [Non-recursive segment tree tutorial](http://codeforces.me/blog/entry/1256) [user:Urbanowicz,2017-10-21] [Efficient and easy segment trees](http://codeforces.me/blog/entry/18051) [user:Al.Cash,2017-10-21] [Dynamic connectivity problem](http://codeforces.me/blog/entry/15296) [user:adamant,2017-10-21] [Suffiex tree. Basics. Build in O(nlogn)](http://codeforces.me/blog/entry/11337) [user:adamant,2017-10-21] [K-th statistics on a range](http://codeforces.me/blog/entry/2954) [user:yarrr,2017-10-21] [[Tutorial] Sack (dsu on tree)](http://codeforces.me/blog/entry/44351) [user:arp...
) [user:himanshujaju,2017-10-21] [Counting Divisors of a Number in O(N^(1/3 ))](http://codeforces.com, ] [Counting Divisors of a Number in O(N^(1/3 ))](http://codeforces.me/blog/entry/22317

Full text and comments »

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

232.
By etal, history, 11 years ago, In English
Analyzing rating formulas In this post I'll try to expose the results of my research regarding the rating formula. More specifically, I'll show a graph that gives you a match rating according to your performance in a contest and some aspects of how ratings are updated. **This post is quite large, if you are only interested in the results you can easily skim through it :)** [cut] _Disclaimer_: I'll try to support my assumptions and assertions with data but, altough I have done the analysis carefully, I may have done a mistake :) Moreover, take into account that some of my formulas are approximations. Motivation ================== Almost two years ago I started to participate in contests more actively, aiming to be red one day. To increase my motivation I tried to find a formula that evaluated how well I did during a competition. At that time there were no API nor [user:DmitriyH,2015-06-21]'s statistics so I manually looked at a lot of profiles to try to find 'stable' points: users that didn't change...
{MatchPerformance}-\text{OldRating}}{3}$$ The 1st formula was a good approximation, but started to fail

Full text and comments »

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

233.
By usaxena95, 10 years ago, In English
SOS Dynamic Programming [Tutorial] ## Introduction In this post, I am going to share my little knowledge on how to solve some problems involving calculation of **Sum over Subsets(SOS)** using dynamic programming. Thus the name **SOS DP**. I have chosen this topic because it appears frequently in contests as mediu2m-hard and above problems but has very few blogs/editorials explaining the interesting DP behind it. I also have a predilection for this since I came across it for the first time in ICPC Amritapuri Regionals 2014. Since then I have created many questions based on this concept on various platforms but the number of accepted solutions always seems to be disproportionate to the lucidity of the concept. Following is a small attempt to bridge this gap &#128521; ## Problem I will be addressing the following problem: Given a fixed array **A** of $2^N$ integers, we need to calculate &forall; x function **F(x)** = Sum of all **A[i]** such that **x&i = i**, i.e., **i** is a subset of **x**.<br> $$ F[mask] = ...
]; } } ``` Not as trivial, this solution is more efficient with time complexity of $O(3^N)$. To calculate

Full text and comments »

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

234.
By bitthal04, history, 13 months ago, In English
Correct way of presenting the answer in meta hacker cup? I was participating in meta hacker cup as practice round is going on now. But for 2/3 questions for which the submissions i made i got presentation error. And at this point i am not able to figure out much what were the difference between them. So can someone tell me how to handle this so i don't mess up because of this.(As the contest is still going on i am not sure if i should share my code here but if someone wants i can share it to him/her personally). Edit: One thing which i forgot to mention i solved some problems from last year as well and all those question which had single line output like "Case #1: 5" these tend to work fine but only those which had multiple lines output seem to fail(Not sure if that's the correct reasoning or not).
Correct way of presenting the answer in meta hacker cup?, I was participating in meta hacker cup as practice round is going on now. But for 2/3 questions for

Full text and comments »

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

235.
By A00000, 12 years ago, In English
Number of integral solutions to a linear equation $$x_1+x_2+x_3+\dots+x_{n-1}+x_n= S$$ [cut] Given an equation like this: $$x_1+x_2+x_3= 5$$ The general solution to such an equation is ${5+3-1 \choose {3-1}}$. Where did that come from, basically to solve the previous equation we re-model it into another equivalent type of easily solvable combinatorics problem which is counting the number of possible arrangements for the following string "0011111" the answer for this is $\frac{7!}{{5!}.{2!}}$ which is equal ${7 \choose 2}$ which is equal to number of solutions to the equation, how did this happen, we say that the "1"s represent the answer of the equation and the "0"s represent the number of variables -1, let's clear that a bit, for a string like that "0011111" this means $x_1= 0, x_2= 0, x_3= 5$, another string like that "1101011" means $x_1= 2, x_2= 1, x_3= 2$, lastly a string "1111100" means $x_1= 5, x_2= 0, x_3= 0$. So you see that the answer of the number of arrangements of the string is actually the answer...
$$ The general solution to such an equation is ${5+3-1 \choose {3-1}}$. Where did that come from

Full text and comments »

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

236.
By Morgan_HackProg, 14 years ago, In Russian
Russian Code Cup 2013 Уже пришло время анонсировать соревнование Russian Code Cup 2013. Собственно, на данный момент уже известно расписание раундов (дублирование с официального сайта): Первый квалификационный раунд 2 часа 13 апреля, 19:00 Второй квалификационный раунд 2 часа 11 мая, 12:00 Третий квалификационный раунд 2 часа 2 июня, 14:00 Отборочный раунд 3 часа 16 июня, 14:00 Финальный раунд 3 часа 23 сентября, 11:00
Russian Code Cup 2013

Full text and comments »

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

237.
By ytml20010, history, 6 years ago, In English
Is it true that top companies offer jobs/internships for top contestants in their organized contests? Hello Codeforces Every year big companies like Google and Facebook organize many programming contests, like Google hash code, Google code jam, Facebook hacker cup... I was wondering, is it really true that top contestants are offered jobs/internships at these companies? someone told me that this year everyone who reached Facebook hacker cup round 3 were offered internships and every one who reached the onsite contest got a job offer at Facebook. Can anyone please confirm or deny that? Please share your knowledge with the community.
contests, like Google hash code, Google code jam, Facebook hacker cup... I was wondering, is it really, hash code, Google code jam, Facebook hacker cup... I was wondering, is it really true that top

Full text and comments »

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

238.
By calculus.saransh, 15 years ago, In English
Codeforces Beta Round #78 Div 2 (ABC solutions) <p>I ended up solving 3 questions.. the 3rd one took me a lot of time because I manually pre-computed all the configurations and wrote them in my code.</p><div><br></div><div>Here is a short description on how I solved the 3 problems hopefully it is helpful.</div><div><br></div><div><b>Problem A</b></div><div><b><br></b></div><div>The first problem required manual checking. As I use Java, StringTokenizer helped me to break the string using '.' as the delimiter. As I had 2 strings I could check for the last character of the first string and if it was equal to 9 I printed "<span class="Apple-style-span" style="font-family: 'courier new'; font-size: 15px; line-height: 21px; ">GOTO Vasilisa." </span>and for the other case I checked if the first char of the other string was greater than '5' if yes I added 1 to the first strings last char else print the same string.</div><div><br></div><div><b>Problem B</b></div><div><b><br></b></div><div>Problem B was easier considering the mathematical nat...
I ended up solving 3 questions.. the 3rd one took me a lot of time because I manually pre

Full text and comments »

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

239.
By MikeMirzayanov, 11 years ago, In Russian
Летняя школа Сазанка-2015 <img src="http://assets.codeforces.com/photos/sazanka-2010/large-IMG_2742.JPG" style="width:350px;float:right;margin:1em;"> ### Общая информация Саратовский государственный университет в первой половине августа проводит международную летнюю студенческую школу по программированию. Продолжительность школы &mdash; десять дней, школа пройдет с 3-го по 13-е августа 2015 года. К участию приглашаются как команды из двух-трех человек, так и индивидуальные участники. Школа пройдет в живописном месте, на одной из саратовских баз отдыха на берегу Волги. Участники будут расселены в уютных номерах по 2-4 человека и обеспечены трехразовым питанием. На территории базы имеется собственный пляж и спортивные площадки. В программе школы запланировано 10 рабочих дней, включающих ежедневные пятичасовые тренировки, разборы задач, дорешивания. Будет прочитана серия лекций. Учебная программа рассчитана на студентов младших и средних курсов, которые хотят достичь значительных успехов н...
соревнований TopCoder, Google Code Jam, Facebook Hacker Cup и других. Руководитель Центра олимпиадной

Full text and comments »

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

240.
By ivan.popelyshev, 15 years ago, In Russian
КРОК-2012 небольшой отчётик 27-ого апреля состоялся финал соревнования КРОК-2012. Я трагически прогулял 1-ый раунд, и я наверное единственный, кто не нервничал на ивэнте. Московский офис компании КРОК пустил корни между метро Курская и Площадью Ильича. После регистрации участников, Михаил Мирзаянов толкнул бодрящую вступительную речь, которую я, к сожалению, проспал :( Состав участников получился очень молодым: почти все папки укатили на Challenge24 (что не повлияло на хавку: в середине дня был фуршет) Сам финал должен был начаться в 5 вечера, а до этого участников развлекли Code Game Challenge-эм. Нужно было написать бота, который бы перемещался по полю, пил поушены маны и здоровья, швырял в противников всякие нехорошие заклинания или просто бил их посохом (что большинство времени и делал занявший 8-ое место MyasnoyRobot). <a href="http://popelyshev.ru/wp-content/uploads/2012/05/IMG_0482.jpg"><img class="alignnone size-medium wp-image-57" title="IMG_0482" src="http://popelyshev.ru/wp-content/uplo...
финал должен был начаться в 5 вечера, а до этого участников развлекли Code Game Challenge-эм. Нужно

Full text and comments »

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

241.
By csacademy, 10 years ago, In English
Romanian IOI 2017 Selection #1 Hello, Codeforces! The first round of Romania's IOI 2017 Selection Contests took place a week ago. [CS Academy](https://csacademy.com/) will host the [online mirror](https://csacademy.com/contest/romanian-ioi-2017-selection-1/) on [Sunday, 14/May/2017 09:00:00 (UTC)](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Romanian+IOI+2017+Selection+%231&iso=20170514T09&p1=1440&ah=5). You will have to solve **3** problems in **5** hours. The statements will be available in English and Romanian. **Update**: The round will be **unrated** because of the overlap with Russian Code Cup. #### Contest format: - You will have to solve **3** tasks in **5** hours. - There will be full feedback throughout the entire contest. - The tasks will have partial scoring. The maximum score for each problem will be 100 points. - There will be no tie breaker, so two users having the same total score at the end of the contest will share the same place in the standings. #### Support for cou...
Romanian. **Update**: The round will be **unrated** because of the overlap with RussianCode Cup

Full text and comments »

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

242.
By bfsof123, 21 month(s) ago, In English
Learning Notes on the Hopcroft-Tarjan planarity algorithm (With C++ Implementation) **Section 1. Introduction** I have been struggling for weeks to understand the first linear-time planarity algorithm, the [Hopcroft-Tarjan algorithm (HT)](https://www.cs.princeton.edu/courses/archive/fall05/cos528/handouts/Efficient%20Planarity.pdf). Fortunately, I successfully understood it and implemented it. In fact it is very hard to find a verified HT implementation online. Some code, e.g., [LEDA](https://en.wikipedia.org/wiki/Library_of_Efficient_Data_types_and_Algorithms) is not open source. Other open-source planarity tests, e.g., [networkx (LR planarity)](https://github.com/networkx/networkx/blob/main/networkx/algorithms/planarity.py), [boost (Boyer-Myrvold)](https://www.boost.org/doc/libs/1_53_0/libs/graph/doc/boyer_myrvold.html), [Pigale (LR planarity)](https://pigale.sourceforge.net/), use other algorithms. There is [an implementation by Shawn Anderson](https://github.com/shawnwanderson/Hopcroft-Tarjan-Planarity-Testing), however it is partial. I would like to open a blo...
/7b79e3e3b7c31e691d2a9e6782723179bc4633e4.png) **Section 3. Implementation** Code is here:

Full text and comments »

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

243.
By tibinyte2006, 4 years ago, In English
[Tutorial] Cartesian tree and some related problems The Cartesian Tree is a useful concept for solving some problems which revolve mainly about thinking of the range of maximality of elements. It also provides a sort of "persistance" to the algorithm of monotonic stack, if you will. In this blog, we will learn what a Cartesian Tree is, how to construct one and solve some related problems to strengthen our understanding. Let's begin! <hr> #### What is a Cartesian Tree? Let's consider an array $a$ where all values are distinct. The Cartesian Tree for the array $a$ is a binary labeled tree build recursively from the function $get(l,r)$ which constructs our desired tree from the subarray $l...r$. Now let's define $get(l,r)$ - First root the tree at index $i$ such that $a_i = min(a_l,a_{l+1},...,a_r)$. Note that because all values are distinct, $i$ will always be unique. - The aforementioned index will become the root of the Cartesian Tree. It's left and right subtrees will be recursively generated by $get(l,i-1)$ and $get(...
$ - $l_{i+2} = l_{i+1} \cup l_{i+2}$ - $r_{i-1} = r_{i-1} \cap [1,2,3,...,a_{i+1}]$ - $r_i

Full text and comments »

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

244.
By Gheal, history, 5 years ago, In English
Infoleague Winter 2022 Round 1 Div. 2 Editorial I would like to apologize for the checker issue with problem C. I selected `std::ncmp` out of habit and forgot to change it afterwards. I would also like to apologize for taking so long to fix the issue. The model solution for div1A was also wrong, and I decided to fix that first. Nonetheless, we still hope that you enjoyed our problems in both Div. 1 and Div. 2. [103503A &mdash; Make Sum Great Again](https://codeforces.me/gym/103503/problem/A) ------------------ Author: [user:Gheal,2022-01-08] <spoiler summary="Hint 1">It is always optimal to add the smallest integer which is not already in the array.</spoiler> <spoiler summary="Hint 2">The number of operations will never exceed $\sqrt{2 \cdot s}.$</spoiler> <spoiler summary="Hint 3">Based on the first hint, the final array will be equal to $\{v_1,v_1,\ldots, v_n\} \cup [1,x]$, for some $x$.</spoiler> <spoiler summary="Hint 4">Hint 4: How can we find the value of $x$ faster than $O(\sqrt{s})$?</spoiler> <spo...
exceed $\sqrt{2 \cdot s}.$ Based on the first hint, the final

Full text and comments »

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

245.
By pathetique, history, 2 years ago, In English
COderfocers Codeforces | In English По-русски pathetique | Logout HOMETOPCATALOGCONTESTSGYMPROBLEMSETGROUPSRATINGEDUAPICALENDARHELP → Pay attention Before contest Codeforces Global Round 26 3 days Register now » *has extra registration → pathetique pathetique User''s contest rating in Codeforces communityRating: 1448 User''s contribution into Codeforces communityContribution: -77 Settings Blog Favourites Teams Submissions Problemsetting Groups Talks Contests → Top rated # User Rating 1 tourist 3757 2 jiangly 3647 3 Benq 3581 4 orzdevinwang 3570 5 Geothermal 3569 5 cnnfls_csy 3569 7 Radewoosh 3509 8 ecnerwala 3486 9 jqdai0815 3474 10 gyh20 3447 Countries | Cities | Organizations View all → → Top contributors # User Contrib. 1 maomao90 171 2 awoo 164 3 adamant 163 4 TheScrasse 159 5 maroonrk 155 6 nor 154 7 -is-this-fft- 152 8 Petr 147 9 orz 145 10 pajenegod 144 View all → → Favourite groups # Name 1 X-Camp 402H 2022 Fall View all → → Fi...
HOMETOPCATALOGCONTESTSGYMPROBLEMSETGROUPSRATINGEDUAPICALENDARHELP → Pay attention Before contest Codeforces Global Round 263 days

Full text and comments »

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

246.
By Flamire, history, 2 years ago, In English
EPIC Institute of Technology Round August 2024 (Div. 1 + Div. 2) Editorial [2002A &mdash; Distanced Coloring](https://codeforces.me/contest/2002/problem/A) idea & solution: [user:xcyle,2024-08-12] <spoiler summary="Hint 1"> Consider the case with $n=m=k$. </spoiler> <spoiler summary="Hint 2"> Generalize the solution for all $n,m,k$. </spoiler> <spoiler summary="Tutorial"> It can be shown that for any $k\times k$ subgrid, the colors we use must be pairwise distinct. Thus, we have an lower bound of $\min(n,k)\cdot\min(m,k)$. We can show that this lower bound is indeed achievable by coloring the upper-left $\min(n,k)\cdot\min(m,k)$ subgrid with distinct colors, and copy-pasting it to fill the rest of the grid. Time complexity: $O(1)$. </spoiler> <spoiler summary="Solution"> ~~~~~ #include <bits/stdc++.h> using namespace std; int t, n, m, k; int main() { scanf("%d", &t); while (t--) { scanf("%d%d%d", &n, &m, &k); printf("%d\n", min(n, k)*min(m, k)); } return 0; } ~~~~~ </spoiler> [2...
$. For more details, please refer to the solution code. There also exists $O(n\log n)$ solutions

Full text and comments »

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

247.
By mrittunjoysarkerakash, history, 6 years ago, In English
Need Help in Mixing Water(1359-C) Hello Code forces, I am trying this problem [problem:1359C]. My IDE returns right values with my code, but CF judge said that `function returns nothing`(In test 2). So what should I do? <spoiler summary="Here is my code"> ~~~~~ #include"bits/stdc++.h" using namespace std; #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define ll long long #define ld long double #define nl "\n" ld temperature(ld h,ld c,ll cups) { return (double)((h*cups)+c*(cups-1))/(2*cups-1); } ll bin_search(ld h,ld c,ld t) { ld dif=1e12; ll f; ll low=3,high=1e12; while(low<=high) { ll mid=(low+high)/2; f=mid; ld s=temperature(h,c,mid); if(abs(t-s)>abs(t-dif)) return f; f=mid; if(temperature(h,c,mid)>t) { low=mid+1; }else { high=mid-1; } } } int main() { IOS; int T; cin>>T; while(T--) { ld h,c,t; cin>>h>>c>>t; if(t>=h) cout<<"1\n"; else if(t<=(h+c)/2) cout<<"2\n"; else cout<<2*(bin_search(h,c,t))-...
Hello Code forces, I am trying this problem [problem:1359C]. My IDE returns right values with my

Full text and comments »

248.
By Nickolas, 15 years ago, translation, In English
Surprise Language Round #6 The contest is over; the editorial is [here](http://codeforces.me/blog/entry/4633). I've mis-estimated the complexity of the problems --- but how could I possibly guess who will arrive and finish everything in 40 minutes :-) Congratulations to the winners --- the slowest and the most relaxed of them took under an hour to solve all the problems. ----- Today's round features Roco --- a little-known esoteric language with a special approach to loops and subroutines. The programs written in it look a bit bulky, especially when compared to Befunge, but this is compensated by their relative simplicity and readability. Here is a program which calculates the sum of two given numbers: ~~~ iin [0] iin [1] add [2] [1] [0] iout [2] ac ~~~ There is little information about this language on the web --- the only two sources known to me are [the author's site](http://lodev.org/esolangs/roco/) and [Progopedia article](http://progopedia.com/language/roco/) with commented sampl...
code into an executable file and run programs using command "roco program.roco". You can download the

Full text and comments »

Announcement of Surprise Language Round 6
  • Vote: I like it
  • +79
  • Vote: I do not like it

249.
By tomasf, history, 9 years ago, In English
2017 USP-ICMC Editorial #### [A &mdash; Bath Temperature](http://codeforces.me/gym/101484/problem/A) **Problem author:** [user:teochaban,2017-08-18] <spoiler summary="Solution"> **Editorial author:** [user:tomasf,2017-08-29] If any tap has the desired temperature, there is no need to open a second tap, so the answer is 1. Since the resulting temperature is a weighted mean of the opened taps, all obtainable temperatures are between the minimum and maximum temperature available on the taps. If the desired temperature is outside that range, the answer is -1. Otherwise, we can use the minimum and maximum temperature to obtain the desired temperature, so the answer is 2. **Overall Complexity:** $O(N)$ **Code([user:tomasf,2017-08-22]):** [Link](https://pastebin.com/dmSX2L39) </spoiler> #### [B &mdash; Nicoleta's Cleaning](http://codeforces.me/gym/101484/problem/B) **Problem author:** [user:tomasf,2017-08-18] <spoiler summary="Solution"> **Editorial author:** [user:tomasf,2017-08-29] ...
)$ **Code([user:tomasf,2017-08-22]):** [Link](https://pastebin.com/dmSX2L39) #### [B

Full text and comments »

Tutorial of 2017 USP-ICMC
  • Vote: I like it
  • +62
  • Vote: I do not like it

250.
By gelastropod, history, 8 days ago, In English
Interesting property of trees _This blog is coauthored by [user:gohchingjayk,2026-11-15]._ Hello Codeforces! In this blog, we will first introduce this property, and then use it to improve the solution to [problem:2260F]! =D ### What is the property? <p><b>Theorem 1.</b> <i>Suppose we have a set $S$ which is a subset of the vertices on a rooted tree. Now, let $T = \lbrace \operatorname{LCA}(u, v) \mid u, v \in S \rbrace$. We claim that $|T \setminus S| \le |S| - 1$.</i></p> <p><i>Proof.</i> Consider the Eulerian Tour of the tree. Let $pre_u$ be the first visit of node $u$ in the Eulerian Tour. It is known that $\operatorname{LCA}(u, v)$ is the node of the minimum depth between $pre_u$ and $pre_v$ (inclusive). </p> Now, consider 2 nodes, $u, v \in S$. Suppose there exists node $x \in S$ such that $pre_u < pre_x < pre_v$. Observe that the node of minimum depth between $pre_u$ and $pre_v$ is either $\operatorname{LCA}(u, x)$ or $\operatorname{LCA}(x, v)$. There are exactly $|S| - 1$ pairs $u, v \i...
" edges. We can define $T$ similarly to above, and let $S'=S\cup T$. It is easy to see that $|S'|\le 4

Full text and comments »

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

251.
By Copymaster, 14 years ago, In Russian
Баг в решении RCC Round 1 — C Задача C в первом раунде Russian Code Cup была скорее математической, чем программистской, поэтому получить WA #3 по ней было вдвойне неприятно и обидно. Решение задачи сводилось к тому, чтобы вывести двойку, возведенную в определенную степень. Несколько раз прочесав весь код и перепроверив корректность доказательства, бага в решении мне найти не удалось. В конце концов единственное, что пришло мне в голову &mdash; это заменить вызов функции `pow(2, ...)` на `pow(2ll, ...)` (функция `long long pow(long long a, long long b)` возвращала `(a ^ b) % 1000000007)`. Казалось бы, аргументы функции все равно имеют тип long long, поэтому эта двойка должна была так или иначе к long long'у привестись. Каково же было мое удивление, когда новая посылка получила accepted! На контесте ни времени, ни желания разбираться не было, а сегодня я послал в тренировку на Codeforces два решения, отличающиеся только в вызове функции pow от аргумента 2 или 2ll соответственно (на контесте я делал в программе ещё к...
Задача C в первом раунде Russian Code Cup была скорее математической, чем программистской, поэтому

Full text and comments »

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

252.
By MikeMirzayanov, 17 years ago, translation, In English
Introduction <div style="float: left;margin: 1.0em;font-size: 11.0px;text-align: center;"><br><img alt="The team captain Natalia Bondarenko" src="http://lh5.ggpht.com/_mSdPzSw5zAo/S2bNbN16BJI/AAAAAAAADIc/bz6GQyvSLpQ/natasha.jpg" title="The team captain Natalia Bondarenko"> <br> The team captain Natalia Bondarenko </div> January 30, 2010 the delegation of the Saratov State University is leaving for the World Finals of the International Collegiate Programming Contest. This year it's held in Harbin (hi, China), and that means that apart from an interesting contest, we have cold weather, ice statues, fried rice with prawns, and as I hope, Beijing Duck. <p> Our University will take part in the Contest for the 7th time, and for the team Saratov SU#1 this will be the 2nd Finals. It seems to be high time to introduce myself. I'm Mike Mirzayanov, and I'm this team's coach (and also all other teams from my university). In reality I'm the director of Programming Competitions ...
ICPC, and in the finals of Google Code Jam, and onsite competitions by TopCoder (TCO and TCCC both

Full text and comments »

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

253.
By Egor, 14 years ago, In English
CHelper 3.9 I would really appreciate any new ideas of what new features to add I would also appreciate [donations](https://money.yandex.ru/embed/shop.xml?account=410011732687384&quickpay=shop&payment-type-choice=on&writer=seller&targets=CHelper&targets-hint=&default-sum=100&button-text=03&successURL=) ----- 3.99 Kattis support for both Chrome and Contest parsers. You'd need to accept new permissions for Chrome extension. Good luck at ACM ICPC World Finals online contest! ----- 3.98 Codechef fix ----- 3.97 Fixed issue with template selection and Chrome plugin interaction ----- 3.96 Smallish update &mdash; you can now select task template per task. You can have several templates for general tasks, one where you need to output with Case #, GCJ where you need to integrate parallelization and similar ----- 3.95 Support for Idea 14.1+ Parsers for RCC and USACO fixed You can now parse other Codeforces contests when live contest is ongoing Sorry fo...
) ----- 3.70 Facebook Hacker Cup and USACO support through Chrome plugin. Also HackerRank should work

Full text and comments »

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