Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Блог пользователя yan.silva

Автор yan.silva, история, 5 лет назад, По-английски

Hey guys, what's up? How's the quarantine going?

Leonardo_Paes and I are preparing our first contest. It is ICPC-style, but we recommend that it should be done individually. You'll have 5 hours to solve between 10 and 12 problems. It will be held on this Sunday ( 03/29/2020 ), 14:00 UTC-3 in a private group. You can join this group using this link: https://codeforces.net/group/t62S9paTEF.

We really hope you enjoy the contest!

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

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

We hope you will have fun!

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

Hope your contest will be success <3

I see no contest in the link ?

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

Will it be rated?

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

It would be great, if this contest will be in other date, because at this time a lot of cf users(and ICPC teams) will be in opencup.ru contest.

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

    We think that changing the date of this contest it's a bad idea because we had announced it to many people already. But, if people like this contest, we'll make more contest and more people will be able to participate.

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

Why not using those problems in Codeforces Round?

I know it's kinda difficult to prepare official rounds but official rounds are also well organized :)

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

Thank you for your efforts! Hope it's gonna be fun!

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

The contest is now available to register!

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

The participant's solutions will be made available?

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

    Can anyone explain how to solve C. Trees and Decrees?

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

      Binary search on the answer, sort the queries by $$$r$$$ and for each query go from $$$l$$$ to $$$r$$$ taking the maximum you can until that query become 0 or it's impossible.

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

        thank you for responding Devil, but can you elaborate it a bit more after sorting the queries by r.

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

          Suppose that you want to know for a fixed $$$k$$$ if the answer is $$$\le$$$ $$$k$$$

          Let's see it as an array $$$A$$$ of $$$n$$$ elements with value $$$k$$$

          Then for each query $$$l, r, x$$$ you need to subtract a total of $$$x$$$ between $$$[l, r]$$$, if you can do that and $$$A_i \ge 0$$$ for all $$$i$$$ in the end then the answer is $$$\le k$$$

          The best way of do that is greedy sorting the queries by $$$r$$$ and for each one do:

          for i in [l, r]:
              z = min(x, A[i])
              A[i] -= z
              x -= z
          

          if all the queries have $$$x = 0$$$ in the end the answer is $$$\le k$$$

          For speed up the solution just use the compression path idea of disjoint set for find the next $$$A_i > 0$$$ instead of iterate from $$$l$$$ to $$$r$$$, here are the solution

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

    Please release the solutions and test cases. Leonardo_Paes

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

What was the expected solution for D? Felt something like connected components, but no luck.

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

    You need to just find the smallest rectangle such that all points lie in it or on its borders, then just remove the points on the borders of this rectangle and start again until no points are left. Here is my code.

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

      I don't get why this is valid?

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

      Your solution seems to be wrong for this case, unless you're doing something I'm not understanding.

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

        Yep it seems like my solution is wrong for this case, it looks like tests are weak for this problem!

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

        what is the expected solution to this problem? Also could you allow us to see other people submissions?

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

      I didn't submit the solution during the contest, and I think that I've misread the statement in some way. Tried re-reading it, but didn't help.

      So, on the following test:

      test
      visualization

      your code outputs 3, but the answer, in my understanding, is 2 (you can deal with the top left square and the bottom right square separately).

      Could someone please point out what piece of the statement I understood incorrectly? :) (since I'm pretty sure that it's my problem — there are x16 accepted solutions).

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

        It's not just you, I talked to some of the people who got AC in this problem and they seem to be confused by this test too :P

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

          It's quite funny that we posted exactly same countertests to the abovementioned solution :)))

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

        I think they forgot about this test, I totally agree with both of you!

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

Nice contest! Thanks :)

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

Problem K: The arrays x and y will be destroyed after this query; the new array receives the index of the smallest positive integer that has not been used yet. The meaning of destroyed in this case is very confusing, I couldn't send it in time because I understood that destroying restores the id :(

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

    Oh, sorry :/ The array is destroyed but the index was already used :/ We are working hard to rejudge the solutions.

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

How to solve H? I came up with the obvious O(n^2*k) dp solution but couldn't figure out a way to optimize it.

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

Thanks for the contest :)

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

Thanks for the contest! Will there be an editorial?

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

Really my fault for not asking clarification, but the phrasing led me to believe the first query in K meant adding $$$v$$$ to the $$$y$$$-th element of the $$$x$$$-th array, rather than setting the $$$y$$$-th element of the $$$x$$$-th array to equal $$$v$$$ :(

Anyways, thanks for the contest! The problems were pretty nice.

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

Nice contest! Can you please make all the testcases visible to us?

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

Problem K doesn't work again.

Btw. nice contest! Enjoyed it.

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

can someone help me in problem B,i tried to solve it using weighted bipartite matching but i got TLE in test case 85.

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

Can someone share their solution for problem H?

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

Any editorial? Leonardo_Paes yan.silva

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

I have solved the problem A using DFS , I have an intuition about what to do but i am getting wrong answer in the fourth test case,can someone help me out with that. By the way,i am not even taking the edges with composite weights as inputs,as they really don't matter.This is the link to my code....

UPD..I found my mistake,btw thanks...