Блог пользователя yashChandnani

Автор yashChandnani, история, 4 года назад, По-английски

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!

  • Проголосовать: нравится
  • +110
  • Проголосовать: не нравится

»
4 года назад, # |
  Проголосовать: нравится -58 Проголосовать: не нравится

my contest ! my love Codechef ! my 6 star swag !

»
4 года назад, # |
  Проголосовать: нравится +2 Проголосовать: не нравится

hoping not to see Internal Server Error this time :p

»
4 года назад, # |
Rev. 2   Проголосовать: нравится +32 Проголосовать: не нравится

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. :(

»
4 года назад, # |
  Проголосовать: нравится +60 Проголосовать: не нравится

List of things learnt from today's contest : codechef lunchtime occurs at dinner time

»
4 года назад, # |
Rev. 3   Проголосовать: нравится +28 Проголосовать: не нравится

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.

  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    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.

    • »
      »
      »
      4 года назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      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.

»
4 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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

  • »
    »
    4 года назад, # ^ |
    Rev. 2   Проголосовать: нравится +14 Проголосовать: не нравится

    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 )

    • »
      »
      »
      4 года назад, # ^ |
      Rev. 2   Проголосовать: нравится +8 Проголосовать: не нравится

      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.

»
4 года назад, # |
Rev. 2   Проголосовать: нравится +21 Проголосовать: не нравится

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.

»
4 года назад, # |
  Проголосовать: нравится +35 Проголосовать: не нравится

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 !

»
4 года назад, # |
Rev. 2   Проголосовать: нравится +2 Проголосовать: не нравится

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 ?

»
4 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

how to solve Ratings and Rankings this problem ?

  • »
    »
    4 года назад, # ^ |
    Rev. 2   Проголосовать: нравится +1 Проголосовать: не нравится

    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.

»
4 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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.

  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится +27 Проголосовать: не нравится

    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!

    • »
      »
      »
      4 года назад, # ^ |
        Проголосовать: нравится +8 Проголосовать: не нравится

      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)