Agnimandur's blog

By Agnimandur, history, 8 months ago, In English

Episode 2

This interview is with Oleh Naver (oleh1421). This interview was focused on the International Olympiad in Informatics. Oleh is a two time gold medalist at the IOI, including a 14th place finish at IOI 2022. We discussed his introduction to competitive programming, and his preparation for the IOI itself. Congratulations to him on his excellent performances!

If you are a high school student currently preparing for your local olympiad, or maybe the IOI itself, you might find this interview of interest.

Question List

  • 0:15 "How did you first get exposed to competitive programming?"
  • 5:25 "Tell us about your experience at IOI 2022 in Indonesia."
  • 10:12 "What advice would you give to a high school student preparing for the IOI?"
  • 14:09 "How important was Codeforces to your competitive programming journey?"
  • 17:18 "Where do you see yourself in the near future?"

Full text and comments »

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

By Agnimandur, 11 months ago, In English

Hello. If you're talented at competitive programming and interested in working for Recursive Dragon as a mentor, send me a message on Codeforces or through Discord (Agnimandur#9256).

Full text and comments »

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

By Agnimandur, history, 13 months ago, In English

New Interview Series

Hello Codeforces! I'm beginning a new interview series, talking to famous icons in the world of competitive programming! We talk about competitive programming, updates in their lives, and other things the community might find interesting. If you think you're an icon, and want to be interviewed, send me a message! :)

Episode 1

This interview is with Um_nik. Learn about his favorite problem (from Topcoder), his advice for students preparing for IOI, and his new venture/educational series, Um!

Question List

  • 0:25 "When did you start competitive programming, and how did you get into it?"
  • 1:56 "What was competitive programming like, ten years ago?"
  • 3:02 "How did you practice in 2015, the year you went from 2500 to LGM?"
  • 5:18 "Your favorite problem? (linked below!!)"
  • 12:40 "What advice would 2023 Um_nik give 2015 Um_nik?"
  • 14:17 "If you could trade all your CP knowledge, for $10 million dollars, would you?"
  • 15:19 "If you lost all your CP knowledge, would you re-learn it from scratch?"
  • 15:51 "If you had any advice for a high school student practicing for the IOI, what would it be?"
  • 18:02 "Let's talk about Um and your Youtube channel"
  • 21:31 "RIP Google Codejam, any specific moments you remember or cherish?"
  • 24:20 "Who do you think the second best competitive programmer active today?"

Full text and comments »

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

By Agnimandur, history, 16 months ago, In English

Hello guys!

It would really useful for me to categorize the USACO problems based on their difficulty and their "USACO Guide" category (Simulation, DFS, segment tree, etc), mirroring what the USACO Guide does but for every problem.

Additionally, there's some interesting room for ML research on AI-based classification. If anyone has experience in that, it would be highly appreciated.

I'm willing to pay $300 (or more) for someone with the time for this project. If you're interested and are at least decently experienced at competitive programming, please DM me. Thanks!

Full text and comments »

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

By Agnimandur, history, 18 months ago, In English

Overview

Organizations on Codeforces roughly fall into three categories: - Schools or Universities (ITMO, MIT, etc.) - Companies (Google, Apple, etc.) - Organizations (USACO, jiangly fanclub, etc.)

Many people are torn on whether to represent their school or organization, or company and organization. For example, I would want to be in "Carnegie Mellon University" and "USACO".

I'm sure many people would love to show their school pride while also showing their undying devotion to jiangly.

Solution

I propose allowing users to be in up to TWO organizations on Codeforces. The second organization would be listed immediately underneath the first organization. Additionally, the social tab on your profile would be modified to have a "Primary Organization" and "Secondary Organization".

Full text and comments »

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

By Agnimandur, history, 22 months ago, In English

Background

Recently, it was announced by MikeMirzayanov that NEAR would be contributing to the funding of Codeforces. Clearly, the influx of additional funding was very important to Codeforces. In this blog I want to look at the NEAR cryptocurrency in more detail, and analyze the possibility of a complete collapse.

