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

Автор kingmessi, 5 месяцев назад, По-английски

Good day Codeforces ✨

We are excited to invite you all to Codeforces Round 1067 (Div. 2), starting at Nov/29/2025 17:35 (Moscow time).

This round features 6 problems to be scored in 2 hours, with a few problems including multiple parts. All tasks were authored and prepared by koderkushy and me. This round will be rated for all participants with rating below 2100. Take a look at all the problems, we hope you enjoy the challenge! 🚀

We extend many thanks to our team for helping make this round possible:

Score Distribution: $$$500-1250-1500-2000-2750-(2500+1000)$$$ 🏆

UPD: Congrats to the winners!

Kudos to antontrygubO_o for almost getting to the intended solution of F2 in contest!

UPD 2: The editorial is out.

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

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

Ein Zwei Drei

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

:gif (failed loading) T-T , excited to solve again !

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

As a commenter, I commented very fast!

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

    As a watcher , I always watch you comment fast (~ ̄▽ ̄)~

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

    As a singer, I released a new song very fast.

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

Messi Gif is amazing, buddy.

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

I was one of the testers for this contest, so I’ll leave my mark here.

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

Messi is peek

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

I'm a Ronaldo fan, may I participate in this contest

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

messi, my beloved

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

I was one of the tester who did not test ^_^

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

I need to careful about penalty Otherwise Messi can goal.

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

In my opinion, Ronaldo is better.

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

is this a sixseven contest or a messi contest

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

![ ](wallpaper-cr7-cristianoronaldo-foryoupage)

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

As a tester I hope you enjoy the problemset.

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

As a tester, I enjoyed testing the problems.

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

Ronaldo fans accepted?

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

_helloLad orz ^_^

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

Suiiiiii

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

If we avoid penalty, we can goal.

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

It would be amazing if all the problems were related to football or Messi.

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

What does the score distribution mean? I'm new here and don't know much of the thing. How will these score impact in the contest rating? Would anyone mind explaining please?

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

hope I don't get negative delta like every div 2 i pass xD , Btw cool to post that gif of messi it really motivated me to pass the round !

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

As a tester, I’m just as clueless about the final problemset as the participants ^_^

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

A-500 , B-1250 , speedforces

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

Hope to solve at least 3 problems, thus increase my rating.

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

can you please also mention, if for some questions we have pretest = full test

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

Looking at the score distribution, I smell a hard B.

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

As a participant, Lionel Messi encourages me to solve at least three problems.

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

As a contestant I registered FIRST :D

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

As a tester, I'm commenting late as I'M A FUCKING CORPORATE SLAVE ;_;

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

As a Ronaldo fan I will participate in this contest. I hate pretests!!

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

Oh no, Indian round. Get ready for Math and DP.

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

Ronaldo is the goat today this round will be El Clasico.

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

Little unfair to keep a messi contest on a night when barca plays init ?

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

messssssssiiiiiiiiiiiii yooooooooooo

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

As an Argentine fan, I will always miss Messi. And also Ronaldo .

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

codeforces round $$$1067$$$ $$$6 7$$$

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

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

Will the first one be named goat?

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

__baozii__ strikes back!!

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

Lmao

Eibar man pessi stan

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

I practically never solved a dp problem on my own before but today I passed C. Im happy :)

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

I would love to read the editorial for F1 , it was painful :]

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

