We invite you to participate in CodeChef’s Starters 90, this Wednesday, 17th May, rated till 6-stars Coders (ie. for users with rating < 2500).
Time: 8:00 PM — 10:00 PM IST
Note that the duration is 2 hours. Read about the recent CodeChef changes here.
Joining us on the problem setting panel are:
Setters: Aryan aryan12 Maskara, Patel _Prince Prince, Indresh indreshsingh Rajesh Singh, emptypromises empty-promises, Satyam satyam343
Testers: Udhav udhavvarma03 Varma
Video Editorialists:Sundar K Letscode_sundar, Madhav jhamadhav Jha, Suraj jhasuraj01 Jha, Jwala jwalapc , Adhish ak2006 Kancharla, Pravin pravin_as Shankhapal
Text Editorialists: Nishank IceKnight1093 Suresh
Contest Admin: Satyam satyam343
Written editorials will be available for all on discuss.codechef.com. Pro users can find the editorials directly on the problem pages after the contest.
The video editorials of the problems will be available for all users for 1 day as soon as the contest ends, after which they will be available only to Pro users.
Also, if you have some original and engaging problem ideas, and you’re interested in them being used in CodeChef's contests, you can share them here.
Hope to see you participating. Good Luck!
Reminder: Contest starts in 1.5 hours!
It is showing This site can't be reached, Is this an issue from my side?
In Crushed Apples and a Balance Scale why is answer for "4 9" NO ?
Problems won't and shouldn't be discussed in public during the contest. You can use the comments section for clarifications.
Because n cannot be greater than m.
no hate to the authors, but problem CHEFPARTY is exactly the same as Jzzhu and Apples
We(me and the author) were not aware of this problem.
I think the problem idea is quite natural, and one can come up with such an idea independently.
I hope you enjoyed the remaining problems.
Can anyone please tell me how to solve this problem?
Minimum Ugliness
you have to find the diameter considering endpoint between k given vertex.. then ans= (diam+1)/2
how to do that efficiently?
You can use the concept of Virtual Tree to process each query in O(k) time.
you can solve it without using a virtual tree as one endpoint will always be the node with maximum depth and the other endpoint can be found by calculating the distance from the first endpoint
Link
Here, I firstly iterate every k vertex and find the max depth vertex. Then iterate again every k-vertex and find the maximum distance from that previous vertex If you see that more deeply, it is same as diameter find idea of a tree.
In the short contest, you should give every problem a weight like CF. If it is a long contest then its ok. Also, you can take a servery and choose, that most people want. Weighted problem can save your rating, when you can not solve a easy problem.
Nope. We like this format.
Can someone tell me why my code for Sum of Goodness gives RTE on one test case or provide me with a test case where it fails? It would be a great help.
Code
Thanks!
EDIT- It worked when I removed my template and submitted the Code. Can someone tell me why it was failing? Is it the fault of the compiler?
EDIT 2- I found the piece of code which gave an error, but I don't know why. Can someone please explain me?
Reason- I took the input like this ( cin>>v (vector), and when I changed this to for(auto &i:v) cin>>i), it passed. Why? What was the error in that?
Edit 3- It was probably the coordinators' fault they created a case with n=0(constraints was n>=1), which led to runtime error.
Just wow!