Hello Codeforces!
I’d like you to invite for CodeChef June Lunchtime that will start at 19:30 IST of 24-th June 2017 (check your time zone here) and will last 3 hours.
The author of problems is me, never_giveup, while Lewin is a tester and mareksom is the secondary Tester. The editorialist is pkacprzak. Translators: CherryTree (Russian), huzecong (Mandarin) and VNOI team (Vietnamese).
There is no registration required, anybody with a CodeChef handle can participate. Top school participants can win CodeChef laddus (details on the contest page).
You will be provided 4 problems with subtasks (IOI-style grading). Ties are broken by time of reaching your final score.
Remember about subtasks if you can't solve a problem for the full score, and read the editorial after the contest.
What error is this?
Also for some weird reason which i don't know O(N) per query worked for 2 subtasks while O(log^2(n)) per query worked for only 1 subtask.
If you watch constraints in Codechef, you can see that there is memory limit 1500 MBs. I watched your submission and it uses >1800MBs. Verdict is not ML because there is no ML constraints like in codeforces or somewhere else. Also I see, that your next submission was the same as this except that you changed size of your array, so you should understand it by yourself.
Thanks, i always thought codechef offers unlimited memory (As much as the compiler allows) but looks like i was mistaken.
Can't DSU on trees work for Company and Club Hierarchies?
Yeah fairly
using technique described here
http://mirror.codeforces.com/blog/entry/48871
turns it into a standard problem
That is why I was wondering why solution was timing out https://www.codechef.com/viewsolution/14335125
But seems like I had forgotten to call dfs to calculate the sizes of the children and the heavy child of every node was simply 0. Such a horrible mistake to make. Probably not in the right state of mind today. PS: AC solution https://www.codechef.com/viewsolution/14336709
Company Club Membership is very tricky :(.
Node change is from 0 -> n - 1 and repeat.
Actually that part is very similar to this problem.
How many felt the same as me:
I felt for the three problems (except the easy) that they are a mix of very standard famous approaches along with a very easy idea (I was able to figure the idea of each problem in less than 5 minutes). and was too lazy to code any
It's not cool also the way the last 2 problems are being asked on the same tree structure. I am sorry, not trying to be a critic
But didn't enjoy a second
Did anyone of you solved the 3rd problem after reading my recent blog post? I would be happy if someone did :D
Guys, if you think that problems was too easy, then watch their difficulty. First problem should be solvable for everyone, who just started programming. Second problem should be solvable for 70% of participiants. Third problem should be solvable for 20% of participiants. And if you had some problems with testing. I'm sorry, they were. But correct solutions should pass for each subtask. I was testing each subtask by myself. I'm sorry, if you was disappointed.
** deleted **
My N Log N solution passed for the 3rd problem when carefully implemented.
Code