Hello to all the wonderful people here on codeforces!
I was first introduced to competetive programming two years ago, and as for many others, it became one of my favourite hobbies. When I was starting out, I rember RomeoFantastik's great videos after almost every codeforces round. Now that I've gained some experiance, I thought that I'll try and give back to the community (and also improve my explaining skills), by making video editorials and educational blogs for codeforces problems and contests. Please send me feedback!
Here's my first attempt, I try explaining A-C of todays codeforces round: CodeTON Round 1: A-C problems explained
you were just able to solve 3?
My solution for D failed system tests unfortunately:((
ooh! i never knew that that could also happen
Same, int overflow for me (because 1<<32 == 0).
I still haven't found where my solution goes wrong, surprising that it passed pretests at all.
You got the wrong answer on testcase 8 same as me. Your k came out as 4294967296 but k*(k-1)/2 is more than n which should have invalidated the if condition but it didn't and your program output it resulting in WA.
Damn, I didn't notice that k*(k-1)/2 can overflow long long. Got AC by adding one more condition.
Exactly what happened with me as well. I think if the constraints of the problem had been a little lower then it would have avoided overflow without sacrificing the gist/trick of the problem.
I think it's a little disappointing too because if you look at the case that fails me (probably "us" more generally), it has just one case, so it looks like coordinators saw it coming and it easily could have been added to hidden pretests.
Might as well take this as a lesson for the future. I am pretty sure I am not gonna be making an overflow mistake like this in near future, it cost me an AC.
I 100% agree that it should've been in the pretests. However, you can't make the argument of "make the constrainst a little lower" — otherwise, naive factorization would work ($$$OT\sqrt{MX})$$$, where $$$MX$$$ is maximum value.
That approach didn't come to my mind. Yes this test case should be in the pretest rather than system tests.
same here , overflowed occured bcz i was computing (c*(c+1))/2 when c was order of 1e18 ಥ╭╮ಥ from getting +105 predicted delta to +25 , its painful
Best wishes man
Great initiative, Good Luck.