Idk bout others,but b was significantly harder than c, I solved c in 20 mins of seeing the question while b took forever. Whole time i was trying to split even Freq numbers manually in such a way that they get split into two odd parts.

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

    Yeah What was your approach after that? I realised that if there are no odd occurences than we can only split the even occurences among two if the number of even occurences have the same parity as n. If not than there would be a even occurence we can't split and so my code became like this:

    if you found an odd occurence add 1 to ans if you found an even occurence add 2 to ans

    if there are no odd occurence than check whether parity of number of even occurences is same as n. If it is than subtract 2 from ans.

    Finally output ans.

    This was my solution for b but I could not solve C can you tell me how you solved it? I was able to deduce that if k is even than we simply calculate the maximum subarray sum using kadane's but when k is odd than we can change 1 element of a[i] to a[i] + b[i]. But how do you go about doing this optimally in o(n) or in o(nlogn). I was stuck here...

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

      Assume two variables, storing max subarray sum ending at the current pointer, one of without selecting some b element, and of with some b element selected and apply something very similar to the standard algorithm for max subarray sum.

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

Am I wrong, but I think D can be solved in O(n)?

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

    convert both strings into the zero string, reverse the order of instructions to get the 2nd string.

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

    Of course it can be solved in O(n). But $$$n\leq 100$$$ makes it easier to implement.

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

      or maybe because of the checker? is there any way to check if the output correct or not faster than O(n^2) ?

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

        This makes more sense

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

        It can be done with hashing + lazy segment trees. On a node of one segment tree responsible for [l,r] we keep a polynom hash of s[l...r], on the second segment tree we keep a polynom hash of reverse of s[l...r]. When inverting hash changes from s[l]+s[l+1]*p+s[l+2]*p^2+... to 1+p+p^2+... -(s[l]+s[l+1]*p+s[l+2]*p^2+...).

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

          you are my hero,

          but how you are going to handle the update

          imagine you inverted the range (l,r) , and now you have a range to check (l2,r2)

          where l2 <= l <= r2 <= r, how you are going to check, the update function in segment tree needed to be Polynomial queries.

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

            We maintain a boolean flag whether an inversion operation should be done on a node or not. Since doing two inversions is the same as not doing any operation at all, while propagating we do child_flag = child_flag XOR node_flag.

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

    I also solved D in O(n). You can always use 3 bits to flip the first one in at most 2 operations. This way you can adjust all bits, but the last 2. For the last two I did a BFS over the last 4 bits of the string. n being bigger or equal than 4 seemed to hint that this was the wanted approach. (I have no proof though, that the last 4 bits are enough or that it does not use too many operations for the last 2 bits)

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

      could you elaborate on the bfs part on the last 4 bits, i could figure out the next 2 bit logic during round, but couldnt figure out what to do with the last two bits

      • »
        »
        »
        »
        5 месяцев назад, скрыть # ^ |
        Rev. 4  
        Проголосовать: нравится +1 Проголосовать: не нравится

        Sure, you can look at my submission here:

        351233260

        This Part:

        You must imagine this BFS a bit more abstractly. Every node is 4 bits. So $$$0000$$$ is a node, and $$$0101$$$ is also a node. And we connect two nodes with an edge, if there is an operation that transforms the string into the other. So $$$0101$$$ and $$$0010$$$ would have a common edge, because we can flip the last 3 bits by the rules. $$$0000$$$ and $$$0100$$$ have no common edge, because we cannot apply this palindrome rule directly.

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

    Yup, there's a few solutions. My solution first brute-forces the $$$n = 4$$$ case. After that, I go from left to right in both strings (to the point $$$i = n-4$$$) and if they differ, fix the difference by doing small local changes — either a length $$$2$$$ change if $$$s_i = s_{i+1}$$$, a length $$$3$$$ change if $$$s_i = s_{i+2} \neq s_{i+1}$$$ or a length $$$2$$$ change on $$$(i+1, i+2)$$$ followed by a length $$$3$$$ on $$$(i, i+1, i+2)$$$ if $$$s_i \neq s_{i+1} = s_{i+2}$$$. After that, the strings are identical besides the last $$$4$$$ positions, the solution for which I get from my initial brute-force search and shift the indices.

    The reason it works is that I make at most $$$2$$$ operations for each index except the last $$$4$$$, and I verified that my brute-force approach takes at most $$$8$$$ operations on the $$$n = 4$$$ case, so I get a total of at most $$$2(n-4) + 8$$$ operations as desired.

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

