### farmersrice's blog

By farmersrice, history, 4 weeks ago, ,

We need one, now!!!!!!!!! Let's do it, MikeMirzayanov. Or maybe we should ask atcoder for this one?

• +493

By farmersrice, history, 4 weeks ago, ,

The new version is not my style. I don't like bold things, it makes it harder to read for me. Is there an option to go back to the old style or something? That would be much nicer. Thanks. Pinging MikeMirzayanov.

• +98

By farmersrice, history, 7 weeks ago, ,

You have $N$ cups, each containing some amount of water. Each cup is identical and has maximum capacity $M$ milliliters. In one operation, you may select any two cups $a$ and $b$, which represents pouring water from cup $a$ to cup $b$. If the sum of the cups' volume is less than or equal to $M$, cup $a$ ends up empty and cup $b$ contains all the volume of the cups. If the sum of the cups' volume is greater than $M$, then cup $b$ ends up filled to capacity $M$ and cup $a$ contains the remainder of the water. Suppose the total volume of water in all cups is $V$. The question is: What is the minimum number of operations necessary to create $\left \lfloor{\frac{V}{M}}\right \rfloor$ cups of water that are filled to maximum capacity?

No constraints, the problem is original and comes from a real life scenario. My hypothesis is that as long as you merge small to large then it will take the same number of operations, which is also optimal — but I can't think of how to prove this. Any ideas?

• +11

By farmersrice, history, 3 months ago, ,

So today's contest was declared unrated because of a mistake in the statement/test preparation for problem A. Of course, I was upset, given that I was doing relatively well even after the re-judge. (Sad to say, I ragequit and went to do work)

It seems like the biggest problem in a case like this is when some participants get WA after 30 minutes, receiving a big penalty due to the re-judge, as opposed to people who got it right in the first few minutes. (see here). Aside from this, I don't see any major issues coming from the re-judge that call for making the round unrated.

In my view it looks like a simple and easy fix for this would just be to shift all the submissions' time penalty calculations that were rejected in the re-judging to the time that they would have been at from the start of the round. What I mean by this is, for example, if some user solves problem A at time 00:03, and the rejudge gives his or her solution WA on 00:30, and then this user solves it given another 2 minutes at 00:32, then the end result score penalty calculation should have the +1 penalty for wrong answer and assume that the user has solved this at 00:05 (3 minutes first submission, then took 2 minutes to fix error — so shift to 5 minutes).

Then at the final judging the scores will closely reflect results that would have occurred as if no error had happened in the first place, and the great penalty discrepancy would no longer be an issue.

Of course, we can't change the result or status of today's round (especially considering that the case in which the triangle direction could have been reversed was not clarified in the statement), but this might be a good way to handle similar situations in the future. What do you think?

• -25

By farmersrice, history, 6 months ago, ,

Title.

• -34

By farmersrice, history, 7 months ago, ,

I would like to cut down on some of the spam in comments. Thoughts?

• +108

By farmersrice, history, 8 months ago, ,

https://codeforces.com/contest/1061/submission/46134575

https://codeforces.com/contest/1061/submission/46134614

Same code for 1061F gives wrong answer on test 1 for C++17 (invalid input format), but goes to test 159 for C++14 (accepted after submitting a second time). I feel like my problem lies within some input issue or something to do with returning the vectors, but I can't find it. Can someone please enlighten me? Thanks in advance.

• -24

By farmersrice, history, 8 months ago, ,

http://codeforces.com/contest/1074/submission/45462396

http://codeforces.com/contest/1074/submission/45462405

These two codes are exactly the same, except for this part:

In the Wrong answer on test 14 submission:

for (int i : inTree[rootp]) {
inTree[rootq].pb(i);
distToRoot[i] = distToRoot[i] ^ distToRoot[p] ^ edgeWeight ^ distToRoot[q];
root[i] = rootq;
}


In the Accepted submission:

edgeWeight ^= distToRoot[p] ^ distToRoot[q];

for (int i : inTree[rootp]) {
inTree[rootq].pb(i);
distToRoot[i] ^= edgeWeight;
root[i] = rootq;
}


