BledDest's blog

By BledDest, history, 6 weeks ago, In English

2276A - Perfect Sandwiches

Author: fcspartakm

Tutorial
Solution (BledDest)

2276B - Replace and Compress

Author: BledDest

Tutorial
Solution (BledDest)

2276C - Subarrays

Author: fcspartakm

Tutorial
Solution (BledDest)

2276D - Caveman

Author: BledDest

Tutorial
Solution (BledDest)

2276E - Good Substrings

Author: Roms

Tutorial
Solution (Roms)

2276F - Permutation Coloring Game

Author: BledDest

Tutorial
Solution (BledDest)

2276G - Elimination of Players

Author: BledDest

Tutorial
Solution (BledDest)
  • Vote: I like it
  • +35
  • Vote: I do not like it

»
6 weeks ago, hide # |
 
Vote: I like it +59 Vote: I do not like it

Horrendously unbalanced and speedforces round, just not it man...

»
6 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Thanks for your fast editorial!

»
6 weeks ago, hide # |
 
Vote: I like it +49 Vote: I do not like it

contest was so unfun

»
6 weeks ago, hide # |
 
Vote: I like it +13 Vote: I do not like it

My solution discussion stream for ABCDE.

»
6 weeks ago, hide # |
 
Vote: I like it +14 Vote: I do not like it

It's possible to solve F in $$$O(nk)$$$.

»
6 weeks ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

F. Case — all cycles have length k or less without dp

394617147

»
6 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Many people solved Problem D using DFS, even though there is an easy solution

»
6 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

this was worst contest for my entire lifetime, i guarantee

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

    Yeah, you right. It is because problem c i.e. subarray could be solved by using brute force, then I think about sliding window, after I solved it by using prefix sum with frequency. For thinking process, there were many steps for solve this problem but when think that approach so that solved it easily.

»
6 weeks ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

F and D are cool. Thanks authors!

»
6 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

A somewhat dull speedforce round,while B and E are worth pondering

»
6 weeks ago, hide # |
 
Vote: I like it -11 Vote: I do not like it

D is easier than C...

»
6 weeks ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

This was one of the best rounds in a while! Thank you!

»
6 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

can anyone explain how the B solution is working in c++

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

    Let $$$k$$$ be the maximum number of block after compress binary string $$$s$$$,then it can be prove that in one operation you can make $$$k\rightarrow k+2$$$ or $$$k\rightarrow k-2$$$,consider index $$$i$$$,there is two situation,$$$s_i$$$ same as adjacent character or not,

    If $$$s_i$$$ same as adjacent character then if you flip $$$s_i$$$ then the block will increase $$$2$$$

    If $$$s_i$$$ is not same as adjacent character there is two more specific condition,either $$$1$$$ adjacent character is not same or both,if $$$1$$$ adjacent character is not same then flip $$$s_i$$$ will not affect the result,otherwise it will decrease $$$2$$$,check the example below

    Ex:

    $$$1$$$ adjacent character not same

    $$$[0\underline{0}]1\rightarrow 0[\underline{1}1]$$$

    both adjacent character not same

    $$$[0][\underline{1}][0]\rightarrow [0\underline{0}0]$$$

    So you need to check does there exist $$$000$$$ or $$$111$$$ for $$$k+2$$$,and $$$010$$$ or $$$101$$$ for

    Unable to parse markup [type=CF_MATHJAX]

    ,and $$$k$$$ is always can be obtain by doing nothing,thus answer either $$$1$$$,$$$2$$$ or $$$3$$$
  • »
    »
    6 weeks ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Consider compressing the string without changing any character, it will always be sequence of alternate 0 or 1, lets take 10101 for example, now, the comp-string will only change if we are able to remove any, one between 2 zeros (or 101) in the comp-string, to do that, in the original string, that 1 should have zeros on both sides, which is substr = "010", given in editorial. Plus there is one more case where you can increase the size of comp-string, you can think about it in the same manner.

»
6 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

my solution to D if any node has degree 0 answer is 0 if their is any cycle answer is MANY if the graph is a star graph answer is 2 else answer is MANY

»
6 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Hello. I don't understand how the ans is created, what is the point of dd array?

  • »
    »
    6 weeks ago, hide # ^ |
    ← Rev. 2  
    Vote: I like it +3 Vote: I do not like it

    dd array is used to keep track of the arithmethic progression's difference when counting the good substring. for example, if you want to make an addition to range [l, r], that means adding n-l, n-l-1, n-l-2, ... to l, l+1, l+2, ... respectively, each with difference of -1. the sol keeps the difference in dd and tracks the total difference from 0 to i (0 <= i < n) with add when computing answer for each index

»
6 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

In problem F, I feel that if the problem setter wanted an O(poly(k)) solution, they should have set k to 200. Otherwise, we can just DFS Alice's first move combined with an O(n) check and still get accepted, without even having to think about knapsack or any graceful DP.

»
6 weeks ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

Why is it named "Educational Round"? What's educational about it? Setting a problem E that easy or D brute-force cakewalk makes no sense.

»
6 weeks ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

F is really edu because of learning game dp.

»
6 weeks ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

I solved $$$E$$$ by binary search

»
6 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

HI heres and alternate soln to a. ik its a fairly simple one, but maybe u guys can tell me better ways to think. i cudnt quickly make out what wud a-b imply.

395201343

»
5 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

A question about Problem C: Why does the two-pointer technique (which somewhat resembles a sliding window of size k+1) correctly count all the answers?

»
5 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Monocarp, when HL3???

»
5 weeks ago, hide # |
← Rev. 2  
Vote: I like it +6 Vote: I do not like it

Why is G rated 2100? Is it that easy?

»
5 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

G only 2100??? its clist rating reached to 3200......

»
4 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

E is really nice!! Taught me something new.

»
4 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Why is G rated *2100? The more I work on it, the weirder it feels.

»
4 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

We can solve E in O(n), because each query can be processed in offline mode.

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

Why G is *2100 ??? It's quite difficult.