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

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

Hello, Codeforces!

We are pleased to announce the resumption of the Global Rounds. Thanks to XTX Markets for supporting the initiative! In 2024, we will hold 4 such rounds. The series results will take into account the best 3 participations out of 4.

On Dec/19/2024 17:35 (Moscow time) we will host Codeforces Global Round 28.

Codeforces Global Round 28 marks the fourth round in the 2024 series of Codeforces Global Rounds. These rounds are open and rated for everyone.

The prizes for this round are as follows:

  • The top 30 participants will receive a t-shirt.
  • 20 t-shirts will be randomly distributed among participants ranked between 31 and 500, inclusive.

The prizes for the 4-round series in 2024:

  • In each round, the top-100 participants get points according to the table.
  • A participant's final score will be the sum of the points they earned in their 3 highest-placing rounds.
  • The top 20 participants across the series will receive sweatshirts and placement certificates.

We extend our gratitude to XTX Markets for supporting the global rounds initiative in 2024!

The 9 problems were authored by our 4 authors: JoesSR, cmk666, NetSpeed1 and Little09.

We would also like to thank:

Round Information:

  • Duration: 180 minutes.
  • Number of problems: 9 problems with 1 subtask.
  • Score distribution: $$$ 250 - 500 - 1000 - 1250 - 1750 - 2000 - 2250 - 2750 - (3000 + 3000) $$$.

We eagerly anticipate your participation!

UPD:

Congrats to the winners!

  1. jiangly
  2. turmax
  3. dorijanlendvaj
  4. ksun48
  5. hos.lyric
  6. Nachia
  7. strapple
  8. Ormlis
  9. maroonrk
  10. dXqwq

First Solves:

A: dXqwq
B: dXqwq
C: Marcin_smu
D: jiangly
E: sevlll777
F: dXqwq
G: BlackLily
H: jiangly
I1: jiangly
I2: nobody solved

UPD2: Editorial.

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

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

As a tester, I enjoyed the problems a lot!

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

Super excited for Global Round 28! Big thanks to the authors, testers, and XTX Markets for bringing us these amazing rounds. Let’s have fun solving the problems—good luck to everyone competing

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

expecting increase

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

As an author, I hope you have fun & enjoy the problems!

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

As a tester, I tested.

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

(3000+3000). it seems a quite hard problem

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

Little unlucky it is during Saint Nicholas

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

As a discussant, I am glad with friends' problems.

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

December 19 is my birthday.

But will do a contest that day.

Edit: Thanks to everyone!

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

As one of the authors, I hope you enjoy our problems!

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

As a tester, I won't get negative delta :)

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

As a tester, I wish everyone good luck! :)

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

As a tester, I want to gain Contribution.

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

As a tester, I can confirm that this round does indeed have problems.

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

As one of the authors, I hope you enjoy our problems!

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

As a, I can

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

practice a lot for this round , hoping for increase

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

I’m close to reaching Pupil and only need six more rating points. Should I participate in this contest or focus on practicing more before competing again? Experienced people, give me suggestions. Do you think I have a good chance of reaching Pupil if I participate in this contest?

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

All the best everyone.

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

As a newbie, I would like some suggestions please. My first contest was Codeforces Round 993 (Div. 4) and I got the first 3 questions right only. Do you think I should try on this one too. Will it be too hard? Thanks! >(>-<)<❤️.

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

As a tester, I tested the round in order not to lose rating on my birthday, but I'm afraid I was wrong.

If you would like to send me a birthday gift...
»
17 месяцев назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

As a teter, I confirm this round has been tested

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

As a participant I've a

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

Why does mhq coordinate

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

Hoping I could get into expert :D

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

As a participant, I am upset that cry is not a writer.

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

Newbie question ,is this contest rated

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

297192033 I am not able to get the testcase which is wrong. How should I be able to get the 93rd testcase?

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

Any tips how to maintain focus during the 3 hours of the contest?

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

Contest ID: 2048

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

So ...

Notorious Coincidence : Problem B was a task coauthored with chromate00 , but unluckily it appeared in today's round (It was good to be top $$$90$$$) for $$$10$$$ minutes of the round.

My Editorial for the problem :

$$$\textbf{Hint 1}$$$ : The problem can be rephrased to :

$$$\displaystyle \min(\sum_{i=1}^n \min(p_i,p_{i+1},..,p_{i+k-1}))$$$

$$$\textbf{Hint 2}$$$ : Assume you want to evaluate the sum (without construction) thus the sum is :

$$$\underbrace{\underbrace{1+..+1}_{k \text{ times}}+\underbrace{2+..+2}_{k \text{ times}}+...}_{\text{until count =}n}$$$

Take a look at some examples , Let's take $$$(3,2),(5,3)$$$ , For first case we've