Please Someone explain me how to solve B?????

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

    it was ultimately how to divide elements having even frequency ... because however you divide odd frequency it can only contribute +1 to the answer

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

    Numbers having ODD freq. will always contribute at max +1 to the final score, whereas EVEN frequency either contribute +2 or +0 only. Also, we can split any odd number = A + B, where |A-B| = 1, eg. 7 = 4 + 3. Also, these "1" are always even in numbers (as, sum of freq = 2*n, i.e. EVEN) so they can be distributed easily, to either set 'P' or set 'Q'. Now, for even to contribute +2, either even/2 = odd, or leftover evens, i.e. those evens where, even/2 = even number, can contribute +2 only if either even no. of such even numbers are present or either atleast we have 2 or more +1 deviation that we got from odd frequency. else one +2 won't be considered into our answer; Though a bit of casework but this is what i wrote in my code, if anyone have a simpler solution do share :)

  • »
    »
    5 месяцев назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится
    1. You will take all the odds. There is no point of leaving an odd freq. Contribution of odd is 1.
    2. You will leave at most 1 even. This depends of the parity of n and even freq. The parity should either be same or there should at least be 1 odd freq to fill the parity gap. Even contributes 2 (odd+odd = even)

    Final answer: ans = odd + ((n - even) % 2 == 0 || odd > 0 ? even : even - 1) * 2;

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

I dislike problem D very much, uninspired and annoying

Problems C and E are cool though

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

Because of the error of D checker, my wrong code past the PP,then I go to solving the E ,it taked me 1h, when I see the D error ,it only have 3min. I have no time to change it. It was so upset.I vote down...

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

fuckass palindromes

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

shit,I'm terrible.I can only finish the first two questions.

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

Good round but $$$D$$$ is too hard for me :(

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

God damn that was brutal, I need to practice more.

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

Problem D is so bad lol

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

whyyyy the fuck i cant submit 1 second late

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

cooked by B again... I kind of saw C immediately ... for me B >> C

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

Why there are annoying implementations on D nowadays??

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

shit B

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

Any ways for us to sumbit new solutions after the contest has finished?

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

How did so many people get C. It looked like there were lots of cases or am I just stupid:/

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

    If k is even, just output maximum subarray sum Else, You can just get the Kadane prefixes and Kadane suffixes and try all indices, get the max

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

      Damn I had a feeling that the answer won't change for even K but I couldn't prove it and was thinking about edge cases. Maybe if I had not wasted so much time on implementing B i could have got it.

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

      For odd k, I did a dp where dp[i][0] is the maximal subarray ending at i without adding an element from b and dp[i][1] is the maximal subarray ending at i with adding an element from b. Then your answer is just the maximum over all dp[i][1].

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

    if k is even then alice cannot increase the maximum sum since bob can always undo the operations. similarly the sum cannot be decreased. so the problem is just to find maximum non empty subarray sum which is standard kadanes algorithm. for odd k, bob will always undo alices move until the last move which alice will play. now the question reduced to finding the maximum subarray sum such that alice can perform one operation. just a slight variation of kadanes algorithm, which could be done with DP.

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

"Power outage won the battle but not the war." Atleast i solved A and i will accept my negative delta.

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

DSU rollback came to my mind while thinking about problem E, but I wasn't confident enough to think it is actually true because DSU rollback doesn't appear frequently.

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

: — )

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

dear god i really hope the next div has DFS or even DSU

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

