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

Автор mohammedehab2002, 3 года назад, По-английски

It's me again!

Codeforces round #717 will take place on Apr/21/2021 16:35 (Moscow time), an hour early than the usual timing. It's rated for the second division, but, as usual, first division participants can take part out of competition.

The problems were created by me, and some of them are based on the Egyptian IOI qualification. I'd like to thank:

You'll be given 5 problems, but this time you'll have 2 hours to solve them.

UPD: the scoring distribution will be 500-1000-1500-2000-2750.

UPD: the editorial.

UPD: congratulations to the winners:

Div.1:-

  1. LJC00118
  2. antontrygubO_o because he has to get a mention
  3. Mehrdad_Sohrabi
  4. zscoder
  5. SSRS_

Div.2:-

  1. ShuijunDainifei
  2. Dolodu123
  3. alya_wow
  4. PolarFlea
  5. Kazaoka_Mari

Good luck & Have fun :D

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

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

Codeforces : So how much contribution do you want?

mohammedehab2002 : YES

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

As a tester, I can confirm that the problems are brilliant. Also, the statements are very short and clear :)

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

    Number theory again?)

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

      please I hope not ... Number theory is that kind of question that if you dont know that you cant solve it prefer data structure and some problems requring some special tricks !

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

        No offense, but how do number theory problems fall into "that kind of question that if you dont know that you cant solve it", while data structure problems don't fall into the same category?

        At least in number theory, you can usually build up some intuition to solve the questions from more fundamental ideas, while data structure problems are practically unsolvable if you haven't come across the data structure before.

        Granted there are some number theory problems that are basically "apply some strange formula that no one has heard of before unless they've read this paper", but those are rare in well coordinated contests.

        In my opinion, both are tools, use them appropriately to solve a problem and its nice, design a problem to fit the tool (outside of educational contests) and its usually boring.

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

          I agree, but nowadays contests usually contain only math, number theory and constructive algorithms, these kind of problems aren't unnecessary, but we aren't seeing algorithms like dfs, bfs, etc in problems with difficulty lower than 2000. I know if a problem with rating say 1700 requires such algorithms will be pointless, but if someone wants to improve their skills in these algorithms it has to be with easier problems, not difficult problems they can't solve.

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

            I think there are a lot of problems rating under 2000 requires implementation of classic algorithms so you don't need to solve them on the official contest if you want to improve skills

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

              Perhaps it would be better to say testing skills instead of improving, in an official contest participant tries to focus and think continuously, but if they try to solve a problem not in an official contest it probably won't have the same concentration because there is no time limit to solve it.

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

          I ve regret for what ive said,cannot agree with you more!

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

          Those who have agreed to this , your mind will change see first 2 3 minutes of the legend Ben Awad's opinion on CP.

          https://www.youtube.com/watch?v=2ndv5-3CIrs

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

    Weak SYSTEM tests in problem A!!!

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

Two consecutive mohammedehab2002 rounds. Hope I'll perform well.

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

More Baby Ehab on way!!!

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

As a tester, I can confrim that problems are interesting and tests are strong. Also, the statements are short and clear. :)

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

    is it another math contest instead of being a programming contest? also, are the tests as strong as they were today? PS: not trying to be satirical, these are genuine concerns I have.

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

      CP can be better described as a discrete math puzzle solving contest than a programming contest.......

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

        Of course, I understand that. So would you say Round #716 had very interesting questions and a very nice difficulty slope?

        Classic, answering something entirely different instead of addressing the original question.

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

          He did address your original query. You said "Is it another math contest instead of being a programming contest ?". I dont see why you are considering math and CP to be independent things. CP is more than a programming contest. Math makes it way more interesting and challenging

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

        Programming itself is maths, what else you do with programming apart from solving big mathematical computations which you can't manually.

        Unless you are writing some HTML code, no maths is used in that

        Remove all the maths from programming show me what you will be left with

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

    Weak SYSTEM tests in A!!!

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

    How do you call not putting x x x 0

    in pretests

    "strong pretests"

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

Мама, я в телевизоре!!!

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

xorz again

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

