I_love_kirill22's blog

By I_love_kirill22, 2 days ago, translation, In English

Hello to all fans of competitive programming and Codeforces enjoyers! We're happy to invite you to participate in Hello 2025, which will take place on Jan/04/2025 17:35 (Moscow time).

We, I_love_kirill22, dope, and induk_v_tsiane, have prepared 8 problems for you, and you’ll have 2 hours and 30 minutes to solve them. One of the problems is divided into 2 subtasks. The round will be rated for all participants.

Huge thanks to MikeMirzayanov, geranazavr555, and KAN for great systems Polygon and Codeforces!

Special thanks also go to:

Score distribution: 500 — 1000 — 1500 — 2250 — (1000+2000) — 3500 — 3750 — 4500

UPD (Update!) (Update! Yey!) Editorial — link

This round was prepared with the support of T-Generation. If you are a Russian-speaking student, please switch to the Russian version of this blog. There you will find information about our educational projects that may be interesting for you.

UPDATE

Congratulations to the winners:

  1. jiangly

  2. ksun48

  3. ugly2333

  4. Flamire

  5. Ormlis

  6. hos.lyric

  7. ecnerwala

  8. noimi

  9. maspy

  10. arvindf232

Announcement of Hello 2025
  • Vote: I like it
  • +416
  • Vote: I do not like it

»
2 days ago, # |
  Vote: I like it +51 Vote: I do not like it

dope you are such a skibidi sigma rizzler

»
2 days ago, # |
  Vote: I like it +3 Vote: I do not like it

I_love_I_love_kirill22

»
2 days ago, # |
Rev. 3   Vote: I like it +4 Vote: I do not like it

i_love_dope

»
2 days ago, # |
  Vote: I like it +2 Vote: I do not like it

as a participant, I will participate.

»
44 hours ago, # |
  Vote: I like it -9 Vote: I do not like it

LFG!!!

»
43 hours ago, # |
  Vote: I like it +4 Vote: I do not like it

Hello 2025

»
43 hours ago, # |
  Vote: I like it +35 Vote: I do not like it

speedforces?

»
42 hours ago, # |
  Vote: I like it +1 Vote: I do not like it

Simplest E1 ever?

  • »
    »
    42 hours ago, # ^ |
      Vote: I like it +19 Vote: I do not like it

    1000 E1 seems a bit fishy. I think solving in order A->B->C->E1 can still be better than A->B->E1->C.

  • »
    »
    41 hour(s) ago, # ^ |
      Vote: I like it +70 Vote: I do not like it

    wth is your pfp

  • »
    »
    25 hours ago, # ^ |
    Rev. 5   Vote: I like it -15 Vote: I do not like it

    I think score distribution is not about rating actually...

    -- a lgm

    • »
      »
      »
      17 hours ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      you mean a specialist

    • »
      »
      »
      15 hours ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      It's not about rating, but it does tell you the relative difficulty of problems in the contest. In this one, we can see that both B and E1 are worth 1000 points, so they should have about the same difficulty (although E1 will probably be a bit harder, because the easy version of a problem with multiple subtasks usually gives a bit less points than it would if it wasn't a subtask). Usually, E1 is way harder than B, so this is rather atypical.

»
42 hours ago, # |
Rev. 2   Vote: I like it -24 Vote: I do not like it

Hope everyone starts with positive delta this year. All the best FOLKS <3 edit- don't downvote please. Get me some contribution yo.

»
41 hour(s) ago, # |
  Vote: I like it -8 Vote: I do not like it

I WILL RETZRN SPECIALIST

»
41 hour(s) ago, # |
  Vote: I like it 0 Vote: I do not like it

hope to get 1800 :)

»
41 hour(s) ago, # |
  Vote: I like it 0 Vote: I do not like it
  • hey guys from the two days i won't be able to submit the solution on codeforces when I try to submit it shows a wierd page that return home like that stuff can anyone help me out.
»
40 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

I wish everyone could reach their destination by this contest. Best of luck!

»
40 hours ago, # |
  Vote: I like it +38 Vote: I do not like it

E1 only 1000 points???

E1 = B < C ???

