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

Автор ko_osaga, 6 лет назад, По-английски

새해 복 많이 받으세요, 코드포스! (Happy new year, Codeforces!)

Welcome to the first Codeforces Round of the new decade, Hello 2020! The round will be held on Jan/04/2020 15:05 MSK.

Some information about the round:

  • Div 1, 2 combined
  • 2.5 hours!
  • 7 problems!
  • No subtasks!
  • Score distribution: 500-1250-1750-2500-2750-4000-4000
  • Yes, it is rated!

This round is prepared by ko_osaga nong ckw1140. I am personally very thrilled to deliver my first Codeforces contest as such a memorable one!

More credits for the contest:

UPD: Editorial. Thank you for your participation!

UPD2: Winners:

  1. mnbvmar
  2. TLE
  3. Benq
  4. tourist
  5. gamegame
  6. never_giveup
  7. dario2994
  8. yosupo
  9. Marcin_smu
  10. kczno1
Анонс Hello 2020
  • Проголосовать: нравится
  • +1231
  • Проголосовать: не нравится

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

First comment of the decade on a CF round blog.

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

Happy New Year!

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

No offense, but how can a blue coordinate a round written by orange writer? not to say such an important round.

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

Hello ko_osaga!

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

Where's the interactive :o

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

The decade starting with Korean round! This is so great!

»
6 лет назад, скрыть # |
 
Проголосовать: нравится +43 Проголосовать: не нравится
»
6 лет назад, скрыть # |
 
Проголосовать: нравится +23 Проголосовать: не нравится
»
6 лет назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

everyone can participate?

»
6 лет назад, скрыть # |
 
Проголосовать: нравится -16 Проголосовать: не нравится

The first contest in2020.Hope everyone can get a good place!

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

Hope I will became expert for first time in this round!!!

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

Hello 2020!

»
6 лет назад, скрыть # |
 
Проголосовать: нравится -55 Проголосовать: не нравится

Кажется, что подзадачи на cf стали настолько нормальной практикой, что контест, который обходится без них, воспринимается как нечто необычное и хорошее, раз составитель отмечает это.

»
6 лет назад, скрыть # |
 
Проголосовать: нравится -74 Проголосовать: не нравится

But it is not the new decade, except you consider that every year(not only year, it can be month, day, etc.) starts a new decade, with start in that year. Now it is 21 century, it started on January 1, 2001, not 2000. And this year is not a first year of 203 decade, it is the last year of 202 decade.

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

hope pretest passed => system test passed

»
6 лет назад, скрыть # |
 
Проголосовать: нравится -83 Проголосовать: не нравится

Waiting for anyone asking if it's rated or not..

»
6 лет назад, скрыть # |
 
Проголосовать: нравится -48 Проголосовать: не нравится

i hope that my rate exceeds 2020 Through 2020

»
6 лет назад, скрыть # |
 
Проголосовать: нравится -7 Проголосовать: не нравится

Is the score format like educational rounds or like goodbye 2019 ?

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

Good competition is coming. (Radewoosh, EvenImage and tourist)

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

다들 새해 복 많이 받으세요~~ happy new year~~

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

I am very sad that I have no time.For a terrible exam. o(╥﹏╥)o

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

good bye 2019

»
6 лет назад, скрыть # |
 
Проголосовать: нравится -34 Проголосовать: не нравится

⠀ ⠀ ⠀ ⠀

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

Wow!! I can't wait!!!

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

2020!

»
6 лет назад, скрыть # |
 
Проголосовать: нравится -125 Проголосовать: не нравится

ko_osaga On a genuine note, in last contest too, it was said there wont be any subtasks but there were subtasks. If there are going to be subtasks, then please don't say "No subtasks"

»
6 лет назад, скрыть # |
 
Проголосовать: нравится -43 Проголосовать: не нравится

Really NOT friendly for US time T_T TAT TvT TwT

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

I have a suggestion guys. It would be great if the problem setters include some ques on Graphs an Trees in any of the A,B,C,D ques of the contest . It is generally there on the E,F ques which a not so good programmer like me find it too hard to solve and doesn't get enough exposure of these kind of problems in the real time.

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

Welcome 2020!

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

I admire the Coordinator because he usually makes simple problem statements that are easy to read and understandable.

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

Happy new year!

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

Wow there is more than 14,000 registeration.

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

Ceremony sense of New Year

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

The prize of the contest has no T-shirt?

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

Happy New Year!

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

Look like, it going to be first contest in codeforces with 15000+ registrations.

UPD -: 15000+ registrations achieved.

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

Happy New Year, Codeforces...!!!

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

Korean round assa!

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