$$$[a_1,a_2,a_3] \rightarrow \begin{cases} (a_1,\color{blue}a_2\color{black}) \\ (\color{blue}a_2\color{black},a_3) \\ (a_3,a_1) \\ \end{cases}$$$
$$$[a_1,a_2,a_3,a_4,a_5] \rightarrow \begin{cases} (a_1,a_2,\color{blue}a_3\color{black}) \\ (a_2,\color{blue}a_3\color{black},a_4) \\ (\color{blue}a_3\color{black},a_4,a_5) \\ (a_4,a_5,a_1) \\ (a_5,a_1,a_2) \\ \end{cases}$$$

It's optimal to maximize contribution about sub-permutations of minimum elements

thus It's optimal to place first

$$$\displaystyle \left \lfloor \frac{n}{k} \right \rfloor$$$

with minimum numbers in each index that is multiple of $k$ , and the rest indices can be filled in anyway (For example : fill missing elements in reverse order from larges to smallest).

Complexity is $$$\displaystyle \mathcal{O}(n+\frac{n}{k})=\mathcal{O}(n)$$$

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

What's going on, why E fails on pretest 2, who had this issue?

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

Today I learned that stack size on CF is not unlimited.

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

ok so how do i solve F cuz i tunnel visioned so hard on it i spent 2 ENTIRE HOURS with PRACTIALLY 0 PROGRESS done

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

    Consider DP(L,R, t) = max ai in [L,R] after t operations within in. Notice that if I do operation on smallest bi, might as well do whole [L,R], so in essence you can break the DP into smaller ranges split up by the indices of bi, then compute for each smaller ranges and combine the DPs. Then compute DP for the big range. Notice t is at most 60. So time complexity is like n 60^2. (We have n ranges to do dp on) Also, to const opt if bi > 2, make t like 40 or smth.

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

how to solve E!

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

Does anyone solve D with square root decomposition? (Finding the sum of every kth element starting from position s)

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

How to solve D?

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

E is cancer.

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

In E, For n=3 and m=7, in the example, it says no pattern is possible.

Can someone please suggest why this is an invalid solution?

1 2 3 1 3 2 1
1 2 3 2 1 3 2
2 3 1 3 2 1 1
2 3 1 1 3 2 3
3 1 2 2 1 3 2
3 1 2 3 2 1 3

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

Problem E was very similar to AGC061B. I used the same pattern as a last hope and got AC. My disappointment is immeasurable, and my day is ruined.

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

Really cool round, thanks! I had fun on all of Problems C-I. The statements are so natural and the solution is thinking-oriented. Also now that I got I1 right, it surprised me that I2 is doable...!

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

What's the reason for high constraints in F? Is there a solution better than $$$O(Nlog^2C)$$$ or $$$O(NlogCloglogC)$$$, or were there unintended solutions that passed with lower constraints?

P.S. The problems were good!

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

This round makes me wishing to stop playing Identity V

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

I HATE problem E, i'm pretty sure most of the AC just guessed it.

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

    i guessed that m>=2*n is sufficient for the check, but it kinda does make sense

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

      The proof of this is that the subgraph with edges of one color must form a forest. Thus each color must have at most $$$2n + m - 1$$$ edges of that color. So in total the number of edges should be at most $$$(2n + m - 1) \cdot n$$$. But there are $$$2mn$$$ edges. Thus

      $$$2mn \leq (2n + m - 1) \cdot n \implies mn \leq 2n^2 - n \implies m \leq 2n - 1.$$$
    • »
      »
      »
      17 месяцев назад, скрыть # ^ |
       
      Проголосовать: нравится 0 Проголосовать: не нравится

      You can also think about it this way (which is basically the same proof). If $$$m = n$$$, then you have $$$4n^2$$$ edges and at least one color should use $$$4n$$$ edges. But a forest on $$$4n$$$ vertices can have at most $$$4n - 1$$$ edges, so there's definitely will be a cycle.

      Also if $$$m$$$ is strictly greater than $$$n$$$, you can always consider any part of this graph with $$$2n$$$ vertices on the left, and exactly $$$2n$$$ vertices on the right, since this subgraph will contain a cycle for the same reason.

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

Didn't solved F in contest, because 200000*61*8 bytes (=93.08MB) make stack overflowed... First time get so much negative delta because of stack overflow (error code 3221225725)

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

what could be the possible rating of problem D ?

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

My general idea of F:

Assume we choose intervals [l, r] such that the minimum value in the range b[l..r], denoted as mn. We need to ensure that the selected intervals are local maxima. In other words, for an interval [l, r]:

  • (l == 1 || b[l-1] < mn) .
  • (r == n || b[r+1] < mn).

This leads to intervals forming a tree structure, where each node represents a valid interval [l, r] with the minimum value within it.

Consider the array b[] = [3, 2, 3, 4, 2, 3]. The tree structure of valid intervals and their corresponding minimum values is:

[1, 6] (min = 2)
 
