We invite you to participate in CodeChef’s August Lunchtime, this Saturday, 29th August, from 7:30 pm to 10:30 pm IST.
The contest features 6 problems and is 3 hours long.
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.
Joining me on the problem setting panel are:
Setters: Rithvik Chatterjee, Ritesh rishup132 Gupta, Ramanan ramzz S, Sawarnik Sawarnik Kaushal
Admin : Teja teja349 Vardhan Reddy
Tester: Yash yashChandnani Chandnani
Editorialist: Ishmeet Psychik Singh Saggu
Statement Verifier: Jakub Xellos Safin
Mandarin Translator: Gedi gediiiiiii Zheng
Vietnamese Translator: Team VNOI
Russian Translator: Fedor Mediocrity Korobeinikov
Bengali Translator: Mohammad solaimanope Solaiman
Hindi Translator: Akash Shrivastava
Prizes:
Top 10 Indian and top 10 Global school students from ranklist will receive certificates and CodeChef laddus, with which they can claim cool CodeChef goodies. Know more here.
Good luck and have fun!
my contest ! my love Codechef ! my 6 star swag !
Dude, stop shitposting. This is Codeforces and not Crapforces.
hoping not to see Internal Server Error this time :p
Atcoder abc177: 5:30pm to 7:10pm
CC lunchtime: 7:30pm to 10:30pm
Facebook Hackercup Round 2: 10:30pm onwards
Sacrifices have to be made today. :(
List of things learnt from today's contest : codechef lunchtime occurs at dinner time
I would like to post the stuff I did in case it helps anyone.
Problem ARRGAME: For Nayeon to have any chance of winning he must pick biggest block of zeros (which must be unique). Let mx = length of this biggest block. If mx is even, Tzuyu can pick position adjacent to Nayeon and win. If length of block is odd, Nayeon can pick middle position to neutralize this strategy. So to win Tzuyu would have to pick another block of zeros with length > (mx+1)/2.
Problem ALIENIN: Binary Search the answer to find max cool down.
Problem CNTGRP: First we build tree, then remaining edges must be between nodes with same level in tree. To build tree each node with level ai must be connected with some node with level ai-1 => if number of nodes with level ai-1 is f[ai-1] then we have f[ai-1] ways to choose. Just multiply these for all nodes. Now compute number of possible edges between nodes of same level, we must choose m-(n-1) such edges. Compute binomial coefficient and multiply with answer.
Problem SHENQ: I only did partial 50 points. Doing small test cases gives the necessary insight. There are four cases to consider: elements even/odd, length even/odd. You can find formula to solve in O(1) for each case.
In the problem of alien invasion, the cool down time was a floating point value. How do we know when to stop it? I am confused in that.
You only need to get a few decimal points corrects (check output section).
So you can do binary search while length of interval is bigger than 1e-7.
what is wrong with my code for https://www.codechef.com/LTIME87A/problems/CNTGRP
my code — https://pastebin.com/0xn1TUXz
I am getting partial score. thanks in advance
you can't calculate nCr like that, since n can be very large
instead, first find n!/(n-r)! which is equal to n * (n-1) * .... * (n-r+1) and modInverse(r!) and multiply them ( since r will be < 2e5 here )
wow I didn't even think about it like that guess I have much to learn.. thanks for your help. I got AC thanks again.
Idea for Elevator? I tried using dp, where dp[i][0] denotes least number of changes until the ith point(considering only non -1 values) and currently going down and dp[i][1] is for currently going up. But I thought there were a lot of cases to handle and I couldn't simplify.
This was one of the best contests i have seen in recent times. The problemset was well balanced, covering lot of topics. Kudos to problemsetters and testers !
NEED HELP FOR ELOMAX
https://www.codechef.com/viewsolution/37240579
can someone give me a counter case where my code fails ? I’m simply finding the score of each player after the ith round and maintaining 4 arrays separately for bestrank so far , bestrating so far, and month number for bestrating and bestrank. I guess my method is simple brute force with simple implementation, am i missing something ?
how to solve
Ratings and Rankings
this problem ?I can tell you what i did to solve it. First lets construct a matrix rank[i][j] which tells us the rank of the person i after jth month. Then just iterate thorugh the entire row for person i to find the minimum rank and maximum rating if they occur at the different index then update the count else move to next person.
Can you tell me what is the first testcase in each subtask for the task CHEFPART?
It seems to have some other special case besides appearance of one bit in the single number.
Unfortunately, one of the edge cases in CHEFPART was handled wrongly in the official solution, as you had figured out. This has been fixed, all non-AC solutions rejudged, and we will recalculate the ratings for the 2 users who have been affected by this. Apologies for the mistake!
One of them is me) Actually I would be able to finish with full solution, if I know that my approach passes first subtask, but anyway I'm happy with 6th place)