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

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

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!

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

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

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

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

Good Luck On The Contest :D

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

As a Ronaldo fan, kingmessi Pols_Agyi_Pols orz

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

bro made ronaldo cut cake for messi

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

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.

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

    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.

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

      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.

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

        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.

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

      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.

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

        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.

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

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

    Implementation
    Statements
    Problem order
    Input format
    • »
      »
      »
      7 месяцев назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      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).

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

How many casework questions do you want?

CodeChef : YES

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

Fun contest :)
Kudos to the authors!

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

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

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

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?
  • »
    »
    7 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

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

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

      I was stuck at this case only.

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

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

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

    The editorial will be uploaded in some time.

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

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

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

      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.

    • »
      »
      »
      7 месяцев назад, # ^ |
        Проголосовать: нравится +3 Проголосовать: не нравится
      The process can be thought as follows:
»
7 месяцев назад, # |
  Проголосовать: нравится -10 Проголосовать: не нравится

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

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

I love the problems. Thanks for the contest.

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

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.

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

A hint for B :: Palindromic Substrings?

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

    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$$$.