mblazev's blog

By mblazev, history, 5 years ago, In English

user.info documentation says

No more than 10000 handles is accepted.

but in reality it accepts nowhere near that many handles. In fact, the limit has nothing to do with the number of handles. It instead depends on the number of characters in the URL. If the URL is $$$\geq$$$ 5620 characters long then the server will respond with 400 Bad Request. Can this be fixed?

Full text and comments »

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

By mblazev, history, 5 years ago, In English

So i used Arpa's bigint for today's C: https://codeforces.me/blog/entry/22566 and got skipped. Isn't it allowed to use code written before contest? What's going on here fcspartakm?

Full text and comments »

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

By mblazev, history, 5 years ago, In English

I would like to present to you an open-source competitive programming (primarily codeforces) discord bot written in python by meooow, algmyr, Narut, Rahul, pajenegod, aryaman, DeliciousFlatChest, Chilli, c1729, cfalas and mblazev. Source code is avaliable on github. If you would like to try the bot without having to set it up yourself, enter this server: discord.gg/2CJ6qvY. The bot is still work in progress, but it is already 4 months old so it can already do quite a few cool things. Here is a showcase of a subset of its features:

  • It can plot rating distribution of either active or all codeforces users, in either normal or log scale, who have competed at least n times. For example, ;plot cfdistrib normal active 5 gives:
Click to reveal
  • It can also place a provided list of users on a plot of the percentile distribution of codeforces. For example, ;plot centile mblazev laggy heon +zoom
Click to reveal
  • If you're curious how the entire percentile distribution looks like ;plot centile
Click to reveal
  • It can plot codeforces rating graphs for multiple users. For example, ;plot rating mblazev heon tomx +zoom
Click to reveal
  • It can plot a histogram of problems solved by a user, color-coded by submission type. For example, ;plot solved stefdasca
Click to reveal
  • Of course, it works for multiple users as well. For example ;plot solved stefdasca pikmike
Click to reveal
  • It can even plot codeforces rating overlaid on a scatter plot of problems solved along with a running average of ratings of problems solved in practice! For example ;plot scatter pikmike
Click to reveal
  • And of course, it can also plot the rating distribution of server members. ;plot distrib
Click to reveal

3 other plotting commands are still WIP so I will not showcase them yet. Some non-graph features include:

Contest forecast
Smart mashup creator
Smart virtual contest picker
Smart practice problem selector
Ranklist with rating prediction
Contest reminders to subscribed users
It's easy to control the subscription
User stalking
Even displaying cf handle of given discord user looks beautiful!
It updates roles quickly!
Emoji-interactive list of server members
Scoreboard for fastest/shortest CSES solutions
3 stars -> starboard

It also has a set of commands which we refer to as "gitgud". They are ;gitgud, ;gotgud, ;nogud, ;gudgitters and ;upsolve. They incentivize solving problems around user's rating by giving points (depending on relative difficulty) and maintaining a scoreboard. In this example, a 1900 rated user requested a 100 rating higher problem (worth 12 points):

Click to reveal

To report a solved problem, you run ;gotgud.

Click to reveal

To skip a problem (after at least 3 hours), you run ;nogud.

Click to reveal

Apart from random problems, you can also gain points for ;upsolve-ing problems you failed in a contest. For example:

Click to reveal

To display the scoreboard, run ;gudgitters

Click to reveal

It has even more features (many of which are WIP), but I've omitted them for sake of brevity. We are also planning new features and we welcome new contributors; we'd be happy to help you find your way around the codebase. It's moderately big (3.2k lines of code, not counting comments and whitespaces) but stringent code review ensures the code remains non-terrible.

If you've come this far, just enter discord.gg/2CJ6qvY and try it out! Make sure to read ;help for more details.

Full text and comments »

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

By mblazev, history, 6 years ago, In English

My hacked solution: https://codeforces.me/contest/1132/submission/50838954

On the worst possible test (test 52):

5000 5000
1 5000
...
1 5000

It just barely passes with >255 mb used. Memory usage is high beceause I fill all of those 5000 vectors with as much as data possible. However, a slightly different test (generated hack):

5000 5000
(randomly choose 1 or 2) 5000
...

Causes MLE. How could this be? Is it possible that generator affects memory usage? It MLE on that same hack upon resubmit though.

Full text and comments »

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