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

Автор yash_daga, история, 17 месяцев назад, По-английски

We invite you to participate in CodeChef’s Starters 95, this Wednesday, 21st June, 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:

Note: Some problems have subtasks

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!

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

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

There is a typing mistake in the post. The date should be 21st June

»
17 месяцев назад, # |
  Проголосовать: нравится +7 Проголосовать: не нравится

yash_daga sir orz !..

»
17 месяцев назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

AST_TheCoder kopsss bro

»
17 месяцев назад, # |
  Проголосовать: нравится +18 Проголосовать: не нравится
Wednesday
»
17 месяцев назад, # |
  Проголосовать: нравится +11 Проголосовать: не нравится

Contest starts in 30 minutes!

»
17 месяцев назад, # |
  Проголосовать: нравится +18 Проголосовать: не нравится

There is a mistake in Transfusion Chain problem.
Blood type O donors can also donate to recipients with blood types O, according to the test cases, but it is not mentioned in the statement.

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

    got two penalities due to this mistake if o is only for a,b,ab then i can use o only once at the start i think if in a running contest if some issue occurs due problem setters then all the penalties should not be counted on those problems

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

      I don't think you get penalties in Starters anyway.

      • »
        »
        »
        »
        17 месяцев назад, # ^ |
        Rev. 9   Проголосовать: нравится -8 Проголосовать: не нравится
        • Mistake 1: Transfusion Chain Quesion, Don't we get penalties on submission time, as this announcement pop up after 1 Hour of completion of Contest, and Don't it disturbs your mind set of giving the Contest, as I am thinking for mistake in my logic in first question, for more than 20 minutes just because of their rubbish mistake, and the interesting part was that I was shocked to see more than 2000+ Accepted Submissions on that Problem in Div 2.
        • Mistake 2: In Partition and Maximize Question, the Equation firstly was max(l[i], l[i+1], l[i+2], ..., r[i]) till more than 1 Hour of the Contest, and after 1 Hour of the Contest, without any Announcement it get's written as max(l[i], l[i]+1, l[i]+2, ..., r[i]), Am I wrong Problem Setter's and Tester's yash_daga wuhudsm ?
        • Isn't this Contest was tested before announcement, If it is tested, then what were the tester's doing ?
        • Also almost all the three below Question's were on Expected Value, This is not definition of Balanced Contest BTW...
        • Updated:- I am sorry, from my point of view, I think the Contest was very Good overall, Some fault's can happen as we all are Human, But I can say the Problem's were very Interesting to upsolve...

        • »
          »
          »
          »
          »
          17 месяцев назад, # ^ |
            Проголосовать: нравится +27 Проголосовать: не нравится
          • We're sorry about this, but the statement was rectified within 10 minutes and a announcement along with pop-up was made at 20:17
          • This is a small latex error which I don't think affected anyone, it's obvious from the partitions mentioned in the statement what the author wants to convey.
          • I feel Break Array is more of a dp problem along with prefix sum optimisation, than a probability problem.
        • »
          »
          »
          »
          »
          17 месяцев назад, # ^ |
            Проголосовать: нравится +22 Проголосовать: не нравится

          who reads the entire easy problem in contests . people probably went with the flow in transfusion chain

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

In the second testcase of ARRAY_BREAK, if the arr is [1], then after applying any operation will it include the expected sum?

Like it will be (sum+1)/(cnt+1) or sum/cnt(unaffected by this)?

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

    If at any point the size of the array becomes one, then for all further operations, it will remain unchanged.

»
17 месяцев назад, # |
  Проголосовать: нравится +7 Проголосовать: не нравится

name it a probability(math) contest rather than a dsa or cp contest

»
17 месяцев назад, # |
  Проголосовать: нравится +10 Проголосовать: не нравится

MathChef :/

»
17 месяцев назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

My O(K*N^2) submission is getting TLE on problem "Break this array".Runtime is too strict.

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

