Getaway_Car's blog

By Getaway_Car, 2 hours ago, In English

Thank you for participating in the round!

Fun facts
Rate this round

2277A - Subset Selecting

Author: Getaway_Car

Hints
Tutorial
Code
Rate the problem

2277B - Sequence Decreasing

Author: Getaway_Car

Hints
Tutorial
Code
Rate the problem

2277C - Edge Addeleting

Author: _O_v_O_

Hints
Tutorial
Code
Rate the problem

2277D1 - Number Operating (Easy Version)

Author: Getaway_Car

Hints
Tutorial
Code
Rate the problem

2277D2 - Number Operating (Hard Version)

Author: Getaway_Car

We'd like to thank RockyYue for providing an optimized solution.

Hints
Tutorial
Code
Rate the problem

2277E - Tree Guessing

Author: _O_v_O_

Hints
Tutorial
Code
Rate the problem

2277F - Token Re-Moving

Author: Getaway_Car

Hints
Tutorial
Code
Rate the problem
  • Vote: I like it
  • +3
  • Vote: I do not like it

»
2 hours ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by Getaway_Car (previous revision, new revision, compare).

»
117 minutes ago, hide # |
 
Vote: I like it +16 Vote: I do not like it

if D1 was b then it is not fun fact but horror fact :p

»
112 minutes ago, hide # |
 
Vote: I like it -24 Vote: I do not like it

I feel like d1 was a bit easier compared to most other div2 d's. Nice round tho!

»
101 minute(s) ago, hide # |
 
Vote: I like it +11 Vote: I do not like it

Why is problem E and F easier than problem D

»
91 minute(s) ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

D2 is much harder than E...

  • »
    »
    89 minutes ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    I figured out the recursion for d1 in log n but i didnt understand how to do it for 10e18, ik we have to like reuse some values but couldnt understand edu

»
89 minutes ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I wish I could participate but gotta study bio for my bio exams in 2 weeks :/

»
87 minutes ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I don't like trees, so I skipped C and went straight to D, only to get stuck there :(

»
80 minutes ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

I had studied but still able to solve till C...!!

»
75 minutes ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

fast editorial!

»
75 minutes ago, hide # |
 
Vote: I like it +5 Vote: I do not like it

A is damn hard...

»
66 minutes ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

speedblitz edu :O

»
57 minutes ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

fast editorial!!

»
43 minutes ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

in q c. i did by using dsu path compression as i dont know how to do binary uplifting. we can obervse that any node say x then if x and n have lca other than 1 it can make path longer . so if their lca is not 1 its useful to us.so i use dsu path compression to store par of everyone either its 1 or other (i stored a path from 1 to n in a set and now i stored everyone par as 1 of member of this set) now. for every vertex that we are given to explore. i just see if the par is not 1. then just used that formula . 1+depth(n)-2*depth(common lca)+depth(j).its not the best approach but i am happy first time i solved q. c in contest.

  • »
    »
    24 minutes ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    There exists an easier method as well using DFS.

    • »
      »
      »
      11 minutes ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it
      Spoiler
»
22 minutes ago, hide # |
← Rev. 2  
Vote: I like it 0 Vote: I do not like it

could anyone tell me whats wrong with my solution for A 395842509

»
21 minute(s) ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Problem B is confusing. First the problem says, "3. choose one element of this subarray and remove it from b, without changing the order of the remaining elements."

And then in the 4-th testcase, 5 // 2 1 1 0 3 the output is 5. The tutorial assumes that we only can reduce the elements and skip the removal part! What's going on?

NOTE: I can be wrong, please explain your point simply! Tnx!

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

    We can show that 5 works here; by choosing entire array, our first operation can be solely the final element which makes the array 2110 (since 3 is removed), from there we can choose [1,3] at whcih the array can be 000 since it goes 2110->1000->000. I think this is how it might go?

  • »
    »
    3 minutes ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    They haven't specified the size of the subarray we have to choose in the qs. So since there is already a 0 present in the subarray, we can just take our "good" subsequence as 2 1 1 0 3 and then perform 4 ops on each of the individual elements.

    Take [2] for instance, after 1 op it becomes [1] but we have to remove one element also so it becomes []. Do this for all the other ai > 0. so our final array is just [0]

    We can just extend this idea to the case where we don't have a 0 at all in the array. In general if theres at least one element <= n — 1, we can make the whole array "good".

  • »
    »
    1 minute ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    I mean, one could only reduce an array's size after removing some elements from it?

    For the testcase, You can select the full array as a sub-sequence and test if it's good or not.

    [2 1 1 0 3] For making this good, select the [2 1 1] as a subarray and do the subtractions, becomes: [1 0 0] and remove an element, let's remove 1 becomes: [0 0] + [0 3] = [0 0 0 3]

    Then select [3] as a subarray, decrement to get [2] and remove an element to get []

    [0 0 0] + [] = [0 0 0] As you can see, we have boiled the array down to a non-empty array consisting purely of zeros. So this subsequence is good and because it is the largest subsequence, it is also the answer.

    To make the process easy, you could start by asking:

    Spoiler
»
14 minutes ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I am too weak :(

»
3 minutes ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

My solution discussion stream for ABCD1E

»
2 minutes ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

My Question to the people who were able to do D1:

How can you be sure during the contest that these two ways were sufficient, and there is no other way of 0 -> (operations) -> n, which gives a more optimal answer ?

Based on my prior experiences, whenever I find two ways of doing a thing and drawing cases show that for some cases first way gives correct answer and for some cases the second way, the general tendency of mine is to take the best of these two ways just to get a WA on test 2. Unfortunately, I did not even try minimising both definitions of f(n) i wrote, during the contest, and later found out that it was indeed the optimal solution.