├── [1, 1] (min = 3) ├── [3, 4] (min = 3) ├── [6, 6] (min = 3) 
                     └── [4, 4] (min = 4)

We can perform a greedy strategy on this tree, selecting the optimal ranges at each step:

  1. The root interval [1, 6] has a minimum value of 2. We choose this range until a[2] = a[5] = 1 (2 and 5 only appear in root node).
  2. Then, choose [1, 1] until a[1] = 1, [3, 4] until a[3] = 1, and [6, 6] until a[6] = 1.
  3. Finally, choose [4, 4] until a[4] = 1.

But I'm not sure whether the order of operations (specifically the sequence of selecting intervals) will change the result. Is my idea roughly correct?

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

    We can solve this problem by dp. Let dp(u, t) be the minimum value of (maximum value of a[i] on the subtree of u) if you do t operations on the subtree of u. Note that 2^60>=10^18 so t<=60. So when need to merge dp status from lc and rc: we have merged(i) = min (0<=j<=i) (max(dp(lc, j), dp(rc, i-j)). Note that the optimal j is non-decreasing when i increases, so we can merge them in O(log(A)). Then we need to used the merged value to calculate dp(u): We have dp(u, t) = min(0<=s<=t) (ceil(max(merged(s), a[u]) / b[u]^(t-s))), which means dp(u, t) = min(max(merged(s), a[u]), ceil(dp(u, t-1)/b[u])).

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

I overcooked so hard in C. Used a reduction to Z-functions. Probably wrong :)

Below is my solution. Counter-examples and hacks appreciated.

https://mirror.codeforces.com/contest/2048/submission/297300355

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

Funny, problem C seems a bit reminiscing towards 1743D - Problem with Random Tests (not really the same, XOR instead of OR there and only applying to the $$$n \le 1000$$$ subset). I guess just solving that one earlier today gave me a slight edge XD

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

I changed E to Fill in a matrix with 2n rows and m columns so that the xor of the four corners of any submatrix are not equal to 0. But why this construction is not corret?

1 2 1 2

2 1 2 1

1 1 2 2

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

wasn't C solvable in O(n), why were the constraints n <= 5000??

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

A problem identical to C appeared in the Korean Informatics Olympiad. It can be solved in O(n) time complexity. https://www.acmicpc.net/problem/32073

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

Can someone please tell me if my logic for Problem C is incorrect? The first substring will be the complete string, since it is mentioned that the string will always start with 1. The XOR can be maximized if the more significant zeros are flipped. So I find out the position of the most significant 0 (suppose it is at index k), then I XOR all possible substrings of length (s.len() — k) and see where I get the maximum value? I would have understood if I was getting TLE, but I am getting an incorrect answer error. My submission

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

Only after ~73 top 500 performances do you have the same chance of not winning a t-shirt as you have the chance of winning a t-shirt with one top 500 performance 😓

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

nice problems!

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

Codeforces Hot News!

Wow! Coder chenlinxuan0226 competed in Codeforces Global Round 28 and gained -55 rating points taking place 1293

Share it!

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

Problem C can be solved in O(n) time 298450724

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

My congratulations to the t-shirt winners:

List place Contest Rank Name
1 2048 1 jiangly
2 2048 2 turmax
3 2048 3 dorijanlendvaj
4 2048 4 ksun48
5 2048 5 hos.lyric
6 2048 6 Nachia
7 2048 7 strapple
8 2048 8 Ormlis
9 2048 9 maroonrk
10 2048 10 dXqwq
11 2048 11 _lbw_
12 2048 12 StarSilk
13 2048 13 xuanxuan001
14 2048 14 arvindf232
15 2048 15 Endagorion
16 2048 16 le0n
17 2048 17 GroupMatrix
18 2048 18 grass8sheep
19 2048 19 HIR180
20 2048 20 Radewoosh
21 2048 21 Kevin114514
22 2048 22 ORzyzRO
23 2048 23 Fido_Puppy
24 2048 24 noimi
25 2048 25 maspy
26 2048 26 chinerist
27 2048 27 Thienu
28 2048 28 Flamire
29 2048 29 Karuna
30 2048 30 fengqiyuka
62 2048 62 Forested
94 2048 94 dog_of_Nesraychan
100 2048 100 chaeyihwan
138 2048 138 huangallen
152 2048 152 Midnights
233 2048 233 Saquariu
253 2048 253 tem_shett
259 2048 259 PaHbLLle_91_6blJl_6blcTp
288 2048 288 wanggiaoxing
290 2048 290 Celebrate
292 2048 292 TheSahib
313 2048 313 dmraykhan
317 2048 317 thocon6969
341 2048 340 sadness
371 2048 371 -is-this-fft-
382 2048 382 HpSuda
394 2048 394 ProjectCF
409 2048 409 codicon
411 2048 411 Friedrich
472 2048 471 sunkuangzheng