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

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

"Love" is a violent word.
"I love that about you..." Doesn't that just mean "If that changed, I wouldn't love you anymore?"
"Love" is a word that binds you.
— Touko Nanami —

Hi Codeforces!

Ari and I are pleased to invite you to participate in Codeforces Round 715 (Div. 1) and Codeforces Round 715 (Div. 2), which will be held at Apr/16/2021 17:35 (Moscow time). Each division will have 6 problems and 2 hours and 15 minutes to solve them.

Big thanks to the following people:

The round will be themed around Yagate Kimi ni Naru, which is a romantic anime/manga series. If you haven't picked up the series yet, I highly recommend you to do so after the round ;)

Please do read all of the problems, stay hydrated during the round, and solve as many as you can! Good luck have fun to everyone!

Here are the scoring distributions:

  • Div. 2: 500 — 1000 — 1500 — 2250 — 2500 — 3000
  • Div. 1: 750 — 1000 — 1500 — 2250 — 2250 — 4000

UPD1: The round has concluded! Congratulations to the winners from both divisions:

  • Div. 1:
  1. ecnerwala
  2. ksun48
  3. tourist
  4. Radewoosh
  5. maroonrk
  • Div. 2:
  1. wannahavealife (solved all problems!)
  2. traxex2
  3. _su1sen
  4. I_love_Ilya_Krasnov
  5. tsugu

UPD2: Editorial is up!

Thanks to everyone for participating in this contest, this has been a wild ride from start to finish. See you all next time!

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

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

As a tester, they shoved weeb propaganda down my throat. I recommend participation.

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

As a tester, the problems are very elegant and you should participate in the round.

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

anime propaganda? i'll skip.

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

Wtf.Yagate Kimi ni Naru is a Shoujo Ai Anime. Shoujo ai is something related to yuri and yuri means Lesbian.

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

Now this is called a complete round, This round gives you anime recommendation(Yagate Kimi ni Naru) for dealing with post contest depression or celebration.

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

These bleeding weebs lmao

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

i never expected a timeline where bloom into you is getting a competitive programming adaptation

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

Looks like anime will soon takeover the world :D

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

I like this round already

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

See the series "after the round". Given the round is based on this series, isn't there high chances that not that great memory would be associated with this series after the round is over? Kuroni

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

I confirm that Yagate Kimi in Naru is a wonderful lesbian/yuri Japen comic, I highly recommend it too :(

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

Thanks for the early score distribution : )

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

WEEB IN!!!

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

I think I need to code for counting the number of a's in neko_nyaaaaaaaaaaaaaaaaa

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

You say weebs, but all I see are people of culture. Respect!

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

Hope to perform my best till now, in this round!

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

So, when are we getting a round themed around AOT?

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

As a Japanese otaku, this is why I cannot retired from CF!
I hope the tasks are as amazing as Yagakimi.

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

Honestly saying I dont like of idea of round being theme based, I hope statements would be clear as daylight and wont involve these characters. From my side if one wants to make a round theme based simply name the problems as your fav anime/manga whatever and people will get the propoganda nothing more than that.

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

Oh, Vietnamese authors. Good job! Keep going your contributions. I hope that one day I can write a contest. Of course, I need to be purple at least first.

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

I think something went wrong here. In the post, it says that the contest last 2 hours and 15 minutes. In the register page, it says that just 2 hours.

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

As a "noob" tester. This round is very "balance" and very good. Wish all the participants have a positive rating! :)

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

.

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

A round with anime propaganda? I'm in.

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

I am very excited for this codeforces round because the Problemsetters are Ari and Kuroni.

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

im trying to understand the blog & comments but i have no clue : (

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

Hope the Aquaman in me wakes up for some time during the contest instead of Aqua sama.

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

sir why does contest have lessbyan cartoon theme?????

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

Being an otaku , very excited for this round.

I hope we will get more episodes of these kind of round XD

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

Colorful testers :)

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

From Vietnam ưith love!

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

The comment is hidden because of too negative feedback, click here to view it

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

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

A round? I prefer two matches in Dota 2.

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

I love how the scoring distribution is released so early. +1 from me. I also have another quote for you:

