kingmessi's blog

By kingmessi, history, 6 weeks ago, In English

We invite you to participate in CodeChef’s Starters129, this Wednesday, 10th April, rated for till 5-Stars(ie. for users with rating < 2200).

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

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!

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

»
6 weeks ago, # |
  Vote: I like it +31 Vote: I do not like it
»
6 weeks ago, # |
  Vote: I like it +15 Vote: I do not like it

As a tester, I highly recommend participating in the contest!

»
5 weeks ago, # |
  Vote: I like it +5 Vote: I do not like it

Good Luck On The Contest :D

»
5 weeks ago, # |
  Vote: I like it +23 Vote: I do not like it
»
5 weeks ago, # |
  Vote: I like it +9 Vote: I do not like it

As a Ronaldo fan, kingmessi Pols_Agyi_Pols orz

»
5 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

bro made ronaldo cut cake for messi

»
5 weeks ago, # |
Rev. 2   Vote: I like it +3 Vote: I do not like it

The last three problems are okay, everything else is subpar. Irrelevant details in statements, low beauty (idea to implementation ratio), messed up order, inconvenient input format.

  • »
    »
    5 weeks ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    Among the first 3 problems for div1, only cake cutting might have long statement and implementation (depending on the method you choose). Beauty is subjective. These problems were one of the problems where you have to 'think before implementing'. It's your mistake if you decide to implement an overcomplicated solution. In construct xor, try to separate different bits instead of n and you get a very simple implementation with not much casework. Anyways, I'll try to work on improving problem statements and order from next time.

    • »
      »
      »
      5 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Can you please link the cool solution for construct xor? I've gone through all the model solutions from the editorial, and they are just case work.

      • »
        »
        »
        »
        5 weeks ago, # ^ |
        Rev. 2   Vote: I like it +2 Vote: I do not like it

        code

        $$$dp_i$$$ — number of elements in array having $$$i^{th}$$$ bit on. We need to maximise summation of it (to have as many non zero elements as we can) while satisfying that every term of it is even (to have xor 0) and $$$\leq n$$$. So greedily turn higher bits of $$$s$$$ into lower bits.

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

      For reference, my in-contest solution to constructor xor separates bits. I was not too fond of this problem because it's mathematically obvious why such a process results in a correct solution whenever one exists but ensuring all the constraints in code was rather troublesome. I had to write two nested loops over bits to guarantee that I would perform all necessary splits. As far as I'm aware, one loop (neither ascending nor descending) doesn't work.

      • »
        »
        »
        »
        5 weeks ago, # ^ |
          Vote: I like it +13 Vote: I do not like it

        For the purpose of maximising summation, yes, a single loop isn't enough. Although, we just need summation to be $$$\geq n$$$. For that, a single decreasing loop is enough (if $$$dp_i$$$ decreases to allow $$$2$$$ more transitions from $$$dp_{i+1}$$$ to $$$dp_i$$$, then we already have summation $$$\geq n$$$). Since most people submitted the other solution, it is not an obvious solution, at least for the intended audience for this problem.

  • »
    »
    5 weeks ago, # ^ |
      Vote: I like it +24 Vote: I do not like it

    Thanks for the feedback! I'll try to address what I can.

    Implementation
    Statements
    Problem order
    Input format
    • »
      »
      »
      5 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      My solution for TRCLR was two dfses. For XRSM I assume you mean doubling n if it's odd, which I also came up with, but at that point, I was too tired to implement it.

      Um_nik taught me to put a legend into a problem only if it helps with understanding. I don't follow soccer and reading about it didn't help me. For CKCUT I was initially confused if a flavor is applied to cherries or segments between cherries. Eventually, samples cleared it up for me.

      Problem order is not much of an issue, I wouldn't mention it if there weren't other issues.

      I understand the reasoning behind the two-line input format, but I hope that most contestants already have fast IO and I doubt that they will remove it from the template just for codechef. On the other hand, I need to write two loops (either one for each array or two nested ones for a 2xn matrix) instead of one loop with unpacking.

      Maybe my questionable experience stems from a skill gap between my math skills (all ideas except TIKI were trivial for me) and my implementation skills (all implementations were boring).

»
5 weeks ago, # |
  Vote: I like it +21 Vote: I do not like it

How many casework questions do you want?

CodeChef : YES

»
5 weeks ago, # |
  Vote: I like it +10 Vote: I do not like it

Fun contest :)
Kudos to the authors!

»
5 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

I wonder what goes through authors minds when they write problems like construct xor. Do people actually consider those beautiful?

»
5 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

in construct xor the only cases where ans is not possible

n is 1
s < n
s is odd
if n == 3 and s < 6
if n is odd and s <= n + 1
am i correct?
  • »
    »
    5 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Think about the cases where n == 3 and s is a power of 2. Are those cases possible?

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

      I was stuck at this case only.

    • »
      »
      »
      5 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      oh! i have that case in on of my WA submission but forget about it latter. nice problem Thank you for the contest. missed 5* by 6 points :(

  • »
    »
    5 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    The editorial will be uploaded in some time.

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

    if n = 3 and s = 4*X then what will be solution ??? example n = 3 and s = 16

    • »
      »
      »
      5 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      n = 3 and s = 16 has no solution. s = 4*x will have a solution as long as 4*x is not a power of two.

    • »
      »
      »
      5 weeks ago, # ^ |
        Vote: I like it +3 Vote: I do not like it
      The process can be thought as follows:
»
5 weeks ago, # |
  Vote: I like it -10 Vote: I do not like it

I am shocked how IceKnight1093 even approved some of these ugly problems

»
5 weeks ago, # |
  Vote: I like it +16 Vote: I do not like it

I love the problems. Thanks for the contest.

»
5 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Honestly, It looks like you codechef guys have run out of good problems or authors and are just doing weekly contests for formality or because you get sponsors time to time. No hard feelings, i loved and learned a lot from codechef in my first year but seeing contests made by single author most of the times and then a joke contest like this hurts me and also codechef as a brand.

»
5 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

A hint for B :: Palindromic Substrings?

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

    It can be observed that any binary string of length $$$\geq 3$$$ will always contain a palindromic cyclic substring of length $$$\gt 1$$$; meaning the game can only possible end with the length of $$$S$$$ being either $$$1$$$ or $$$2$$$.