I guess the XOR will be in this contest instead. I have hopes.

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

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

![ ](Hi)

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

Great, now I have to skip one more round : )

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

hope problem b is easier !

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

Now the missing XOR problem will come in this round.

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

This time How many problems did antontrygubO_o rejected without reading them ? :D

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

again google forces?

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

Whoa, that's the shortest contest announcement I have seen in all my time here on Codeforces.....at least from among the contest announcements that I remember :) . Looking forward to a nice contest. See you at the scoreboard.

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

Good luck to all!

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

Hoping for less google problems :)

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

Note : An hour early of the usual timing.

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

In the Codeforces Round #716 announcement, it was written "This may be the most and only balanced round I've ever set.", which means Round #717 will be an unbalanced round. Hence, participate at your own risk :)

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

As a tester, I can confrim that problems are interesting and tests are strong. Also, the statements are short and clear. :)

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

bitwise and number theory again XD

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

please put strong test cases in pretest and special cases problem a hacked from me last round :(

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

XOR again?

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

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

Someone: Ehab round is tomorrow or yesterday?

Me: Yes

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

Can you move the start of the round to 17: 35?

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

Why the round isn't started yet?

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

@mohammedehab2002 I enjoyed your yesterday's contest, Problems were good and were not having the story drama and all

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

Нижегородское ОПГ на тестерах

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

Hoping to see concise statements again and Ehab's X-OR won't be missed this time ig

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

I really enjoy mathy rounds, so while I can not surely assume it will be, it is still a nice round to look forward

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

orz

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

And actually why did the last problemset did not involve your favourite XOR ?

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

no xor last time :(...

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

as a tester i tested negative for covid 19 thanks to god!

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

.

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

I believe it is a wonderful problemset :D

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

mohammedehab2002 Scoring Distribution?

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

    Will the amount of question you solve change after getting the scoring distribution? so why does it matter so much

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

      Why do you think the scoring distribution is posted hours before every contest?

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

Good Luck Everyone

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

Ramanujan mode ON

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

And here we have the signature XORRRRR problem for us XD

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

this fuckin baby again????

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

Didn't know registration closes for the whole contest if you're not able to register before for the contest on codeforces :(

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

When you begin with 500-th place and end up with 5000, because of 2-nd problem

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

partitionForces

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

I hate u

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

Why is it so hard to make word adjacent bold... spent half of the contest searching for this word

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

PRETEST 3 !!!!

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

How to solve C ?

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

    Finding 2 Subsets with Equal Sums seems to be a popular DP problem considering that its solutions are widely available on the internet...
    BTW, usage of one of these prewritten solutions is permitted by Codeforces or not?

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

    Firstly, if sum / 2 is not possible, whether due to sum is odd or other way .The ans is zero. This can be checked using a simple do. From, now the sum is at least even. Next, the answer can be achieved by just removing a number. Let the numbers have a odd number, then you can remove that odd number and sum/2 won't be possible as sum will become odd. This actually comes out as removing as the number with minimum power of 2. As, Let that power be p. The sum = 2^p * (some number that has a odd contribution=A) and if sum / 2 is possible then it also means it is of forms = 2^p*(some number) => sum = 2^p*(some even number) means A is even. So, if we remove any number having maximum power of 2 as p. Then, above conditions won't be able to get satisfied. As now sum = 2^p*(A-odd) = 2^p*(odd). Again, the left numbers have minimum power of 2 as p, so sum / 2 = 2^p*(some number) =>sum = 2^p*(even) which is a contradiction, thus now sum / 2 won't be possible

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

      Can u please explain this line

      "The sum = 2^p * (some number that has a odd contribution=A) and if sum / 2 is possible then it also means it is of forms = 2^p*(some odd number) => sum = 2^p*(some even number) means A is even."

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

        It means that sum will be of the form 2^p*A, then sum / 2 will be 2^p*(A / 2) . A should be even. You can prove this by contradiction. If A is odd then 2^p*A is sum ,also if sum / 2 is possible, it comes due to the numbers which have a minimum power of 2 as p, so sum / 2 = 2^p*(some number). But if, A is odd then, sum / 2 = 2^(p-1) * (odd number) which is not true as sum / 2 also has at least 2^p factor. So, sum should be of form 2^p*A, where A is even if sum / 2 is possible with numbers having minimum power of 2 as p.

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

The contest was really brilliant in my opinion. Kudos to the author! Even after having not performed that well, you still made my day! :)

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

What's the point in problem E if it's OEIS-able?

http://oeis.org/A087644

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

    Why didn't you AC then?

    You can't solve for $$$n \le 10^9$$$ with the info on OEIS or anywhere I searched, and solving for small $$$n$$$ is really easy compared to the rest of the solution.

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

    Even after finding the OEIS sequence , I don't think the problem is solved.

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

      Well,you can just use the $$$O(nk)$$$ DP and optimize it with Lagrange Interpolation(not sure whether it is called this in English).

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

Most people did the same mistake in B.

Checking if xor of all elements is zero or not.

nice trap

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

i would say question B is a good problem...

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

I realized today CP is not for everyone. Even after 7-8 months I can't maintain specialist. I know nobody cares and its fine but I'm really devastated ;(

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

    Cheer Up, I too lost Expert yesterday. In my case, whenever I fall to a lower position, this motivates me to perform better in the next one and regain the same place back.

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

    u got this i believe :)

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

    Don't give up.

    Try to solve at least 1 problem you couldn't solve during this round after the contest without looking at the solution.

    Read the editorial for all the problems, try to understand the solution and implement each one until they pass. Reach out to people with a higher rating for help if you can't get the solution to pass.

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

    i lost expert and am currently stabilised on pupil :(

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

    so familiar...

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

    It's ok to lose, and it's important to keep going. Even if i am not good at this, i will still keep on trying.

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

    I agree with you mate. But I am having a hard time giving it up.

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

    Chin up king, dont lose hope. You just have to push yourself and solve harder problems so that you learn something new.

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

Important words should have been bolded in the problems like "adjacent" in problem B because due to this I was solving completely different versions of problem B and C.

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

How to solve B? with some proof

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

    The xor sum of the array remains the same no matter which operation you make. So if the sum is 0, then you can just combine the last n — 1 elements and your array will consist of equal elements. Otherwise, if the xor sum is k, find the shortest subarray from the start position that will have xor k, take combine all these elements into one element, and then start this process again at the next position.

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

    B asks if you can partition the array such that each subarray has the same xor.

    If you can partition it into an even number of subarrays, you can always combine some to get 2 subarrays. If odd number of subarrays, you can get 3 subarrays. Then just brute force.

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

me when i thought you could remove any 2 elements for b and not just any two adjecent ones....

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

In Problem D, I believe I'm not the only one who think of subrange as subsequence wrongly...

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

How to solve B?

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

Is there any penalty if you get WA on pretest 1?

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

    nope

    Pretest 1 is special. It has no penalty if you fail on it.
    Mainly because it usually means you've submitted the wrong file

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

I am noticing a continual upward trend in the difficulty of Div 2 contests ever since the change (around December/January) which meant that only orange and red coders could set contests. I think there is a disconnect between the people setting these contests and what level of difficulty is appropriate. Today was another unnecessarily difficult Div 2. It makes the contest a lottery of who can get A/B quickly.

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

    I also notice increase in difficulty

    Though I've attributed it to the number of cheaters that somewhat raises the bar. But I like your explanation more

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

    I feel say for not being able to solve D and I even missed the registration before the contest. But I do think D is an interesting problem.

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

    on the contrary, having difficult contests reduce the speedforces effect. it somewhat increases the probability of a gradual increase in difficulty from b to c and c to d

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

      Theoretically that could be true, but it's not how it's playing out. What you have is a jump from very accessible questions to very difficult questions, without the middle ground that could more reasonably distinguish between people of that middle range of abilities.

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

        He is exactly talking about people like specialists and experts.

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

          I know what he's talking about, but that isn't how it is playing out. The jump is routinely from questions < 1400 level to > 2000 level with nothing in between. That makes for poor distinctions between anyone within that range.

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

This is the first time I've seen that pretests were weak enough that a pretest was added during the contest.

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

A said choose different elements, means different value or different index?

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

Problems were not clear. In Problem A, it said different elements. It didn't mention if elements could be same or distinct. I considered different elements as distinct and wasted my entire time. For example, 1 4 10 6 5 5 4 if elements are considered distinct 0 1 6 13 should have been the answer. 5 5 6 4 0 5 6 9 0 1 6 13

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

Слабые системные тесты!!!

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

Problem A statement says that two chosen element must be different

Which means that the answer for the test 2 100 1 1 should be "1 1" instead of "0 2" since there is no pair of two different elements

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

Weak system tests!!!

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

I want to know why for the third problem, if we pick the minimum element, it will be giving wrong answer?

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

    2 3 3 4 4
    Even if you remove 2, you can still partition it into 3 + 4 = 3 + 4

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

    Consider this case:

    7

    2 2 2 2 2 3 5

    you have 2 + 2 + 2 + 3 == 5 + 2 + 2

    If you removed the first element, you will have 2 + 2 + 2 + 2 == 3 + 5

    If you removed the second element also, you will have 2 + 2 + 3 == 5 + 2

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

    For 4 4 6 6 8 16 then first set 4 4 6 8 , 16,6 now if you will remove 4 then 16,4 and 8,6,6 will be the case

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

Sigh. Failed problem B in the main test #16.

Anyhow, for problem C, can someone provide a test case where the following fails :

  1. Check if we can construct sum/2 using some of the elements. If not, answer is 0.
  2. Check if sum is odd. If so, answer is 0.
  3. Check if there's an odd element. If so, it can be removed to make the sum odd. Answer is 1.
  4. Remove the smallest even element. In which case answer is 1.

I understanding that this is failing in the last step (#4) but can't think of a test case.

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

Can someone explain the "smallest lexographical array" from A

"An array x is lexicographically smaller than an array y if there exists an index i such that xi<yi, and xj=yj for all 1≤j<i. Less formally, at the first index i in which they differ, xi<yi."

Wouldn't this mean that all xi<yi and all the elements before i from both arrays must be equal? Something like this: original: 5 3 8 2 new: 5 2 8 2

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

    Not necessarily. Say we have two arrays, A and B. All that sentence really means is that if there are two arrays and they are equivalent until index i (so this can be index zero too), then array A is lexicographical smaller if, and only if, it's first element at which they are different is less than that of array B's element at that spot.

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

Can anybody help that in C when array is 'good' at beginning and none of its element is odd. Why are we choosing the element with smallest power of 2 to be removed from it ? Thanks!

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

    Let us consider the following array -> 24,12,16,28 .

    On dividing by 2, the array becomes 12,6,8,14 . The subsequence sums are still even.

    On dividing again, we get: 8,3,4,7 .

    You can clearly see 3 and 7 are odd and removing either will make the already even equal subsequence sum odd. Now you know that in the original array, on removing the corresponding numbers, the remaining array sum cannot be split into two subsequences of equal sum as had it been possible, it would have been a simple multiple of 2^x of the current subsequence sums obtained on removing an odd element.

    Hence, the number which has the smallest power of 2 within it will be one of the fastest to reveal itself. That is why we are choosing the element with the smallest power of 2

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

      I am not getting the part where we are seeing it by dividing the whole array by 2 again and again .. like why dividing it by 2 again and again wont change our answer

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

        In the reduced array, if on removing some member, we manage to obtain two subsequences with equal sum s1 and s2, then the actual sequence on removing the corresponding element would have sums s1*(2^x) and s2*(2^x)

        If s1! =s2, then no matter how many times you multiply both sides by 2, they will never be equal.

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

    Check this for an intuitive approach

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

In the last round A had weak pretests, now in this round B & C have weak pretests :)

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

Failed System Test 16 in B. So, here it comes:

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

    Weaker pretests mean some opportunities for hacks.

    And without hacks Codeforces rounds woudn't be so interesting.

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

questions are short and clear and also begiener friendly....i really enjoy the contest

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

Being 100% honest those are the types of problems i would expect in a educational round. Very "there is a page on geeksforgeeks for this"-esque. Not that it's necessarily bad but it's my impression

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

I failed task C because I printed 0-indexed solution

There was no hint at all, that it was supposed to be 1-indexed.....

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

    The second line contains n integers a1, a2, …, an

    I don't see a0 here

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

    It is explicitly stated in the problem description and it is also clear from the examples not to mention it is a common practice.

    How the hell is it "no hint"

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

Weak system test for c. My random solution is passing.

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

Can we hack solutions now?

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

How to solve D if we partition into subsequences rather than contiguous subarrays?

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

    Answer for given range is maximal count of numbers with the same divisor. You can iterate over prime numbers, count how many numbers are divide by some prime number for every prefix and then using it, calculate answer how many numbers in given range are divide by some prime number. To fit in memory limit you should get answer for every range for one prime number and then calculate for another (maximalizing final result).

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

      I don't think this is correct; this was my first thought too.

      For example, given three numbers: 6 10 15, wouldn't you need three buckets (no two of them can go in the same bucket). But, any prime only divides into 2 out of the 3 numbers.

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

Almost 50% submission for problem "B" and "C" got rejected...It's really astonishing!!!

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

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

Really nice question set with good difficulty balance and fast editorial, that two in a row. Waiting for your next one buddy.

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

To not keep you waiting, the ratings updated preliminarily. In a few hours, I will remove cheaters and update the ratings again!

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

Can someone hack this submission? I'm doing knapsack dp n times in worst case it should TLE I guess

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

Can someone provide test cases for B. Still failing for pretest 4

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

Everybody missing "adjacent" in B. Me missing "at least" in B.

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

    This missing of atleast almost ruined my contest. I was busy thinking how come it is going wrong on pretest 3 again and again, later realized the mistake.

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

Can we do D without binary lifting?

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

Good problems, good round. Hopefully such rounds will be more.

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

unknown

Note: the person in the meme is my friend Ahmadsm2005 in the ioi qualifications contest XD

Meme by: Nakeeb

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

HELP: I really don't know what's wrong with my solution for B ;( Name the prefix-xor array as S[], then enumerate the index x (1<=x<N), and suppose S[x] to be the element of the final array. Then check it by the following way: Let i from x+1 to N, set a variable t=0, and for each time, t = t XOR a_i, and if t==S[x] then t=0, which means an interval with the same XOR has been found. And when the traverse of i is finished, the answer is "YES" only if t==0 in the end. Could you please hack my solution? Or please let me know if my description is not clear :) Thanks! My contest submission number:113743632

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

    I guess by saying "Could you please hack my solution" you are asking for the test case where your code fails. Check the test case 2 0 ( array having two elements 2 and 0 ). Here we cannot not divide the elements into two sets having equal xor, But according to your solution, for indx i = 1, t value is zero, hence it prints "YES" But the answer is "NO".

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

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

Please update problem ratings.

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

D can be done using square root decomposition. First find for every index, the next index that is not co-prime with it. Then to answer the queries, we can use square root decomposition My solution

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

System MikeMirzayanov I have received a message regarding my solution coinciding with some other solution. But, during the contest, I have used the code snippet from the Leetcode discussion form. https://leetcode.com/problems/partition-equal-subset-sum/discuss/853769/01-knapsack-cpp-solution which is published on September 20, 2020. Rest all code and logic is mine. Probably the guy had used the same code. Extremely sorry for using code from the Internet. Apologies for the blunder I had. I will make sure this doesn't happen again. Extremely sorry again. Thanks

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

Some people in this round are plagiarized and their submissions have been skipped. However their ratings haven't been affected. Like they were not regarded for the rating change, however they should have got some negative or positive ratings according to the system formula.

Contest organizers mohammedehab2002 & MikeMirzayanov please look in this matter

I can also point out the users privately if you want

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

My solution and is taken from gfg's open avialabe article. As ypu can see in these pics. GFG's and Mine These state it was an pre released code. It is clearly not a voilation .