LOVE

"

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

HAPPY ANIME DAY!!!(15th April)

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

YagaKimi is brilliant. Contest setter has good taste.

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

.

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

Kuroni do you play Pokemon Planet? I once saw someone selling stuff in the trade chat named Kuroni and I was wondering if it was you. The anime theme of the contest further makes me think it might actually be you.

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

Haven't seen this many upvotes for a contest blog in ages . This contest was great.

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

Although I'm having a history exam on the next day, I can't wait to participate in this round! Hope that I could collaborate with you in future rounds Kuroni, maybe as a tester? Anyway, wish this round will goes perfectly!

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

Kuroni's stand be like

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

A romantic contest ... I like it

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

Finally a contest with Div2 B = 1000 score! No Alan Turing level mathematics I expect!

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

Hope I remain EXPERT after this contest!.

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

Score of Div2. D is scaring me !!

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

How many problems are common between both divisions?

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

hlw guys plz tell me how to make a user my friend???

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

Hopefully I will become pupil after this contest.

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

I wish i would solve atleast 3 to 4 problems in this contest ;-;

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

A contest on Naruto also:)

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

All the best every one.

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

I am Sooooooooooooo Excited ❤

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

Dmitry cdkrot Sayutin likes this post 'cause it's propaganda for two girls to participate in SIS.

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

I hope they make an Attack on Titan round when the last episode airs next year >.>

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

Have a great Rating Change :)

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

sdfoiSF

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

WA on pretest 5

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

Живе Беларусь

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

I got to say the pictures that explain the examples are lovely.

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

what the heck is pretest 5 of div2C

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

How to solve Div 1 A ( Binary Literature ) ?

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

I feel like I have been getting better and then I fail to Div 2C? How to solve D2 C?

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

    DP

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

    Can be solved using DP. At the end of the altered array you have two options either max(1--n) or min(1--n) for optimal ans. So at each step you have two options. Lets make a vector of all speeds in a sorted manner and solve the dp,

    dp(l,r) = min(dp(l+1,r), dp(l, r-1)) + v[r]-v[l]; ans = dp(0, n-1);

    Submission Link

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

    Since it is about the differences we can need to sort a[].

    dp[i][j] is min cost to have runner i to j of the sorted list started in any order.

    dp[i][i]=0;

    for all i+1<=j:

    dp[i][j]=min(dp[i+1][j]+a[j]-a[i], dp[i][j-1]+a[j]-a[i])

    So, we start with any runner, and take as next the next faster or slower one.

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

    At each point you've to either place group of smallest elements of group of largest elements in the end (try to prove yourself).

    So you do a dp[l][r] on the sorted list of distinct elements and at each point decide to place either all a[l]s or all a[r]s in the end of the final list and then do l++ or r-- and continue

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

    Sort the speeds then compute the minimum cost to include racers with speeds si...sj.

    • Initialize dp[i][i] = 0 for all i (cost of including single racer is 0)
    • At each step k, dp[i][i+k] is the minimum cost of including all racers between i and i+k, which can be computed from the previous dp[i][i+(k-1)] and dp[i+1][(i+1)+(k-1)]
    • You can actually use 1D DP because at any given k you're only using the results from k-1 before overwriting them.
  • »
    »
    6 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    I solve it using dp,i sort the distinct value of all input,then we consider the last operation we can make , neither we put the max or min value , then dp[i][j] = min(dp[i+1][j] + count[value[i]] * diff,dp[i][j-1] + count[value[i]] * diff),here is my code: dp solution

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