The Story of Terra Luna

Luna Price Graph Between May 5 and May 12th, the cryptocurrency Terra Luna lost all of it's value: wiping $45 billion off of the crypto market.

What were the "fundamental design mistakes" (according to the Binance CEO) of Terra Luna? Perhaps simply the entire idea of an algorithmic stable coin.

A "stable coin" is merely a cryptocurrency whose value is supposed to remain fixed, usually relative to the dollar. For example, the stable coin USDC has had a maximum price deviation of only a tenth of a percent from its pegged value of 1 US dollar.

The so-called breakthrough of Terra Luna was a "decentralized" stablecoin that was not tied to a governmental currency. The blockchain was home to two cryptocurrencies: Terra (UST), which was supposed to be a stablecoin fixed at 1 dollar, and Luna (LUNA) which was supposed to be a normal volatile cryptocurrency.

Terra Luna: A Cryptocurrency Balanced on a Tightrope

French tightrope walker Phillippe Petit A sophisticated algorithm linked Terra with Luna. Luna was used to maintain Terra's stability, and Terra's stability was used to preserve Luna. Anyone could "burn and mint" 1 UST, and receive $1 worth of LUNA in return. The final fallback was $3 billion in Bitcoin reserves.

A reasonably accurate analogy was that Terra Luna was like a tightrope walker. While the winds were calm the pole would be enough to keep everything balanced.

A Classic Run Ensues

The spark that set off the fire will probably never be known (social media rumors suggested that a massive $1 billion liquidity crunch caused by Citadel was to blame). Anyways, a general downturn in the cryptocurrency market was causing all investors to rethink their crypto portfolios.

As people began to dump their UST holdings, causing massive hyperinflation in LUNA, the peg between the two currencies began to collapse. Attempts were made to save the peg via injecting Bitcoin, but the Terra blockchain simply didn't have enough liquidity to save itself. As it became clear that UST was not going to maintain it's $1 peg (thus making it essentially worthless since its entire point was to be a "stable" coin), both cryptos collapsed in a death spiral together.

The Tragic Aftermath

Both UST and LUNA lost almost all of their value: tens of billions of dollars were wiped off of the cryptocurrency market in approximately a week. Naive attempts to resurrect the Terra blockchain have been dissapointing, and thousands of avid #Lunatics rightfully feel like they were scammed. It became obvious that ALL "stable"-coins are vulnerable to total collapse if they lack the liquidity to maintain their peg to the dollar.

The NEAR Protocol

NEAR Protocol Logo NEAR is a cryptocurrency based off the #2 crypto Ethereum's blockchain. NEAR's main improvement is that it can process transactions much faster than Ethereum can via technical improvements discussed here. This makes it extremely useful for large-scale projects that need to process thousands of monetary transactions per second. Additionally, 15% of NEAR's original employees were ICPC medalists. :O

Potential Risk to NEAR?

NEAR itself is not a stablecoin, so it's not going to face the same hyperinflation that happened to Luna. Indeed, there are many technical and economic benefits to NEAR that make it a highly efficient and sustainable cryptocurrency. However, as a relatively small cryptocurrency, NEAR is acutely vulnerable to many of the same triggers that caused the Terra Luna collapse. Indeed, NEAR has lost more value that the mainstream crypto market (75% versus the average market loss of about 50%).

The main issue revolves around "staking". Simply put, staking is like when you invest money in a bank: you get a steady rate of return on the invested money. Whereas Terra Luna had a staking rate of return of nearly 20% (eliciting comparisons to a Ponzi scheme), NEAR has a much more modest rate of return of about 5%.

Approximately 90% of all NEAR coins are currently being "staked". However, investors can withdraw their coins from staking pools in as little as 48 hours. Additionally, their is a "Rainbow Bridge" connecting Ethereum to NEAR.