Why can’t Problem B be solved using a frequency array?

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

    It is solved using a frequency array. Don't know if there is another way to solve it.

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

      here is my code ~~~~~

      include <bits/stdc++.h>

      using namespace std;

      void solve() { int n; cin >> n;

      vector<int> a(2 * n);
      for(int i = 0; i < 2 * n; i++) {
          cin >> a[i];
      }
      
      vector<int> freq(2 * n + 1, 0);
      
      for(int x : a) freq[x]++;
      
      int even = 0, odd = 0;
      
      for(int i = 1; i <= 2 * n; i++) {
          if(freq[i] == 0) continue;  
      
          if(freq[i] % 2 == 0) even++;
          else odd++;
      }
      
      cout << odd + even * 2 << "\n";

      }

      int main() { ios::sync_with_stdio(false); cin.tie(nullptr);

      int t;
      cin >> t;
      while(t--) solve();
      
      return 0;

      }

      ~~~~~

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

great contest

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

I am cricket lover

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

Terrible perf these past two contests :(

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

Great problems!

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

Great contest!

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

Why it is showing unrated in my profile?

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

from my pov B is harder than C =))

»
5 месяцев назад, скрыть # |
 
Проголосовать: нравится +19 Проголосовать: не нравится
Easy implementation idea for D
»
5 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

To solve C, I would use a segment tree to avoid any overthinking if possible. Same goes for yesterday's E.

https://mirror.codeforces.com/contest/2158/submission/351205345

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

Can someone explain B?

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

When I finally got Candidate Master omg >///<

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

Problem F is very similar to this problem: https://mirror.codeforces.com/contest/1981/problem/D

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

For D, I precalculated $$$ops[16][16]$$$ which gives a sequence of operation for a all 4 length strings represented as masks. Then we can directly reduce the string $$$s$$$ to $$$t$$$ till $$$n - 4$$$ positions and then use these operations for the remaining 4 digits. 351229248

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

Is there a way to hack own solutions after the contest? I think editorial solution for E is wrong, even though it passes tests, as it doesn't do proper DSU rollbacks.

on grid like

100 100 1 100 100
5 5 5 5 5

if we reduce the middle 5 by 1, and then reduce all other 5 by 2, they will still have min neighbor = 1, even though the picture is now

100 100 1 100 100
3 3 4 3 3
  • »
    »
    5 месяцев назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    If someone is interested, I figured out this does not break the solution because:

    1) if we had to decrease 5->3, we shall create a new node anyway, so last one is not used 2) if we don't decrease the value, the 5->4 decrease makes the adjacent components non-final anyway.

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

I figured some people might be interested, it is possible to solve problem D in linear time.

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

Nice round.ABCD are natural and E is absolutely a beautiful problem

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

In Problem F2, I wrote a randomization program and found 100 numbers with pairwise distinct gcd values.

randomization program

The probability of this randomization program succeeding was low, but I was lucky enough to stumble upon one such set of numbers.

After obtaining these 100 numbers, the construction method for this problem is the same as in CF1981D.

The submission

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

Good contest, love from China.

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

I had fun participating :) looking forward to the next one hehe

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

the question C's solution is wrong because for this test case: 2158C - Annoying Game

1
3 3
2 -7 3
1 -10 3

alice will not add -10 but subtract it so with your solution the final array is 2 -7 6 ans: 6 but the answer should be 2 3 3 ans: 8 i think you should update it and if can update the solution of this question @kingmessi

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

Enjoyed the round — though seeing Messi on the cover made me feel like I needed GOAT-level skills just to pass pretests.

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

so this was a div2 contest.. should winner list include div1 people ??

generally there is a list which contains only div2 winners..

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

ankara messi....vamos argentina

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

how to think for problem like d

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

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

Thank you for giving me such a great rating, Now waiting for contest 1069 to finally match my rating

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

I received a warning for 351215259 for the problem 2158B saying my code matches with SupremoCoder/351200134 My code is not the same — I used a map-based approach, while the referenced submission used a frequency vector. I did not share my solution with anyone or collaborate. I can explain my entire thought process and show intermediate versions of my code if needed. This similarity might have been caused by the problem's deterministic logic. Please review my case.

This is a proper misuse of contest rules

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

enjoyed the contest