Can some one please explain how to solve Div2 problem D

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

    Suppose there are two strings $$$a$$$,$$$b$$$ such that number of zeros in $$$a$$$ and $$$b$$$ are greater than $$$50$$$%. Then we can choose string $$$a$$$ and insert number of $$$1$$$'s in string $$$b$$$ in string $$$a$$$ such that $$$b$$$ is substring of whole string.

    Same case when number of $$$1$$$'s in $$$a$$$ and $$$b$$$ are greater than $$$50$$$%.

    When both $$$1$$$ and $$$0$$$ are equal to $$$50$$$% in both $$$a$$$ and $$$b$$$ then also it can be solved with same logic.

    Let say $$$a=11111100,b=11110000$$$ then final string will be $$$111100001100$$$

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

    Since there are 3 strings, we can always pick 2 out of them, such that either both of them have at least n times 0 or both of them have ar least n times 1. Let's call this the mode. It is 0 in the first case and 1 in the second case. Then we can create a string with n times the mode. Now we matched at least n characters from the first string, and at least n characters from the second string. We are left with n characters from the first and n characters from the second string. We can simply add them by traversing both strings to get a string of length at max 3n.

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

    we can prove the at least there two strings which is have at least n characters are same , '0' or '1',for any case ,we assume it is '1',we just can replace n '1' in any string with another string ' s '1',don't change the order of other characters ,we can make it;here is my code: my code

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

How to solve Div2B?

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

Was DIV2 D much easier than DIV2 C ? It was just case analysis right ? If we have two strings with 50% 0 and 50% 1 then we are done . Or else if we have two strings with number of 0 greater than 50% then also we can combine them.

I read it in last moment and found that implementation was bit difficult else it was easier than DIV2 C.

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

can anyone help with div2 D? Couldn't get it working during contest.

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

    Hints: There must have 2 string where no of 0/1 in both two string >=n.

    approach:

    when any of two string no of 0/1 >=n. Then take one string fully , so other string n element already taken, so taken the rest <=n elements of the other string with some tricks which was not common. its always <=3n operation.

    implementation

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

Anyone can tell me why my solution for D/Div2 get WA?

113255849

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