The fundamental risk to NEAR is, of course, a liquidity crunch akin to the one that destroyed the Terra blockchain. If investors rapidly withdrew their NEAR from being staked and attempted to use the Rainbow Bridge to translate those coins to ETH (which is a much stronger cryptocurrency than NEAR), would the NEAR blockchain have enough Ethereum on hand? I think it's highly unlikely. Additionally, attempts to close the Rainbow Bridge connecting the two currencies would probably only further devalue NEAR. Lastly, many of the technology improvements NEAR repeatedly boasts about may soon become a moot point: very shortly, the long awaited Ethereum 2.0 will be released, that fixes many of the original scalability issues with the ETH blockchain. With ETH completely absorbing the niche that NEAR briefly occupied, it's possible that investors may slowly move away from NEAR.

My Final Words

Of course, I'm highly grateful for NEAR for funding Codeforces in these difficult times for the website. However, I'm highly skeptical of NEAR's longterm prospects as a cryptocurrency, especially given the vivid example of Terra Luna's collapse.

If anyone has thoughts about the NEAR Protocol, please reply to the blog. Thanks!

Full text and comments »

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

By Agnimandur, history, 2 years ago, In English

All problems were created and prepared by me and magnus.hegdahl. Thanks to BucketPotato, Monogon, and Priyam2k for valuable feedback and testing. Special thanks to MikeMirzayanov for coming up with the idea and preparing the unique checker for 1663H - Cross-Language Program. I hope you enjoyed the contest, and found it to be an interesting series of puzzles.

Example solution code written by Agnimandur is provided for each problem.

1663A - Who Tested?

Clue 1
Clue 2
Solution
Solution Code (Python)

1663B - Mike's Sequence

Clue 1
Clue 2
Clue 3
Solution
Solution Code (Python)

1663C - Pōja Verdon

Clue 1
Clue 2
Solution
Solution Code (Python)

1663D - Is it rated - 3

Clue 1
Clue 2
Solution
Solution Code (Python)

1663E - Are You Safe?

Clue 1
Clue 2
Solution
Bonus Clues (for other problems)
Solution Code (C++)

1663F - In Every Generation...

Clue 1
Clue 2
Clue 3
Solution
Solution Code (Python)

1663G - Six Characters

Clue 1
Clue 2
Clue 3
Solution
Solution Code (Python and Javascript)

1663H - Cross-Language Program

Solution

Full text and comments »

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

By Agnimandur, history, 2 years ago, In English

With Nickolas not writing a contest this year, magnus.hegdahl and I have decided to take up this sacred duty :). We would like to invite everyone on Codeforces to the April Fools Day Contest 2022. Special thanks to BucketPotato for volunteering to test this contest!

The 10th April Fools Day Contest will take place on Apr/01/2022 17:35 (Moscow time). This is a joke competition in which solving the problem is often easier than figuring out what the actual task is.

In this round you'll be given several weird problems and 2 hours to solve them. The contest will use ACM ICPC rules (no hacks, the standings are decided by the number of solved problems and penalty time earned on them), and it will be unrated. You can submit solutions in any language allowed by Codeforces, unless the problem says otherwise. To get an idea of what the contest will look like, you can check out the contests of the past years: 2012, 2013, 2014, 2016, 2017, 2018, 2019, 2020, 2021.

Good luck, and have fun!

UPD: There will be 8 problems. There will be only be an interactive problem if the Collatz Conjecture is true...

UPD: Thanks to everyone who participated! I hoped you enjoyed thinking over the problemset. The editorial is available, complete with solution code and hints. Special congratulations to the winners.

Rank Username Score
1 Lotus 7 (330)
2 DeepOcean 7 (339)
3 xyf007 7 (341)
4 Tyyyyyy 7 (345)
5 Flamire 7 (345)

Full text and comments »

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

By Agnimandur, 3 years ago, In English

Hello Codeforces!

Coaching

I am a USACO Platinum contestant, former Codeforces International Master rated 2377, Leetcode 2600, member of the Binarysearch.com contest team, and author of Codeforces Round 736 (Div. 1) and Codeforces Round 736 (Div. 2). I'm offering one on one competitive programming lessons OR leetcode practice, online over Zoom.

  • I can help you get better at USACO.
  • I can help you gain Codeforces rating.
  • I can help you with Leetcode.com and Binarysearch.com problems. I can help explain common interview programming techniques.