I'm surprised.

»
40 hours ago, # |
  Vote: I like it +1 Vote: I do not like it

I also love Kirill ;)

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

I_love_kirill22 is the language of communication and lecture in the camp Russian or English?

  • »
    »
    40 hours ago, # ^ |
      Vote: I like it +12 Vote: I do not like it

    Russian, that's why we wrote information about the camp only in the Russian version of the blog.

    • »
      »
      »
      4 hours ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      А кружок доступен для уже не школьников? Is camp available for no longer school students?

»
40 hours ago, # |
  Vote: I like it +4 Vote: I do not like it

Hope chenlinxuan0226 can say hello to Expert rating after "Hello 2025".

»
39 hours ago, # |
  Vote: I like it +3 Vote: I do not like it

Very much excited to participate in the first contest of this year!!

  • »
    »
    17 hours ago, # ^ |
      Vote: I like it -8 Vote: I do not like it

    I am not excited at all about this first contest or about anything else.

    • »
      »
      »
      15 hours ago, # ^ |
        Vote: I like it +6 Vote: I do not like it

      It turns out to be just a bad mood. Now, I am super excited. I shall never be green again.

»
39 hours ago, # |
  Vote: I like it +6 Vote: I do not like it

dope has a small eggplant

»
37 hours ago, # |
  Vote: I like it +3 Vote: I do not like it

This is the first contest of the year. Happy new year everyone!!

»
36 hours ago, # |
  Vote: I like it +3 Vote: I do not like it

E1 is just 1000 Damn

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

Will there be problems for div4 programmers?

»
35 hours ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

will it be suitable for me (my first time to participate in a contest)?

  • »
    »
    35 hours ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    worth a try, you'll know how contests work

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

    You will never know if you haven't tried. Try participate in some contests.

  • »
    »
    17 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I am not sure but I guess a virtual participation in a div 4 contest is a better choice. Also, you can join Atcoder ABC contest which will start soon today.

»
34 hours ago, # |
  Vote: I like it +9 Vote: I do not like it