Aw hell, I wasted so much in C. I knew the main idea right away — find unassigned connected components, if they don't form a forest then compress them into vertices and find the weight of MST there, otherwise build the tree and add min(XOR, for each unassigned edge the smallest weight of a non-MST edge that crosses it). I just didn't go for the straightforward implementation that uses $$$N \lt 900$$$ and finds those smallest weights of non-MST edges crossing all MST paths, but tried other things that I thought would be simpler and fast. Got a lot of WAs and wasted like an hour, only to implement that $$$O(N^2)$$$ in the end.

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

    A simpler solution (at least in my mind) with complexity $$$O(m\log m)$$$:

    • If $$$\frac{n(n-1)}{2}-m\ge n$$$, answer is just MST.

    • Else, $$$n=O(\sqrt{m})$$$. Naively process will give $$$O(m\sqrt{m}\operatorname{dsu}(n))$$$, but note that only $$$n$$$ out of these $$$m$$$ edges are useful (run MST with only fixed edges, only used edges are useful). Now the complexity is $$$O(n^2\operatorname{dsu}(n))=O(m\operatorname{dsu}(n))$$$.

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

      Tbh my solution is simple — build MST with $$$N-1$$$ edges, list all paths in the form $$$(root,v,parent(v),depth(v))$$$, sort them by depth = length, make a table $$$W_{u,v}$$$ for minima of weights of non-MST edges crossing paths $$$(u,v)$$$ and do $$$W_{par(v),v} = min(W_{par(v),v}, W_{root,v})$$$ for all paths.

      What I was going for was more like print cost of MST + min(XOR, minimum of non-MST edges), which failed, but it's not obvious to me why it failed because I tried making a simple counterexample and found out it wasn't a counterexample.

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

        The same general approach succeeded for me, although I used a different method for finding the minimum non-MST edge (just find LCA and check how many non-assigned edges are on the path to LCA). So maybe it was just a bug.

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

          I made a multiset of weights strictly smaller than XOR, then removed weights as I was building the MST. Hard to make a mistake there, it's like 5 lines and I avoided obvious pitfalls like empty multiset or removing by value instead of by element.

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

            The exact approach worked for me. So the answer is MST + min(XOR, minimum of non-MST edges). Except for non-MST edges you have to check that there is at least 1 added edge ( e.g. edge not present in the original graph ) , for that I used a similar approach to the one KADR mentioned, I have LCA with binary jumping which keeps the minimum weight edge from a node to its parent in MST.

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

              EDIT: Found my mistake.

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

              Sounds like your "exact approach" needs more effort than anything I tried. If you simplify DFS/DP-ing all paths into one formula and then complexify that simple formula into LCA with binary jumping, you didn't simplify...

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

                I meant the exact idea for solution. anyway...

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

                Regarding the "simplifying", personally I think it is better (easier) to copy paste binary jumping and use it, since you need to modify just a few lines, rather than trying to code something unusual that makes use of the specific constraints of the problem. Also, who says I am trying to simplify, I am trying to solve the problem with less code or alternatively with less effort.

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

                  Well, writing something well-known is the right approach and the one I didn't take until near the end. However, why start with deciding for a formula, then figure out that there's an exception to that formula and you need to use some more standard code-y approach, when you can ignore the formula and do the standard code-y approach from the start...

                  Note that I'm just repeating my first post now.

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

                  Because that s the first thing that came to mind in contest. Also I think you might be comparing oranges and apples here, “the standard code-y approach” part of my solution is mostly copy paste.

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

                  Doesn't really matter if copypaste or quickly written from memory, the difference I'm focusing on is nice solution vs boring solution, specifically that I tried a nice solution and failed so I had to go with a boring one.

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

      Oh so you mean for the unweighted O(N) edges, we just need to iterate on the MST of the given edges? PS : Also I think O(M sqrt(M) * alpha) might pass cause alpha might be quite small for union find.

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

    I did this:

    Apply Prim/Kruskal with the difference that unassigned edges' weights will be assigned "on the go".

    On each iteration, if there is more than one available edge which is unassigned, it gets value 0. If there is exactly one edge which is unassigned, it gets value XOR.

    I got WA for my submission :( but I'm not sure if I have a bug or the idea is wrong.

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

The hardest part of Div2-C is

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

Nice round! Love the animated sample explanations.

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

Me before contest- "Hope I'll become expert today for the first time"
Me after contest- "Nevermind! I'll regain my specialist in next contest" (-_-)

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

Thank you for the contest. Really liked problems B and C even though I messed up and wasted an hour on C. Towa Maji Tenshi!

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

The most upset moment is that I always get TLE for problem C in div2 even I can do this. Time limit exceeded in Pretest 13 (for pypy3)

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

Can anyone tell what bug is there in this code ? div2D/div1A (Binary Literature)

Code Link

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

Is it just me or B's are getting harder these days? its heartbreaking after a year of hard work T_T

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

Why problem C use dp ? I think it should be greedy。

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

Why is the following algo wrong:? Given $$$s1$$$ and $$$s2$$$, if they have $$$x$$$ positions having different characters => number of same characters $$$2*n - x$$$

from i = 0 to 2*n:
    if s1[i] == s2[i]:
        print(s1[i])
    else
        print("01")

if $$$x \lt = n$$$, the string printed above has $$$length \lt = 3*n$$$. It can be proved. Getting WA on pretest 5 :(

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

Did anyone else solve B by figuring the minimum and maximum possible positions of each character 'M'? I thought that was really interesting! Also, the problems were fun, although I felt that the gap b/w C and D was a bit too much. Nevertheless, kudos to the authors!

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

is true in div2C? each number is all either the maximum of the remaining or the minimum

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

How to solve B ? I took lot of time coming up with right solution. I want to know if there is some better method.

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

Guys how to get started with DP ? Can we learn it before graphs,trees,and other such topics . Please help

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

How to do problem C?

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

    First sort the s_i in increasing order. Let us find dp[l][r] = the answer for the array s[l...r]. Clearly, dp[i][i] = 0 for all 1 <= i <= n

    Now look at the process backwards, and convince yourself that we must remove either the maximum or the minimum process from s[l...r]. This gives us the recursion,

    dp[l][r] = s[r] - s[l] + min(dp[l+1][r], dp[l][r-1]).

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

I have fucking brain damage

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

awesome contest guys thx

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

problems were nice! Good round.

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

https://codeforces.me/contest/1509/submission/113246060 What's wrong with my approach ? Div 2 problem B

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

Best round I've seen in a long period!

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

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

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

MikeMirzayanov it's a bit annoying that during the round to check how many pretests are there we have to use m1.codeforces.com. Could you please do something so it's also visible in the main website?

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

Can we have a notification when editorials are out and your participated in that round? As it is quite tiring to check for editorials again and again.

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

How to solve problem E? (I have a $$$\mathcal{O}(n \log^2 n)$$$ solution with HLD and treaps, but it TLEs :( )

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

    So the first observation to be made is that is there's an answer, then you can obtain the order of the children immediately by sorting each node's children by its value.

    After this, I suppose you went the simulating way, but there's another observation that makes it much more easier: you can visualize the operations as pushing the label $$$u$$$ towards a leaf, and that leaf happens to be the node where $$$u$$$ is its post-order! (in other words, at the end where there are no operations to be made, the labels form the post-order of the tree). So you can additionally create the post-order of the tree, and from that you can do side-by-side checking.

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

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

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

how did you guess that C is dp? i tried everything except dp

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

    This may sound like cheating, but notice the constraints allows O(N^2) so you should think of DP. If a problem at this level(for example first half in div2) is greedy then it is likely that the complexity should be linear or NlgN. The fact that it allows O(N^2) highly suggests that naive greedy would fail on some edge cases.

    Not a good idea though. Try finding why your greedy(I assume you use greedy?) is wrong helps you improve.

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

      The problem was tagged greedy for Div2C, would greedy work? I spent an hour implementing a greedy version, which seems like it would not work :(.

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

        The greedy tag refers to the fact that for dp(i,j), either i or j should be the last one to enter, so you don't need to try j-i+1 possibilities. Sometimes dp requires some observations (like greedy), but greedy can not solve this problem as a whole.

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

          The greedy tag refers to the fact that for dp(i,j), either i or j should be the last one to enter, so you don't need to try j-i+1 possibilities

          Nice Observation, this statement makes a lot of sense.

          For a moment, I was left surprised when we only considered the min/max as the last one to enter, so we are definitely considering the choice of the last position as a greedy choice.

          I will take note of this!

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

Weebs' round. I love it

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

Can any of you help me understand the verdict for DIV2.D?

Submission: 113250060

Verdict(pretest 3): "wrong output format Unexpected end of file — token expected (test case 1)"

Has it got something to do with array capacity/length? What am I missing here?

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

Please give small clue for Div2E or Div1B, through simulation I figured that total possible almost sorted permutations for $$$n$$$ length array was $$$2^{n-1}$$$, and there was some kind of pattern being followed but could not uncover it...

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

So the Anime theme round ends with SUPERSONIC score distribution , rating changes and editorial. Thank you so much XD

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

To not keep you waiting, the ratings updated preliminarily. We will remove cheaters and update the ratings again soon!

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

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

Can Someone give me test case for which my submission for problem D gives WA.
LINK to submission

You can also point out mistake in my code.

It will be very helpful.

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

Hello, I am a new user of codeforces and I joined your contest today. I solved problem A and B and got 70 points in total. Did i do something wrong or is there something wrong with codeforces?

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

Why is this code wrong(Problem Div.2-D)? https://codeforces.me/contest/1509/submission/113266390

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

Emmm, I have a very mysterious problem about problem B of div.2!

I surprisingly found that when I iterated string "s" by using "for(auto &i : s)",I got a WA on test 162nd.

After a very long time's debugging, I attempted to replace "break" with "goto",and then got an AC. Could anyone explain the reason behind this?!

Much obliged!

My submission:

using "goto" : 113285205

using "break" : 113284849

Sorry for my poor English..

If there are any grammar mistakes,plz ignore it...

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

Had -114 in the contest can anybody feel my pain?

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

Can anyone tell me why this solution of DIV2/C is giving TLE with Memoization? https://codeforces.me/contest/1509/submission/113300784 I really can't figure out the silly mistake.

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

Kaguya-sama theme contest when?

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

Can anyone give me a test case or tell me what's wrong with my solution in div.2 D

My approach was to try every possible 2 strings and greedily make a resulting string such that it contains both strings and check if its size is less than 3*n.

link to submission getting wrong answer on test 843 of test-set#6

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

Hello, I'm new here and confused why did my rating just go up from this contest from ~800 to 935? My profile says I'm rank 4003 on the rating graph but I'm really not...