.

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

15k+ registration

I think it is highest ever. Best of luck for all and server as well as.

»
6 лет назад, скрыть # |
 
Проголосовать: нравится -47 Проголосовать: не нравится

$$$15521$$$ registered users, I think it would be wiser not to participate, as the servers will surly suffer :(

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

Oh Oh, 15k5 Participants @@

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

Queueforces for the first contest of this decade...

Edit: Sorry seems it didn't matter much. Next time I will sent such comment after contest.

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

tough one

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

I am new to CF. The submission result alarms me each time, as my logic works alright in IDE, but here it says it's an error

»
6 лет назад, скрыть # |
 
Проголосовать: нравится -23 Проголосовать: не нравится

Tough!

»
6 лет назад, скрыть # |
 
Проголосовать: нравится -21 Проголосовать: не нравится

Hardest contest I had participated so far

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

What is TC9 in E ?

»
6 лет назад, скрыть # |
 
Проголосовать: нравится -11 Проголосовать: не нравится

What is the idea to solve B other than segment tree?

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

Good contest, thanks!

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

How to solve D?

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

How to solve E?

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

    Let K be the sum of the points lying inside each triangle. The answer is: K * (N-4) / 2;

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

      How to calculate K?

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

        For each triangle, calculate the number of points in it. To do this, we calculate for each segment the number of points under it. Now we can calculate the number of points in the triangle for $$$O (1)$$$, we just need to analyze the cases.

        And don't forget about pragmas.

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

          I thought there's some cleaner logic to compute this. But I guess it's easier if one already has that code for some other task sitting in their computer and pastes it straight away.

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

            What about not computing K? xd

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

            I didn't use any prewritten code and it took me 15 minutes to solve this problem. Learn how to solve geometry problems instead of complaining.

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

            I think further simplification might make this easier.

            Instead of calculating no of points inside every triangle, we can just subtract no of convex quadrilaterals, which then gives;- $$$ K = \binom{n}{4}- num of line segment intersections $$$

            Since diagonals of convex quadrilaterals intersect.

            I think line segment intersections is a well known problem. However, I didn't have sufficient time left to code it during the contest, so the formula is unverified, please let me know if there are any mistakes.

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

        Fix the point which lies inside. make it center and sort the rest of the points ccw wrt the center. Now we can count the number of triangles using prefix sums of number of points that give positive cross product for each point.

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

        Goal : A point $$$p$$$ and a set of $$$N$$$ points $$$S$$$ are given. We want to compute the number of triangles containing $$$p$$$.

        We can easily know that the answer is "$$$N \times (N-1) \times (N-2)/6$$$ — (the number of triangles which do NOT contain $$$p$$$)". If the triangle $$$s_1 s_2 s_3$$$ does not contain $$$p$$$, then there is a straight line $$$l$$$ that splits $$$p$$$ and three points $$$s_1$$$, $$$s_2$$$ and $$$s_3$$$. Thus, we can design the algorithm below:

        1. Consider the line $$$l$$$, which passes the point $$$p$$$.

        2. Rotate $$$l$$$ about $$$p$$$.

        3. When $$$l$$$ touches a point of $$$S$$$, compute the number of points that are on the left side of $$$l$$$.

        4. Let $$$k$$$ be the number, then add $$$(k-1) \times (k-2)/2$$$ to the answer.

        5. Do the step 2. to 4. until $$$l$$$ is rotated by 360 deg.

        The naive algorithm is $$$O(N^2)$$$. But you can do it in $$$O(N lgN)$$$ with sorting points $$$S$$$ about $$$p$$$ — something like ccw-sort

        Now, whole the problem can be solved. Just do the steps above about all the $$$N$$$ points. The time complexity is $$$O(N^2 lgN)$$$.

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

Problem C was very nice.

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

F: It is always possible to achieve a perfect matching. Proof using hall's theorem.

Call the initial set of edges in $$$T_1$$$ original edges. Iterate on edges $$$(u, v)$$$ of $$$T_2$$$ and find any original edge $$$(a, b)$$$ in $$$T_1$$$ on the path between $$$u$$$ and $$$v$$$ (there will always exist an original edge, otherwise we have a cycle in $$$T_2$$$). Cut $$$(a, b)$$$ from $$$T_1$$$ and link $$$(u, v)$$$. We can use hall's theorem to prove a perfect matching among unmatched edges.

Can we solve this problem without LCT?

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

D was interesting to me ^^. Could you guys show your solution to this problem?

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

    The main idea is check venue-sensitive set with size 2

    For each lecture, check if the list of lectures that intersect with it in venue $$$a$$$ is the same as the list of lectures that intersect with it in venue $$$b$$$

    Instead of comparing each element in two list, we'll check does any element that appear in this list but doesn't appear in the other list

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

What was the trick for C? So many people solved it, I haven't even got any idea how to solve it.

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

I made a big strategic mistake :(

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

    It is almost always not the right idea to start with the harder problems.

    Here is the explanation: It is more probable that you will get the easier problem quickly and harder problem will take more time. Submitting earlier ensures that you don't accumulate the penalty for the easier problems. Even in a simple scenario where you solve A in 3 minutes and E in 30 minutes, your penalty is 3 + 33 = 36 minutes. If you solve A later, you penalty for A is 33 minutes and so the total penalty is 63 minutes. I don't exactly know about how scoring works, but at least in the time penalty approach you can see how worse it can be to not solve an easier problem.

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

In task D, why the answer for test case 3 is "YES"? We can attend 1 and 3 at A (1-2 and 3-7), but can't attend at B (5-9 and 6-11)

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

The difficulty of problemset was high a bit for me, but it was good problemset.

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

How to solve C?

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

Can anyone explain me solution of Problem C I wasn't able to find any pattern in answers neither I was able to think of any dp approach

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

    Let'x fix length of good segment, there is (n — len + 1) ways to choose starting number, (n — len + 1) ways to place those numbers, len! ways to permute those len numbers, (n-len)! ways to permute remaining numbers.

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

In problem D I created 2 segment tree one for a and one for b

Then in each query I check if all cells between xa and ya is empty and if it true I mark in array that he can attend this lecture and make update query and makes all this cells occupied, (the same with xb, yb).

at the end iterate over the attended array and if there is attended1 != attended2 I print No

if all have the same values I print Yes.

I got Wa on test 17, anyone know why ?

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

E is a very interesting and original problem. The best problem of the decade

»
6 лет назад, скрыть # |
 
Проголосовать: нравится -25 Проголосовать: не нравится

how can I implement this for problem c:

t=0
for (i=0;i<n;i++){
t += (n-1)*(n-i)* factorial(n-(i+1)) * factorial (i+1)
}
»
6 лет назад, скрыть # |
Rev. 3  
Проголосовать: нравится -9 Проголосовать: не нравится

A-D were trivial, F and G too hard so I was stuck solving the geometry problem for a hour and a half. And of course as is usual with geometry problems, of that around 15 minutes was spent solving the problem, then the rest trying to fix case handling to avoid double-counting and issues with angles. Why did I even try?

Could we please leave geometry to ICPC and have good problems in contests instead? :)

EDIT: 180 lines and FIVE Fenwick trees later I think I'm done debugging.

EDIT2: And my code for sorting by angle was too slow. After lots of constant optimisation of a $$$\mathcal{O}(n^{2} \log n)$$$ solution I finally got AC (68205536)

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

H2S E?

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

As the long and detailed header of my submission for problem F might suggest, I already knew problem F. I wanted to propose it as part of an online contest.

I am happy about the rating boost I will get, but I am sad that I cannot use in a future contest the best problem I had ever invented. At least I have participated in the round, otherwise there would be only the sad part.

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

We are all waiting for the solutions ^^

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

How to solve E, I spend 1.5 hours but no idea. May be I only NEED 2 more points,then I can become CM:(

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

How do you solve C? My approach: write a stupid solution, get a table for small values of n <= 11, try to find a pattern. Unfortunately, both OEIS and me trying to figure out the pattern failed. How do you solve it then?

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

hello 2020 & goodbye rating again

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

Here's a cool reduction I made for $$$E$$$:

Claim: Find the sum of number of points in all possible triangles in the given set. Divide this by $$$2$$$ and multiply by $$$n-4$$$, that's the answer.

Proof: For any castle of $$$4$$$ points and a point $$$P$$$ which lies inside it, consider all the $$$4$$$ triangles made by taking the castle points $$$3$$$ at a time. Out of these $$$4$$$ triangles, $$$P$$$ will lie in exactly $$$2$$$ of them. Conversely, consider any triangle and any point $$$P$$$ lying inside it. If you add any of the other $$$n-4$$$ points to make the triangle into a quadrilateral, you will get a valid castle of the triangle points and this new point which will protect $$$P$$$.

Thus, we have proven a two-one bijection between these two quantities.

Now, if you could find the sum of number of points lying inside each triangle in $$$O(n^2)$$$, you have solved the problem!

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

Is E about finding how many Concave (or) Convex Pentagons can be formed from N points? If so, then how?

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

    Almost. Let $$$f_n = (\text{number of pentagons with n points on convex hull})$$$. Answer is $$$f_3*2+f_4$$$. We know that $$$f_3+f_4+f_5 = \binom{n}{5}$$$. In my solution i found $$$f_3*3+f_4*4+f_5*5 = \sum_{i\neq j} \binom{\text{number of point p having }(a[i]-p)\times (a[j]-a[i]) \gt 0}{3}$$$.

    $$$f_3*2+f_4 = (f_3+f_4+f_5)*5 - (f_3*3+f_4*4+f_5*5)$$$

    . Finding $f_5$ is $$$\mathcal{O}(n^3)$$$ problem. 1146H - Satanic Panic

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

    You haven't to do it. Consider a tuple of 5 points, the contribution of this tuple to answer is ((number of lines can split plane to 2 halfplanes and a half has 1 point, another one has 2 points) — 5). It is easier to solve base on the above observation.

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

Damnit, slightly late with F... if I'm not completely wrong. My idea is:

  • consider paths in T1 corresponding to edges in T2
  • augmenting paths imply that if we create subtrees from them by merging overlapping (on edges) paths, then in each such subtree, there's either no unmatched path (edge in T2) or no unmatched edge in T1
  • this works for any graph T2, but T2 is a tree, so it should cover at most as many edges in T1 as its own number of edges — there must be no unmatched edge in T1 and the max. matching is equal to the number of edges covered by the paths (which is N-1 because they have the same size)
  • we can proceed with simple DFS in T2 and for each edge (v, leaf), try to find the first edge in T1 on the path leaf->v that's unmatched and take this edge

UPD: Yep, it works.

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

I had a noob bug at F, but I want to know can flow pass this problem ?

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

I love this problem set(especially, F&G), thank you problem setters!

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

I derived the formula for C with probability and found Expected number of framed segments with length i.

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

Why geometry problem...

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

In E, if I manage to find for every point P:

$$$a$$$ $$$-$$$ the number of points in the upper left side of P

$$$b$$$ $$$-$$$ the number of points in the upper right side of P

$$$c$$$ $$$-$$$ the number of points in the lower left side of P

$$$d$$$ $$$-$$$ the number of points in the lower right side of P

Won't the answer for point P be the sum of:

$$$cnk(a + b,i)$$$ $$$*$$$ $$$cnk(c + d,4 - i)$$$

$$$-$$$ $$$cnk(a,i)$$$ $$$*$$$ $$$cnk(c,4 - i)$$$

$$$-$$$ $$$cnk(b,i)$$$ $$$*$$$ $$$cnk(d,4 - i)$$$

for every $$$1 \lt =i \lt =3$$$ ?

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

I just realize E's polygon is NOT necessary convex...

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

In problem G, the checker told me that I must place a wall between rock cells. However, I couldn't find the statement which specifies that point.

Did I overlook something? Or was the statement incomplete?

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

    How to solve G?

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

      It's unweighted matroid intersection. The universe is the set of all edges in the graph, and we'll try to remove as many edges from the graph as possible. We intersect two matroids:

      • A cographic matroid (a set of edges belongs to the matroid iff we can erase this set without disconnecting the graph),
      • A matroid limiting the number of edges incident to each black cell. In other words, the edges are partitioned into disjoint subsets, and each subset has the upper bound on the number of edges taken to the set. Fortunately, each edge belongs to only one subset, so this is easily a matroid (as a sum of disjoint uniform matroids).

      We then find the largest set belonging to the intersection. If you found enough edges to make the graph a tree, the answer is YES.

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

      The problem is equivalent to finding a tree over the free cells such that all the leaves are white or (1,1). This can be seen as a matroid intersection. The two matroids to intersect are:

      • Independent sets are sets of edges (pair of neighbouring free cells) without a cycle.
      • Independent sets are sets of edges (pair of neighbouring free cells) such that any black cell different from (1,1) is contained in at most one such pair.

      [Not sure it is correct, since I was not able to code it]

»
6 лет назад, скрыть # |
 
Проголосовать: нравится -29 Проголосовать: не нравится

more like Hello WW3

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

Once again he showed who is the real boss (respect you 3000).

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

How to solve D? I was thinking at hashing the intersections after you sort the intervals as you would when you want to calculate the maximum number of intervals overlapping (put both start and end points in a vector and sort). Does this lead to anything? Is there a nicer solution?

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

    Yes, it works. You can hash random weights for it to work better. I just xored all weights of intervals not intersecting with a specific one. This can be done by using 4 maps.

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

    Yes, I solved it like this. We need to check for each interval i if its set of intersecting intervals is equal in both the graphs. We compare two sets by considering hashing a set $$${a_1, a_2, \ldots}$$$ to a polynomial $$$p(x) = x^{a_1} + x^{a_2} + \ldots$$$. Then we can evaluate it at random points and check equality. The degree of the polynomial is $$$n$$$ so if you use a mod around $$$10^9$$$ the probability of failure is $$$10^{-4}$$$ by Schwartz-Zippel if you evaluate at a single point. I evaluate at four points for probability $$$10^{-16}$$$.

    68192135

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

Instead of "No subtasks!" you guys should mention "No Geometry!".

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

Gotta feel bad for tourist. TLE on Test 77 of G.

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

Thanks a lot for the round!

My screencast, mostly trying to squeeze in incorrect solutions for F and G without much success :)

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

Good move ! by EvenImage ...

Now , he will be the rank 1 ...

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

when will the virtual participation for this round start?

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

My randomised sol for D passed:

If there exists a pair of segments which intersects in one of the events and not the other then answer is NO. So each segment has to intersect with the same exact other segments in each events. This implies that for any subset the number of intersections in each event has to be the same.

So here's what I did: Take a random subset (50% chance of a segment being in it). Count number of intersections if Event A was chose, and same for Event B. If the number of intersections is diff output NO, otherwise repeat again with a diff subset(for 50 iterations). To count number of intersections, i sorted segment by left endpoint, then used binary search on each element.

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

Systests have been completed and upsolving is still unavailable. What's wrong?

»
6 лет назад, скрыть # |
 
Проголосовать: нравится -86 Проголосовать: не нравится

왜 한글이 없나... 과연 어캐ㅔ 될까요

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

I have a technical question.

After this round I will become candidate master. but before my rating changes I registered for round 612 div2. Now... if I participate in it, will it be rated for me?

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

And it's a moment right after contest. AND... Where is the editorial?)

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

Did they just rejudge G?

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

i don't understand why test 3 in task B have output is 72. Can you explain for me !.

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

    My output is 74.

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

    I'm pretty sure that the test case is large enough that there is no good explanation that is not along the lines of "because this solution, proven correct, returns 72" or "if you look at the list of all concatenations and count those with an ascent, you get 72" here.

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

    In case it helps, check the output of this verbose brute-force solution.

    Brute-Force Solution
    Output
  • »
    »
    6 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    1 with all 10

    2 with 9 (except 2)

    3 with 3(1,8,10)

    4 with 7(except 2,4,6)

    5 with 6(except 2,4,5,6)

    6 with 8(except 6,2)

    7 with 9(except 2)

    8 with all 10

    9 with 8(except 2,6)

    10 with 2(1,8)

    total 72

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

Does anyone know how to analyse the complexity of network flow(the number of edges can be $$$O(n\log n)$$$) in F?

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

I have a query : If a participant registers for a Div. 2 contest before rating change, and then enters Div. 1 after rating change, will Div. 2 be rated for him/her or do they require to re — register or something like that?

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

I think solutions for problem G are rejudged.

»
6 лет назад, скрыть # |
 
Проголосовать: нравится -24 Проголосовать: не нравится

Just solved D with a 2D segment tree (more like a Dynamic segment tree + fenwick tree ) !

https://mirror.codeforces.com/contest/1284/submission/68203222

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

found this in tourist's code lol

rng_58

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

А что делать с такими посылками? Понятно что этот код специально сделан нечитаемым(что вроде противоречит правилам), но непонятно кому и куда об этом писать. Возможно стоит добавить кнопку "Пожаловаться"? MikeMirzayanov

https://mirror.codeforces.com/contest/1284/challenge/68172307

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

"Strong testcases on problem D.." xD

Check this out -> Problem D: 68195434

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

gamegame will win IOI2020!

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

Hi Guys,

In the problem E, very very high precision is needed. Can anyone calculate?(or explain)

In 68214305 24 digits of PI couldn't pass.

But 68214338 using cos(-1.0) (more than 30 digits precision) is accepted.

Regarding the limits (and no three point collinear), how is it possible?

Note: M_PI gets compile error(not in my PC tho)... Purely correct submission(in 70 min left) would be AC if it could compile T-T

Note2: arctan(1/1e9) is like 1e-10 different than the actual PI, soo 1e-24... how???

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

problem D is too difficult to understand the request

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

Can anyone please explain why my code for D is getting TLE? https://mirror.codeforces.com/contest/1284/submission/68243271

»
4 года назад, скрыть # |
 
Проголосовать: нравится -26 Проголосовать: не нравится

For Problem D, the statement is horrendous. You say that it is bad if they overlap, and then proceed to say it is actually fine if one is nested in the other...