let's destroy this contest

  • »
    »
    17 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Awake! u r just a newbie not an LGM :(

    • »
      »
      »
      16 hours ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      i know before you tell me i am stuck at this rating newbie but its not a fault to change my rating to this

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

quick question, what division is it going to be in?

  • »
    »
    31 hour(s) ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    +1

  • »
    »
    22 hours ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    Rated for all participants similar to Div.1+2

  • »
    »
    17 hours ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    It's equally rated for all. We r the same, we should NOT be divided into divisions because there are no individual differences between humans.

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

How many problems will be given? I'm at the beginner level, so are there any beginner-level questions?

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

does this mean that the authors predict that $$$E2$$$ will be easier than $$$D$$$?

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

    maybe

  • »
    »
    17 hours ago, # ^ |
      Vote: I like it +7 Vote: I do not like it

    The difficulty of the hard version of a problem is relative to the sum of their scores, not just the hard version's, so E2 will be harder

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

D will be more difficult to me than Ds in other div1+2s

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

I hope this first contest of 2025 will be fun

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

Hopefully the problems are as good as Good Bye 2024! A little concerned that the writers were decided so late...

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

I hope I could Solve at least two questions ......

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

Is it a good idea to drink coffee before a contest? If yes, how long before contest should I drink it?

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

Why are there so many unmatched nametags(rating <-> color)? What happened with them

»
16 hours ago, # |
  Vote: I like it +7 Vote: I do not like it

hope i get to expert on this round for a lucky year!

»
15 hours ago, # |
  Vote: I like it +3 Vote: I do not like it

hopefully i don't mess this one up!

»
15 hours ago, # |
  Vote: I like it +7 Vote: I do not like it

How can you conceive splitting the E in this economy?

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

new year, new hope. Hoping positive delta

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

_ hello 2025_

»
12 hours ago, # |
  Vote: I like it +8 Vote: I do not like it

What a thrilling and exciting game (forced smile)

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

(answer $$$q$$$ queries)forces

»
12 hours ago, # |
Rev. 2   Vote: I like it +2 Vote: I do not like it

i am gonna start skipping contest that has anything to do with bit manipulation in c or b. It turns to a game of pattern guessing though brute force.

  • »
    »
    10 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    It's not guessing .. if u have done the problem of finding bitwise and/or of a range , the problem won't be much of a pain

»
12 hours ago, # |
  Vote: I like it -25 Vote: I do not like it

i have petition to permanently ban bitset problem from rated contest

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

I'm super confused about the number of points for E1. I thought maybe I should try solving it instead of D, but came up with no solution even after I solved D.

»
12 hours ago, # |
  Vote: I like it +16 Vote: I do not like it

what is the hack for problem B? is it attacking unordered_map solutions?

»
12 hours ago, # |
Rev. 11   Vote: I like it +14 Vote: I do not like it

A: When the MEX value of a set be positive, this set must contain $$$0$$$. WLOG assume $$$n<=m$$$ and $$$a_{1,1}=0$$$, then the answer will be MEX of first row plus MEX of first column. If we let $$$a_{1,j}=j-1$$$, the MEX of first row will be $$$m$$$ and MEX of first column will be $$$1$$$, the answer is $$$m+1$$$. On the other hand, value $$$1$$$ cannot be contained in both first row and first column, so the minimum value of MEX of first row and first column is $$$1$$$, therefore the answer is not greater than $$$\max(n, m)+1 = m+1$$$.

B: Let $$$T$$$ be the number of different values in array $$$a$$$, in each operation we can only reduce $$$T$$$ by at most $$$1$$$ (because all values we remove from $$$a$$$ are equal), and if we choose $$$l=1, r=n$$$ everytime, $$$T$$$ will definitely be reduced by $$$1$$$. So when $$$k=0$$$ the answer is the number of different values in array $$$a$$$. When $$$k>0$$$ we need to reduce $$$T$$$ as more as possible, so we need to find value $$$a_i$$$ with minimum number of occurence annd change their value, until we used up all $$$k$$$ operations.

C: First assume $$$a, b, c \in {0,1}$$$. We can see $$$(a⊕b)+(b⊕c)+(a⊕c)$$$ is 2 when $$$a, b ,c$$$ are not the same, and $$$0$$$ otherwise. To find the answer we look at bits of $$$l, r$$$, start from the most significant: Let $$$j$$$ be the most significant bit where $$$l,r$$$ differ, so for $$$j+1$$$-th bit and higher $$$(a⊕b)+(b⊕c)+(a⊕c)$$$ can only be zero. Let $$$B$$$ be the $$$j+1$$$-th bit and higher part of $$$l$$$ and $$$r$$$, and $$$p=1\lt\lt j$$$, we have $$$l < (B|p) <= r$$$, and because $$$r-l>=2$$$, either $$$B|(p-2)$$$ or $$$B|(p+1)$$$ should be in interval $$$[l, r]$$$. By calculation we can see when $$$a=B|(p-2), b=B|(p-1), c=B|p$$$ or $$$a=B|(p-1), b=B|p, c=B|(p+1)$$$, the value of $$$(a⊕b)+(b⊕c)+(a⊕c)$$$ will be the maximum possible (which is $$$1\lt\lt(j+2)-2$$$).

D: We solve the problem by segment tree: For each node representing range $$$[u, v]$$$ we store these values:

  • $$$max_{-}plus = \mathop{\max}\limits_{u<=i<=v}a_i+i$$$
  • $$$max_{-}minus = \mathop{\max}\limits_{u<=i<=v}a_i-i$$$
  • $$$min_{-}plus = \mathop{\min}\limits_{u<=i<=v}a_i+i$$$
  • $$$min_{-}minus = \mathop{\min}\limits_{u<=i<=v}a_i-i$$$
  • $$$ans$$$ = the answer we need for range $$$[u, v]$$$

When we need to merge 2 ranges $$$L$$$ and $$$R$$$, we first assume we pick max and min value of $$$a_i$$$ both in range $$$L$$$. In this case we don't need to extend the range outside of $$$L$$$, because we cannot get any better answer, so this case answer is $$$L.ans$$$. Similarly when we pick max and min value from $$$R$$$, the best answer is $$$R.ans$$$. If we pick max value from $$$L$$$ and min value from $$$R$$$, we need to find $$$\mathop{\max}\limits_{i \in L, j \in R}a_i-a_j-(j-i)$$$, which is equivalent to $$$\mathop{\max}\limits_{i \in L}(a_i+i) - \mathop{\min}\limits_{j \in R}(a_j+j)$$$, so the best answer for this case is $$$L.max_{-}plus - R.min_{-}plus$$$. Similarly, for the last case, the best answer is $$$-L.min_{-}minus + R.max_{-}minus$$$.

E2: For a certain query $$$(a, b, k)$$$, let's find how to check whether $$$w_k >= t$$$ for certain $$$t$$$. Let's assume all edges in the graph with $$$w>=t$$$ has cost $$$1$$$, and other has cost $$$0$$$. If we can go along any path, move from node $$$a$$$ to $$$b$$$ with cost $$$\lt k$$$, then $$$w_k$$$ will be less than $$$t$$$ in this path. Otherwise, for every paths from $$$a$$$ to $$$b$$$ we need to pass at least $$$t$$$ edges with $$$w>=t$$$, so we have $$$w_k>=t$$$ for every paths. Therefore to solve this problem, we can sort all edges by $$$w$$$ from lowest to highest, change their cost from $$$1$$$ to $$$0$$$ one by one, and for any query $$$(a, b, k)$$$, if cost from $$$a$$$ to $$$b$$$ dropped down to $$$k-1$$$ or less, we know the answer for this query is $$$w$$$. So the rest we need to do is keep updating value of $$$cost(a, b)$$$ when cost of edges changed. The initial cost can calculated by Floyd's algorithm in $$$O(n^3)$$$, and $$$cost(a,b)$$$ can decrease at most $$$n-1$$$ times, because if nodes $$$a, b$$$ is connected with edges of weight $$$0$$$, adding an edge with cost $$$0$$$ on $$$(a, b)$$$ will not cause any change of cost on this graph. Each time such decreasement occurs we can recalculate $$$cost(u, v)$$$ for all pairs in $$$O(n^2)$$$. So the problem can be solved in $$$O(n^3+ m\log(m) +q\log(q))$$$.

G: If you've planted sugar cane in Minecraft, the answer is easy to come up with: First, we find all positions $$$(i, j)$$$ where $$$-1<=i<=n$$$, $$$-1<=j<=m$$$ and $$$(i+3j) mod 5 = 0$$$, and try to add these positions into $$$S$$$: If position $$$(i,j) \in A$$$, we add it into $$$S$$$ directly, any otherwise for each adjacent position $$$(i', j')$$$, we add it into $$$S$$$ if $$$(i', j') \in A$$$. Therefore we've built a set $$$S$$$ satisfies the second condition. To match the first condition, we repeat this process for $$$r \in [0,4]$$$ and $$$(i+3j) mod 5 = r$$$, and pick the set with minimum size, this set will satisfy the size condition. (Prove by AC)

»
12 hours ago, # |
  Vote: I like it +43 Vote: I do not like it

i hate problems like C

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

A: I don't know why this works

B: I don't know why this doesn't work (later edit: forgot to pop from priority_queue :(, somehow first pretest passes with this bug X( )

»
12 hours ago, # |
  Vote: I like it +8 Vote: I do not like it

RIP one and a half hour for D LOL. Come back CM anyways.

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

How to solve C ?

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

Hi

»
12 hours ago, # |
  Vote: I like it -15 Vote: I do not like it

Very heavily math based contest this time...

I joined an hour late (oops), solved A, B and C. I particularly enjoyed C, but that's just me due to my heavy math background.

This contest might be a bit unpopular with the crowd though... knowing how Goodbye 2023 went...

»
12 hours ago, # |
Rev. 3   Vote: I like it +53 Vote: I do not like it

B: I am sure we were presented a totally different problem... I cannot understand why this happens with this many testers (and why so many contestants "solved" it without trouble), please write a correct statement. The Codeforces rule is also bad and this issue affects too much to the performance.

G (and in general): Why ML 256MB?

H: Chip-firing is well-known. Anyway I needed some observation, so perhaps it is okay.

  • »
    »
    11 hours ago, # ^ |
      Vote: I like it +10 Vote: I do not like it

    B. Sorry :(

    G. There is no special reason. 256MiB is just a default Memory Limit in Polygon

    H. Wow! I honestly didn't know about that. But still, for me, the solution to Problem H looks like an ordinary adhok, and as if no deep theory helps much.

    • »
      »
      »
      11 hours ago, # ^ |
        Vote: I like it +34 Vote: I do not like it

      I'd say default ML in Polygon is bad... (Please take this as a message to coordinators and future authors! The problem G itself was nice!)

      H: Actually I'm not sure if deep theory helps, I just meant this is a known topic so there are similar problems about chip-firing on path, like GCJ 2020 Round 3 C or <Cf problem which I don't remember well>, so I guess some people knew the high-level idea.

»
12 hours ago, # |
  Vote: I like it +21 Vote: I do not like it

G is much easier than C. Even 5-year-olds have solved it while building sugar cane farms in minecraft.

  • »
    »
    11 hours ago, # ^ |
      Vote: I like it +37 Vote: I do not like it

    Bro, you not only solved the problem, but also understood how it appeared! Bravo :)

  • »
    »
    11 hours ago, # ^ |
      Vote: I like it +13 Vote: I do not like it

    Also when you are using Sprinkler in Stardew Valley.

  • »
    »
    10 hours ago, # ^ |
      Vote: I like it +32 Vote: I do not like it

    On the other hand, I found G to be the hardest problem of the round. T.T

  • »
    »
    10 hours ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    For me, the only nontrivial part was trying to pass the memory limit.

»
12 hours ago, # |
  Vote: I like it +13 Vote: I do not like it

i thought C's solution was really cool, im surprised people hate it so much

  • »
    »
    11 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Can you please explain my thought was at every ith bit 2 nos should have the same bit and third one should have the different bit. So this I was thinking of geting l , l+1 , l+2 r r-1 and r-2 and all possible final values and get hte max out of it.

    • »
      »
      »
      11 hours ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      since we want at most 2 out of 3 people sharing an ith bit, we can guarantee this by having person A be 2^n, and person B be (person A — 1)

      for example person A = 16, then person B = 15

      16: 10000

      15: 01111

      this leaves person C to take anything as long as it fits the constraints because no ith bit can ever exceed appearing twice. this allows the answer to be 16, 15, 14; and if L == 15 then the answer is 16, 15, 17 instead

      • »
        »
        »
        »
        11 hours ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        u can't always chose a power of 2, depends on the interval

        • »
          »
          »
          »
          »
          11 hours ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          yeah my bad, i should have clarified the largest power of two where the most significant bit differs. so for l=139 and r=141 the msb that mismatches is the third bit (2^2)

          • »
            »
            »
            »
            »
            »
            11 hours ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            i'm not sure if that works, u have to check if u can put to one of them full 0's after some bit, u could get a number smaller than the left limit of the interval.

»
12 hours ago, # |
  Vote: I like it +3 Vote: I do not like it

AB are nice problems.

I don't like bit manipulation constructives so C was kinda hard for me. And also it looks to be above average div2C in terms of complexity.

D is an interesting problem. I would love to have more time to think on D as I even didn't manage to get an idea. Too bad C took all my time.

Ehh well. I guess I need to solve some more bit constructives.

  • »
    »
    11 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    My performance was about 1400-1600 in the old contest but recently I always get negative delta do you have any suggestions about solving div2C

    • »
      »
      »
      11 hours ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      C usually requires good level of observation

      • »
        »
        »
        »
        11 hours ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Sometimes I notice the main observation but I cant implement it.My implementation is bad

    • »
      »
      »
      11 hours ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I struggle with Ds so I just upsolve Ds from past div2 rounds if they're in my skill range, so I check the problem rating at clist dot by. If I have no ideas for an hour or something I study editorial hints, then if I'm still stuck I check the model solution but without implementation. Then if it's not enough I study jiangly submission for that problem, as my organization name suggests. His submissions are very clean and usually there is a lot to learn from them, so I often check them out even if I managed to solve a problem on my own. I offer the same strat for div2C.

      Also, what old contests with 1400-1600 perf are you talking about? I see only one Edu round with perf in that range.

      Moreover, performance usually has some variance so it's normal if you get negative delta sometimes.

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

I failed to implement D with segment tree in time.... I just spent too much time doing it the wrong way.

»
12 hours ago, # |
  Vote: I like it +23 Vote: I do not like it

I got 7 CE in F with C++20 and C++23. Didn't manage to fix it during the contest. WTF is that? :) Works on my computer just fine. After the contest, I decided to switch to C++17 in the custom invocation tab and it compiles normally. Is everything ok with the compiler?

  • »
    »
    11 hours ago, # ^ |
    Rev. 5   Vote: I like it +4 Vote: I do not like it

    This bug presents in gcc $$$[13, 14.2.0]$$$ which just happens to correspond to C++20 and C++23 on codeforces. Your code also yields compile errors on godbolt

    Error message

    It compiles locally because you probably had gcc 12 or gcc 14.2.1. Here are the workarounds that you can use:

    Workaround 1: Remove #pragma target
    Workaround 2: #include <bits/allocator.h> before using #pragma target

    Also sse4.2 is older and not as good as avx2

    • »
      »
      »
      11 hours ago, # ^ |
        Vote: I like it +4 Vote: I do not like it

      Wow... How did this never happened to me before with C++20... Insane. Thanks!

»
11 hours ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

can someone hack my solution for C? I just brute force things for a while and actually correctly guessed it. Sub: 299665561

I don't have any proof, my approach is finding the best fit for l ^ r, the third one is anything (I tried through brute force for this observation).

Let's say bl = bit of l, br = bit of r (At bit i). If bl == br:

  • if bl == 0 means we need to set bit l[i]
  • else (bl == 1) we need to del bit r[i]

The purpose is finding max l ^ r so the goal is 0 ^ 1 == 1 for every bit possible.

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

i hate the c++ vscode debugger and i hate my life

»
11 hours ago, # |
  Vote: I like it -60 Vote: I do not like it

What a contest man, Please never make such type of contest!!

»
11 hours ago, # |
Rev. 3   Vote: I like it -8 Vote: I do not like it

[deleted]

»
11 hours ago, # |
  Vote: I like it -17 Vote: I do not like it

Russians are setting mathforces and the chinese are now creating good rounds. How the tables have turned.

»
11 hours ago, # |
  Vote: I like it +33 Vote: I do not like it

E1 and E2 are free standard problems, but unfortunately, I am intellectually disabled.

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

Happy new year!

»
11 hours ago, # |
  Vote: I like it +16 Vote: I do not like it

I especially love problems C and G in some ways. However, people solving ABCDE1E2 have varying performance score from 2000 to 2800, which, looks very scary. I'd say my overall feedback after participating Hello 2025 is: Goodbye 2025.

»
11 hours ago, # |
  Vote: I like it -8 Vote: I do not like it

Problem D is anti python users , 2 Seconds is not fair

  • »
    »
    11 hours ago, # ^ |
      Vote: I like it +38 Vote: I do not like it

    It is not guaranteed that tasks D and more difficult can be passed in python.

»
11 hours ago, # |
Rev. 2   Vote: I like it +70 Vote: I do not like it

Here is some feedback on the problems:

  • A: Nice problem!
  • B: Bad problem and wrong statement. I agree with hos.lyric that having wrong statements should be more carefully avoided.
  • C: Nice problem! It's rare that I have to think for a problem C. This one required me to stop and think and therefore I liked it!
  • D: The problem is a bit standard. But it is clean and I appreciate it. I had not written a segment tree in years, so the implementation felt harder that it should have.
  • E: After reading the statement, I could immediately solve E1 and I had no idea of how to solve E2. In the end I passed pretests also in E2 with an algorithm that I think should get TLE. I kinda liked thinking about it, but I have one doubt. LOL. Writing this comment I realized how to solve E2 (I guess it's a DSU). I spent more than one hour thinking about it and now, while typing this comment and trying to describe my "doubt" I solved it.
  • F: Skipped
  • G: The statement is amazing. I thought about it for some 15 minutes. No idea of how to solve it. It seems like a great problem.

Overall I enjoyed participating. I would have had a bit more fun if the statements were a bit more carefully written, but that's fine. Thank you to all those involved in the organization.

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

For D, I understood that we have to build a Segment Tree for a + i and a — i, but how to find the answer after every query?

»
11 hours ago, # |
  Vote: I like it -8 Vote: I do not like it

If there are some well-known techniques in C

  • »
    »
    11 hours ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    Unless you consider "going bit by bit" to be a "well-known technique" you don't know (I think that's what you were implying by the italics), then no, there aren't.

»
11 hours ago, # |
  Vote: I like it +12 Vote: I do not like it

The tasks were ok overall. E should not appear on codeforces, and D is on the edge of being fine. On the other hand, C was nice, and G too (exactly the type of task I will not solve).

E1 absolutely should not appear on CF (and I don't know what it was doing in the original round either), E2 is arguably fine but I dont like it either. Fairly standard, almost ABC-like (infact i remember a similiar trick in a ABC contest)

The preparation seemed somewhat rushed, especially with the major error on B.

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

Why does my E1 have TLE? I need an explanation

»
11 hours ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

As a Python user, I know it is my fault but I HATE hacks against hash-based data structures :(

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

Awwww my B got FST because of TLE what the hell??? Is the Counter lib from python collections vulnerable to hacks?

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

It seems that map passes test in B, whereas unordered_map results in TLE — I don't think this should be the case...

  • »
    »
    11 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    i thought unordered_map would run faster so i changed it right before submitting.. very disappointed

  • »
    »
    11 hours ago, # ^ |
      Vote: I like it +27 Vote: I do not like it

    Time complexity of unordered_map is $$$O(n)$$$ only on the average test case, there are some cases where it's as large as $$$O(n^2)$$$. The default hash function for unordered_map isn't very smart, so someone probably managed to find a testcase which runs in $$$O(n^2)$$$ on default unordered_map, hacked someone with it, and got it into system testing.

    • »
      »
      »
      4 hours ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I used dict in Python and also got FST, is that the same?

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

        Yes, Python dict is also hash-based.

  • »
    »
    11 hours ago, # ^ |
      Vote: I like it +16 Vote: I do not like it

    Unordered_map hacks are quite common :(

    Here is a blog post by neal that explains it.

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

it feels so great to be hacked on b)))

hello, 2025

  • »
    »
    10 hours ago, # ^ |
      Vote: I like it +6 Vote: I do not like it

    the hack exist is a thing, I only hope they put some in pretest so the cost of penalty wasn't this devastating...

    This is again much of a pain to bear in the start of 2025.

  • »
    »
    10 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    This not authors hacks.

»
11 hours ago, # |
  Vote: I like it +24 Vote: I do not like it

Thanks for the contest! I like pC very much.

But about problem E, I think it's quite bad to define path to allow going through same vertex multiple times, since it contradict the conventional definition of path, and it's better to call it a "walk" instead of "path".

  • »
    »
    10 hours ago, # ^ |
      Vote: I like it +18 Vote: I do not like it

    I think the problem is the same either way since no optimal path goes through a vertex twice.

    • »
      »
      »
      10 hours ago, # ^ |
        Vote: I like it +8 Vote: I do not like it

      Which only makes the choice to include paths with repeating vertices/edges even more confusing.

    • »
      »
      »
      10 hours ago, # ^ |
        Vote: I like it +13 Vote: I do not like it

      In this problem, yes. But there may be problems that would make a difference. And I hope this won't happen when we facing them.

»
10 hours ago, # |
  Vote: I like it +3 Vote: I do not like it

All solutions for B using unordered_map are getting TLEs. Isn't it supposed to run faster than ordinary map or am I missing something here?

»
10 hours ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

Why is Python collection Counter prune to hashing hacks but not ordinary map regarding problem b ? UPD: never mind

»
10 hours ago, # |
  Vote: I like it +8 Vote: I do not like it

pls do something about problem c. though i used map and my solution got accepted but it is kinda sad for people who used unordered_map instead of map. c was a comparatively harder today making most of them solving only problem A and getting tle at B

»
10 hours ago, # |
  Vote: I like it +18 Vote: I do not like it

My screencast in rust

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

The use of an unordered map in the second question is making me sad

»
10 hours ago, # |
  Vote: I like it +3 Vote: I do not like it

299698148 Can someone explain me why my B got TLE

»
9 hours ago, # |
Rev. 4   Vote: I like it +24 Vote: I do not like it

I had some seroius troubles with the TLs in this round. Sure, it is about kotlin, but I feel like it could have been a little bit more lenient.

D: The direct $$$O(6C3 q log n)$$$ solution with max-matrix should have passed. I don't think it should be cut.

E: I end up taking the clean $$$O(n^3)$$$ route. I am scared of $$$O(n)$$$ many 01-BFS on $$$O(n^2)$$$ edges, but perhaps I worried too much.

F: My solution that performs O(\log MAX n) ordered set operations are not fast enough, since in many cases I need to perform 3 or 4 searches for every "normal" operation. Though, I did not completely anticipate it being not fast enough, and would have opted for a segment tree/sorting+BS/BIT apporaches instead.

G: The overhead from declaring n different arrays was too much to handle, and I ended up needing to swap n, m when n is large. Allowing extra memory for this case would have been nice. I also see no reason to make the TL this tight -- it is not like there is any significantly easier solutions if an extra log or two are allowed.

Even though it is part of my issues for using Koltin and accepted the TL issues associated with it, I feel like in quite a few cases it was needlessly harsh.

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

What a nice start for 2025 (-_-)

»
8 hours ago, # |
  Vote: I like it +8 Vote: I do not like it

Are $$$O(n \cdot q)$$$ solutions expected to pass on E2?

I think the problem would have been better by only allowing $$$O(n^3)$$$ or $$$O(n^3 log n)$$$ solutions to pass, as it requires to do a workaround on the $$$O(n \cdot q)$$$ idea.

  • »
    »
    7 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    If by O(qn) you mean just “For every distinct state, check and answer every queries”(this is how I used it), then this can definitely pass, as the access patterns are very predictable (looping over all q queries). I worried less about this part than the actual $$$n^3$$$. I think a $$$n^3 log n$$$ is practically a lot worse than this $$$O(nq)$$$.

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

      Yes, that's what I mean. Yeah I didn't even check how many operations was the $$$n^3logn$$$ (even without considering cache it's 3 times slower). My question was because I couldn't believe such a brute solution would pass.

      Although I still think the authors should have changed the limit on $$$q$$$ to either make $$$O(n \cdot q)$$$ pass comfortably, or make it TLE in order to force the intended solution (or the one with log).

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

hey codeforces pls tell me what is wrong with problem b i solved it in an efficient way but not the most efficient i did this way to make the implementation more easy for me i need just to say to me in the contest that the that my code has time limit exceeded on test 12 then i will make it more efficient i try to improve my self and my rating and suddenly i decrease in rating i need just someone to tell me what should i do i am bored from you codeforces i need to become an expert just tell me how with your stupid site

  • »
    »
    7 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    the issue is that you used unordered map. change it to a normal map and it will probably be accepted

»
5 hours ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

Am I blind? I cannot find any information about upper bounds on $$$k$$$ in the problem statement for E1.

  • »
    »
    4 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    In the Input format: "Each of the following $$$q$$$ lines of each set of test case contains three integers $$$a$$$, $$$b$$$ and $$$k$$$ $$$(1≤a,b≤n, k≥1)$$$ — the next question. It is guaranteed that any path from vertex a to vertex b contains at least k edges" this is enough for upper bound

    • »
      »
      »
      4 hours ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      But the author's definition of the path allows edge repetitions, what means that the path may be infinitely long.

      • »
        »
        »
        »
        4 hours ago, # ^ |
          Vote: I like it +6 Vote: I do not like it

        there is no contradiction in this, in any case, if we take any path of minimum length, this will be the upper bound

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

Why was E1 worth just 1000 points?

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

I love this contest because D and E are nice OI style problem