wuhudsm's blog

By wuhudsm, history, 4 days ago, In English

Please note that the contest's rated range and duration has both increased. Further, the round is being held in ICPC mode with 10 minute penalty.

We invite you to participate in CodeChef’s Starters 174, this Wednesday, 19th February, rated for users with rating < 2700.

Time: 8:00 PM — 10:15 PM IST

Note the round is being held in ICPC mode with 10 minute penalty.

Joining us on the problem setting panel are:

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 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!

UPD: congrats for the winners!

  1. Nachia

  2. yydtq

  3. potato167

  4. snuke

  5. Kude

  • Vote: I like it
  • +65
  • Vote: I do not like it

»
4 days ago, # |
  Vote: I like it 0 Vote: I do not like it

A codechef contest

»
4 days ago, # |
  Vote: I like it -54 Vote: I do not like it

I’m excited to participate in CodeChef Starters 174 and Good luck to everyone!!

»
3 days ago, # |
  Vote: I like it +21 Vote: I do not like it

good luck and i hope you enjoy the problems.

  • »
    »
    3 days ago, # ^ |
      Vote: I like it +21 Vote: I do not like it

    Is there any specific reason as to why contests are being held in icpc mode. I mean I am not against it but I really enjoyed the freedom to submit wrong solutions in a row.

»
3 days ago, # |
  Vote: I like it +70 Vote: I do not like it

Why back-to-back <2700 rated? There are only around 20 active 2700+ and only excluding them is almost meaningless.

  • »
    »
    45 hours ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    hi, you make a valid point. I thought div1C (and maybe D) were somewhat standard for lgms, while EF would be hard enough (Nachia nearly proved me wrong, i have no clue how someone solves E in 16mins, have you seen it before?)

    For the future, I will try rating for all if I have such a scenario. As you can see the rated range was updated late because I realized it was too hard (and also too nice) for 6*

    • »
      »
      »
      45 hours ago, # ^ |
        Vote: I like it +10 Vote: I do not like it

      There is an additional reason we shouldn't cut at 2700. Due to the rating system of CC, newcomers have pretty high volatilities (though 2700+ with many contests has so low volatilities that in one contest their abs(delta)<=30). If strong newcomers(, or new accounts) with slightly lower than 2700, they will experience huge delta (kinda +50~+100), and 2700+[0,100] have nothing to do. TBH this phenomenon is common for lower divisions, but I think it shouldn't be happened at active rank 20.

»
2 days ago, # |
  Vote: I like it +14 Vote: I do not like it

As a tester, I forgot to test.

»
2 days ago, # |
  Vote: I like it +8 Vote: I do not like it

Contest starts in ~30min.

»
2 days ago, # |
  Vote: I like it 0 Vote: I do not like it

As a tester, get better.

»
46 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

I just opened problems in CC but I didnt submit any so it wont be rated for me right?

»
45 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Can anyone point out how to check good pair ? I know doing cur=0 after finding mexi is wrong

Meximal Sum
»
40 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Extremely easy guess solution for problem GCD Add Size.

  1. I knew that multiplication of primes rises faster than the array size which is just an add operation and multiplication always is faster.
  2. From this I realized that I just have to look at divisors of a number upto a certain value and max till $$$sqrt(n)$$$. I experimented with this value and go 50 to be working

This is my solution.

Main Code

Solve

I still don't have a proof for this but I had this intuition for multiplication rising much much faster than addition and I just guessed it to be 1e5 then 1e3 and then 50 and it worked. Anyone having some definite proof or a counter case Dominater069?

  • »
    »
    33 hours ago, # ^ |
    Rev. 2   Vote: I like it +11 Vote: I do not like it
    Counter Case

    Your Output:2602.
    Expected Output: 2603.

    Edit: This shows that you must check all factors till $$$sqrt(A[i])$$$, which is the same as checking all factors.
    Also, where does the multiplication of primes intuition come from?
    $$$gcd$$$ does not necessarily grow with primes.

    • »
      »
      »
      31 hour(s) ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Thank you for this. The main idea which I thought of was say there are numbers like $$$p1*p2$$$ and both greater than some number which I took 50 then it is always beneficial to take the largest number +1 rather than finding a common multiple among them and then adding length to it. I mean a single number with multiplication of a number greater than some threshold is always more than finding a common value(GCD) + length.

      • »
        »
        »
        »
        28 hours ago, # ^ |
        Rev. 2   Vote: I like it 0 Vote: I do not like it

        Your idea works, but the chosen cutoff must be 2n (Submission).

         Let freq[i] = the number of times i occurs in A.
        Let m = max(A).

        1. B contains one distinct number (x):
          f(B) = x + freq[x].
          So, answer >= m + freq[m] >= m + 1.
        2. B contains 2 or more distinct numbers:
          gcd(B) <= m / 2.
          => f(B) <= m / 2 + n
          To change the answer, f(B) >= m + 1.
          => m / 2 + n >= m + 1
          => n-1 >= m / 2
          => m <= 2n-2
          => m < 2n

        If m >= 2n:
          answer = max(x + freq[x]) for all x in A.
        Otherwise:
          Use O(n * sqrt(A[i])) = O(n * sqrt(n)) fallback algorithm.

        I tried to use latex but it gave this message and does not let me post: "The comment contains source code without markup.".

        • »
          »
          »
          »
          »
          27 hours ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          This is good. Thank you.

»
21 hour(s) ago, # |
Rev. 4   Vote: I like it 0 Vote: I do not like it

I don't know why my code give wrong answer for the 6th test case for MEXSUM ~~~~~ My submission