3 probability problem in a contest.. wth admin (:
also rating system skip the last contest rating which show on right side of problemset page, plz look at that.

»
17 месяцев назад, # |
  Проголосовать: нравится +7 Проголосовать: не нравится

How were people able to solve TRANCHAIN without even considering "blood group O can donate to O as well"?

I wasted the first 30 minutes on the first problem due to this typo.

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

    Ig many had studied biology in their lower grades . They went with the fact.

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

Constraints of Guess game say that N >= 2 but for the first subtask it is N >= 1. How do you define the expectation when N == 1?

Unfortunately I just wrote my full solution to that but can't submit. Please allow practice mode.

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

    I think Kira_1234 got 60 points due to this. His full solution does not pass the first subtask because it has a testcase with N == 1

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

      Thanks a lot for pointing this error out. I did not notice this and was wondering for the last hour what the issue in my code was.

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

    Hey, sorry about this, the solutions have been rejudged after removing the n==1 case. 2 submissions were affected due to this.

»
17 месяцев назад, # |
  Проголосовать: нравится +24 Проголосовать: не нравится

i was getting 31/7 for the second sample test case in the problem break this array which equals 428571436 modulo 1e9+7. Can explain me what is the actual ans to it ?

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

    It is 41/12, the resulting arrays you get are not equiprobable, you can make a probability tree and get this result.

    Spoiler
    • »
      »
      »
      17 месяцев назад, # ^ |
        Проголосовать: нравится +3 Проголосовать: не нравится

      I see now, actually the probabilities were not completely independent for each stage, it had to be cumulated. The problem statement was a little unclear about this fact, i just assumed the process to be independent at each stage from the previous stages.

      Thanks for the clarification.

»
17 месяцев назад, # |
  Проголосовать: нравится +23 Проголосовать: не нравится

Thanks for the Contest. Though it was a bit math-heavy, I learned something new today.

»
17 месяцев назад, # |
  Проголосовать: нравится +13 Проголосовать: не нравится

Probability — GCD combination question was really very good.

»
17 месяцев назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

Can anyone explain me 2nd test case of ARRAY_BREAK?

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

    Since lots of people have trouble in understanding this, here's a probability tree explaining it.

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

      i was able to get the total sum and number of possible partitions possible using dp with an algorithm of o(n^3*k) and seeing the explanation of the first test case, i thought maybe it's just the modular division of both but it was certainly a lot more than that, anyways it was my first time experiencing expected values problems.

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

Similar Question for Chef and Moves of GCD: Link

My submission: Link

»
17 месяцев назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

Guess Game could also be simply done in O($$$NloglogN + T\sqrt{N}$$$). If we fix the small number $$$d$$$, the large number can have $$$\lfloor\frac{n}{d}\rfloor-1$$$ values. Also since the answer only depends on $$$d$$$, we can find the range of $$$d$$$ for which $$$\lfloor\frac{n}{d}\rfloor$$$ is constant and add their contribution to answer. It is well known that there are $$$O(\sqrt{n})$$$ distinct ranges.

»
17 месяцев назад, # |
Rev. 3   Проголосовать: нравится 0 Проголосовать: не нравится

In Question BREAK THE ARRAY I Dont Know where my code is bugging can anyone please figure it out. It is not able to run even in lower limits of 100 Yet other peoples have did the similar and got AC sub link :- https://www.codechef.com/viewsolution/98819410

»
17 месяцев назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

There is an $$$O(n)$$$ solution to PARTITION without using segment trees. Consider the $$$O(n^2)$$$ dp

Naive DP

Transitions can be maintained using monotonic stack.

Efficient DP
»
17 месяцев назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

can someone tell what's wrong in my solution for subtask1 of "Break This Array", soln

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

I guess there is a problem while viewing solutions of some participants, can you please look into it. Example of one such user's submission

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

For Problem CAMOG, the editorial says. " We do the $$$2^k$$$ operation for each pair of (number, divisor) below $$$N$$$. It’s well-known that there are $$$\mathcal{O}(N\log N)$$$ such pairs, so a simple upper bound on complexity is $$$\mathcal{O}(2^6 \cdot N\log N)$$$. "

Could you explain why is the number of pairs $$$\mathcal{O}(N\log N)$$$ , I was thinking that it should be something like $$$\Sigma$$$ $$$x^{1/3}$$$. I read somewhere that $$$N^{1/3}$$$ is a good upperbound for the number of divisors.