Price

The price is $50 an hour due to exceptionally high demand.

Interest

If you're interested, please send a direct message to Agnimandur over Codeforces! Alternatively, send a direct message over Discord to Agnimandur#9256.

Frequently Asked Questions

Suggest more questions in the comments and I'll respond to them up here!

  1. What's your coaching method and why do you think it will help in a problem solving? My coaching ideology is simple: the only way to improve is to practice. You have to be willing to put in the time and energy to practice. I come in by helping guide your practice: I can point out common ideas, so that you can look out for them in later problems. I can discuss coding details, so that you can solve problems faster later. And I can hopefully instill in you the confidence to solve harder problems, without giving up or looking at editorial.

  2. Why do you think people have to pay you instead of, for example, solving random problems? In what your lessons better than practicing independently and why does it worth $20 per hour? You can solve random problems if you'd like. I only offer my services as an option, if you feel like you need more direction and mentorship. $20 is a reasonable market rate.

  3. Do you understand that gaining mathematical thinking skill (if you don't have it form birth, that is true for 99%) is hard and long process that require many years? And no coach can significantly speed up this process. Nevertheless, this skill is crucial for problem solving. Tell the truth to people, how long will they need to take lessons from you and, therefore, pay you, to reach at least 2000 rating? Absolutely, problem solving skill is something no coach can "teach" you. What coaches can do is hone that skill. Everyone can solve difficult problems if they have the encouragement, willpower, and time to solve them. Many hours of practice will make the difference, not just one coach. Do not expect a miracle improvement to 2000 if you don't want to put in many hours of your own time.
  4. I know that people from top 100 (I won't say who exactly, just dm some youtubers) are ready to give lessons for even cheaper, why not to take lessons from more skilled experienced people for less cost? Perhaps, but are these classes 1 on 1? I know Errichto does group lessons.
  5. Will there be a free evaluation session? Yes!

UPDATE: Price increased to $35/hr due to demand.

Full text and comments »

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

By Agnimandur, 3 years ago, In English

All the division 2 problems were created by Agnimandur. 1548E - Gregor and the Two Painters was created by Benq. I hope that this hint-based editorial helps you, no matter what your rating is! Solution code is provided in both C++, Java, and Kotlin when available.

Solution Code Repository


1549A - Gregor and Cryptography

Hint 1
Solution

1549B - Gregor and the Pawn Game

Solution 1

Hint 1
Hint 2
Solution

Solution 2

Hint 1
Hint 2
Hint 3
Hint 4
Solution

1549C - Web of Lies

Hint 1
Hint 2
Solution

1549D - Integers Have Friends

Hint 1
Hint 2
Hint 3
Solution

1549E - The Three Little Pigs

Solution 1

Hint 1
Hint 2
Hint 3
Solution

Solution 2

Hint 1
Hint 2
Hint 3
Hint 4
Solution

1549F1 - Gregor and the Odd Cows (Easy)

Hint 1
Hint 2
Hint 3
Hint 4
Solution

1549F2 - Gregor and the Odd Cows (Hard)

Hint 1
Hint 2
Hint 3
Hint 4
Hint 5
Solution

1548E - Gregor and the Two Painters

Hint 1
Hint 2
Solution

Full text and comments »

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

By Agnimandur, 3 years ago, In English

Hello, Westeros!

I'm glad to invite you to Codeforces Round 736 (Div. 1) and Codeforces Round 736 (Div. 2), which will be held on Aug/01/2021 17:35 (Moscow time).

The round will be rated for both divisions. Each division will have 5-7 problems and 2 hours and 15 minutes to solve them. There will not be an interactive problem, so yay!!!

This round would not have been possible without the following individuals:

  1. Aleks5d, for awesome coordination of my round.
  2. Benq, for extensive testing and contributions throughout the round, especially for 1548E - Gregor and the Two Painters.
  3. Monogon, for discussing problems and statements with me for hours on Discord.
  4. amgfrthsp, for translating statements into Russian.
  5. MikeMirzayanov, for Codeforces and Polygon.

32 testers

The round had a total of 32 testers. I tried to get a "rainbow" of testers to help guarantee a most balanced round. Thank to you to each and every one of them!

This is my first round ever written, and I sincerely hope you enjoy it, regardless of your rating!

Score Distribution

Div 1: 500 — 1000 — 1750 — (2000 — 1000) — 3500

Div 2: 500 — 750 — 1250 — 2000 — 2500 — (2000 — 1500)


UPD: Editorial


Winners

Congratulations to all our winners in the round!

Div1

  1. Rewinding, congratulations on the AK!
  2. tourist, congratulations on the AK!
  3. yhx-12243
  4. heno239
  5. Isonan

Special congratulations to antontrygubO_o and Subconscious for definitely reaching the rank of Legendary Grandmaster!

Div2

  1. dingdingsb
  2. _riceshower
  3. black_trees
  4. lajixtc
  5. soumilaggarwal

Fastest Solves

Full text and comments »

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

By Agnimandur, history, 3 years ago, In English

Hi Codeforces,

Many of you know about the CSES Problem Set, an online collection of over 300 competitive programming problems made by pllk! I have decided to clone all the CSES problems onto Codeforces! Each CSES category will be its own separate gym contest, listed below.

  • Introductory Problems (19 problems)
  • Sorting and Searching (35 problems)
  • Dynamic Programming (19 problems)
  • Graph Algorithms (36 problems)
  • Range Queries (19 problems)
  • Tree Algorithms (16 problems)
  • Mathematics (31 problems)
  • String Algorithms (17 problems)
  • Geometry (7 problems)
  • Advanced Techniques (24 problems)
  • Additional Problems I (38 problems)
  • Additional Problems II (39 problems)

CSES Logo

There are two main reasons why I decided to do this project.

Slow CSES Judge

The CSES Judge is very slow, often resulting in correct solutions that should get accepted instead getting the TLE verdict. This is especially a problem for programmers who use Java. However, the Codeforces judge is much faster, which solves this issue.

Codeforces API

The Codeforces API is quite powerful. By adding these problems to gym contests, these problems can now be accessed by the Codeforces API, which will aid developers and people who use Codeforces bots to suggest problems.

Note: Work in Progress!!

This is still a work in progress! There are over 300 problems on CSES, and it will likely take me months to get them all on Codeforces. Therefore, I recommend you "favorite" this blog post, and check back on the contests regularly.

Full text and comments »

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

By Agnimandur, history, 3 years ago, In English

This is my current rating. As you can see, it says I am rated 2113. However, it also says I am a "Candidate Master", and my color is still purple!


This is my most recent contest. There are several things wrong with it.

  • Its an educational round (rated for people <2100). If I was over 2100, why would it appeared in the list of my rated contests!

  • The rating change listed was "0".

  • Even though there was no rating change, we still see that my color changes from yellow to purple on the right!


MikeMirzayanov please take a look at this! This is probably an issue for many other people too.

Full text and comments »

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

By Agnimandur, history, 3 years ago, In English

Go to College with Codeforces

Do You Want to Go to College? Are You Good At Writing Codeforces Rounds?

If so, then read on ahead! You will learn how quick and easy it is to go to college with the help of Codeforces!



College is Expensive.

The cost of MIT, a prestigious American university, is 53,790 USD per year. Even though scholarship is usually available, the average American student ends college with 37,000 USD in student debt! [Source] Student loan is also very pricey, with the average loan charging 5.8% interest per year. [Source]

However, Codeforces pays its problem setters big money! For a combined, Div 1+2 round, you can earn an average of approximately 400 USD. [Source]

Time Breakdown To Make a Round

Per Problem:

  • 5hr to create idea, propose statement and solution, discuss with coordinator

  • 1hr to write and revise statement, pictures, notes section

  • 1hr to write and revise tutorial

  • 1hr to write validator, checker, validator tests, checker tests

  • 2hr to write model, alternative, and fake solutions

  • 3hr to write generators for actually good test cases

  • 2hr to make unexpected edits, changes from tester feedback

Per Contest:

  • 8 problems per div1+div2 round.

  • 50hr to come up with problem ideas that get rejected by coordinator.

  • 30hr to discuss feedback with testers and coordinator, create announcement, editorial blog, answer clarifications during round, and any miscellaneous work.

Total Time To Write a Complete Round: 200 hours Assuming you work full time just problem setting (40 hours a week, 50 weeks a year), you should be able to write 10 high quality rounds a year!

Yearly Profit From Writing Codeforces Rounds: 4000 USD



How long will it take to pay off your student loan? Well, just run this quick python program to find out!

debt = 37000
year = 0
while debt > 0:
    interest = 0.058*debt
    debt -= (4000-interest)
    year += 1
print(year) #we get an answer of 14!

Conclusion: It Will Take 14 Years to Pay Off Student Loan Debt Via Codeforces

This of course assumes that you don't have to pay any other expenses, and problemset as a full time job. On the bright side, imagine what your rating would be after those 14 years...

Warning: This is satire. Please don't actually write 140 Codeforces rounds to pay for college. Unless you want top contributor spot.

Full text and comments »

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

By Agnimandur, history, 3 years ago, In English

Hello Codeforces!

What is Reaper?

Reaper Logo
Reaper is a math game all about timing, strategy, and patience. It was developed by folks at AOPs, and many games have been played on that site. How Reaper works is that whenever you reap, you get points equal to the current time and the time of the last person to reap. Additionally, there is a cooldown between reaps. Thus, the strategy is deciding when to reap. If you wait too long someone else might reap and you won't get your points. If you reap too quickly, you will get very few points which is very inefficient, due to the cooldown. Thus, you need to find the optimal time to reap, and also finetune your reaping strategy based on your opponents.

Standard versus Blitz Reaper

Standard Reaper usually has a long reap cooldown, usually in the range of several hours to a day. Thus, these games usually take days or weeks to finish, and require patience. Usually, standard reaper games have dozens or even hundreds of competitors! Blitz games are very different. They have very short reap cooldowns, usually around 10 seconds. Blitz games usually are very quick to finish, so players are recommended to continuously play from beginning to end! Although strategy is important in both modes, in Blitz reaper keeping track of your opponent's reap cooldowns is critical to success! Of course, the Red Crab Inn has complete support for both modes!

Inviting the Bot To YOUR Server

Setting up the bot is easy. Simply add the bot to a Discord server in which you are an administrator using the link above. Then, in any channel, simply type in $reaper. This will automatically create all the channels and roles the bot needs to function! That's it! You're done setting up the bot, and you can immediately move on to starting your first game!

Help

Help Menu
The Red Crab Inn bot supports many commands for optimal gameplay ease. At any point if you need help, simply type in help into the #reaper channel (created by the bot) to pop up the help menu. Of course, if you have any questions, concerns, or other queries please please direct message me on either Discord or Codeforces!

Source

All Reaper game code was written by me in Python, using the discord.py library, and hosted on repl.it. The idea for the game of Reaper is taken from AOPs. Check out the public github repository for more! If you find Reaper interesting, please share the bot with your friends!

Thank you for reading this article, and I hope you enjoy playing Reaper with friends!

Public Server

If you want to play on the Reaper Public Server, maintained by myself, click the above link.

Full text and comments »

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

By Agnimandur, history, 3 years ago, In English

Monogon's pleas for contribution have finally worked! As of Global Round 12, Monogon now has 205 contribution, beating Errichto's 204 contribution. Mike Mirzayanov of course doesn't count.

Let us celebrate Monogon's special day!

Monogon Orz

Full text and comments »

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

By Agnimandur, history, 4 years ago, In English

So, I noticed that there is a selection for the targeted division of a proposed Contest.

However, there is no way to propose a Div 3 round. How do you propose a Div3 round?

Full text and comments »

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