(This is the end of the method, so xor-equals edgeWeight shouldn't change anything later on.)

I thought xor sum is both commutative and associative? What's the difference between these two snippets? Am I missing something really obvious? Thanks in advance.

• -3

By farmersrice, history, 9 months ago, ,

It seems there are a significant number of hacks on Codeforces — and not the type where halyavin nukes your solution.

Just recently there were those 2 chinese guys who got accounts hacked (here).

Roughly a year before that there was this one round where a bunch of well-known reds had their submissions hacked and submitted by a horde of random accounts.

And now this post (here).

Are there any updates on these? How did they happen? Are the bugs fixed? I don't think I ever saw anything except "ok, we got hacked but 3 days later we got accounts back, problem solved".

I'm not trying to say nothing is being done, of course, there is probably a lot of good work going on behind the scenes, but it seems nobody knows what exactly is happening.

• -7

By farmersrice, history, 9 months ago, ,

Super casual, no commitment necessary.

Only requirement is being purple or higher at some point in the past (or now).

There's 12 hours left to register and obviously 2 is better than 1. PM me

• +6

By farmersrice, history, 9 months ago, ,

Just curious as to what you guys like to do. Personally, I enjoy playing go/chess and a variety of other games, and listening to music that has 0 correlation with my actual life. (hmu if you want to play go or chess)

• +112

By farmersrice, history, 9 months ago, ,

I searched a lot of resources online, but they're super long. I don't want to spend tens (hundreds?) of hours reading a poorly-written introduction, so I thought I would ask here.

My math background is limited (currently doing linear algebra).

• +29

By farmersrice, history, 10 months ago, ,

I'm using mingw, gcc --version gives 5.3.0 on my windows 10 desktop. When I add the lines

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>


and compile, it says

c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\ext\pb_ds\hash_policy.hpp:610:78: fatal error: ext/pb_ds/detail/resize_policy/hash_standard_resize_policy_imp.hpp: No such file or directory
compilation terminated.


I don't remember what it says on mac but it also doesn't work there. (I think mac is gcc 4.8 installed through homebrew.)

In the past I just used ubuntu vm to use the library, lol. But it is a bit of an annoyance.

Any tips?

• +8

By farmersrice, history, 11 months ago, ,

Now that there are like 2000 tutorial blogs by high-level users, I believe there should be a separate section for them as opposed to mashing them together with the round info / other announcements on the home page. Probably a separate tab on the top or something would be nice.

Thoughts?

• +85

By farmersrice, history, 11 months ago, ,

I've noticed that sometimes heavily-downvoted comments will arbitrarily disappear. Some of them are extremely distasteful, but others just seem to be typical downvote material. And sometimes my child comments get upvotes/downvotes even though I can't see them anymore!

Don't know if it's automated system, manual removal, privacy feature, or something else (maybe even english/russian settings?)

Anyone know why this happens?

• +49

By farmersrice, history, 12 months ago, ,

I would like to shamelessly plug my good friend minimario's legendary soundcloud track "Starships"

https://soundcloud.com/alex-gu-254660687/starships

• +3

By farmersrice, history, 14 months ago, ,

It seems that the equations and such are no longer italic. This is really bugging me. Is anyone else seeing the same thing? How can I turn it back?

• +4

By farmersrice, history, 14 months ago, ,

Just curious.

• +19

By farmersrice, history, 14 months ago, ,

Repeal the division cutoff change

Firstly, it causes rating inflation. In all div1 + div2 rounds the div2 players boost the div1 players, so even if someone does really badly relative to div1, he or she will get a much reduced loss, or even a positive rating change! In these div2 rounds there will be no reds/yellows to counter the buffer as well, so candidate masters will benefit even more!

Secondly, it does not solve the problem it seeks to address, rather it shifts it to higher rating ranges. Now instead of barely 1900s being unable to solve anything, we will have barely 2100 “masters” being unable to solve anything! We all know these titles are just for show, but this is a little ridiculous.

In addition, this shifting of the rating range also exaggerates existing problems. In rare occasions, even now, somebody will score 1st place in div2 and jump to master or high candidate master even if their skill level is low. With this change, we will have people jumping to grandmaster without even doing a single div1 contest!

With this change, ratings will become a joke. And that is why we need to repeal the division cutoff change.

Amendments to the creation of division 3

Thanks to ppavic's insight, I revised my statement on repealing the creation of div3. There still need to be some key changes, however:

The rounds should be limited to players with less than 1400 rating. 1600 is much too high if we are aiming to see the difference between beginner players who can solve only easy problems like A and B. If someone can solve A, B, C, then he/she should be in div2, as that is already solving 3 out of the 5 problems. In addition, we need a quota on the number of div3 contests in order to stop them from hampering the div2 or div1 contests, perhaps one per month.

• +71

By farmersrice, history, 15 months ago, ,

http://codeforces.com/contest/963/submission/37451734

Not sure where my code has a bug, but I submitted 3 times and it's always the same error on test 48.

I could not decipher this part of the message:

Diagnostics detected issues [cpp.clang++-diagnose]: =================================================================
==6068==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x14e00978 at pc 0x00dc63fd bp 0x1355f754 sp 0x1355f750


I would appreciate any help. Thanks!

• +5

By farmersrice, history, 15 months ago, ,

Describe the curve of minimal length that divides an equilateral triangle into two sections of equal area.

I don't know the solution and would appreciate any help, thanks!

• -8

By farmersrice, history, 18 months ago, ,

What is discord?

Discord is a messaging and voice-chat service, similar to skype. It offers a lot more functionality ("pinging" users, search through old messages, etc.), has no ads, and is easy to invite people to.

Why should I join?

You can meet cool members and have casual discussions on programming or other subjects without the clutter and inconvenience of going through other services. And if you join, you are expanding that pool of cool members.

The goal of this discord server is to be minimalist, as reflected in this post, while still allowing for multifaceted discussion and some light fun. For more specifics, feel free to message me on discord, or on codeforces.

(This is a permanent invite link. Feel free to send it to anyone you want — the more, the merrier!)

• +18

By farmersrice, history, 18 months ago, ,

After this last contest, I find that the slowness when opening code issue is even more annoying than before. I just want to look at some AC solution, but again, because of the popup loading thing, it either takes 30 seconds to load, OR crashes the browser tab! This is even on the latest chrome. I suggest that the popup be eliminated, and go straight to the web page that actually contains the code. MikeMirzayanov, I hope you can consider this proposal. If anyone has similar experience or further suggestion please post. Thanks.

• +50

By farmersrice, history, 18 months ago, ,

Whenever I click on a submission that gives a popup instead of a direct link to the code webpage, the loading takes forever, around maybe 10-20 seconds, and my cpu usage goes up significantly. Meanwhile if I click the direct link to the webpage, it loads almost instantly. Has anyone else experienced this, and is there a way to fix this? (chrome browser)

• +31

By farmersrice, history, 20 months ago, ,

I couldn't find one hosting most of the problems after a couple minutes of searching. Does anyone know where one may submit programs to be judged?