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

Автор BledDest, 6 дней назад, По-русски

Neapolis University Pafos

Привет, Codeforces!

Благодаря поддержке Neapolis University Pafos, продолжается серия образовательных раундов.

В 04.11.2026 17:35 (Московское время) состоится Educational Codeforces Round 196 (Rated for Div. 2).

Этот раунд будет рейтинговым для участников с рейтингом менее 2100. Соревнование будет проводиться по немного расширенным правилам ICPC. Штраф за каждую неверную посылку до посылки, являющейся полным решением, равен 10 минутам. После окончания раунда будет период времени длительностью в 12 часов, в течение которого вы можете попробовать взломать абсолютно любое решение (в том числе свое). Причем исходный код будет предоставлен не только для чтения, но и для копирования.

Вам будет предложено решить 7 задач за 2 часа. Надеюсь, что каждый участник найдёт для себя интересные задачи в раунде.

Я бы хотел поблагодарить Михаила MikeMirzayanov Мирзаянова за платформы Codeforces и Polygon, без которых серия образовательных раундов бы не состоялась.

Также большое спасибо тестерам: ashmelev, shnirelman, awoo, FelixArg. Ваша обратная связь помогла сделать контест лучше!

Наши друзья из Neapolis University Pafos хотят поделится с вами важной информацией.

Программа бакалавриата Computer Science and AI в Neapolis University Pafos приглашает старшеклассников принять участие в конкурсе по программированию Youth Coding Challenge, который состоится 29 ноября 2026 года. Конкурс является отборочным этапом для участия в направлении Competitive Programming в рамках ACTS 2027.1.

Как один из организаторов лагеря ACTS 2027.1, мы будем рады приветствовать вас в г. Пафос, на Кипре, с 15 по 25 марта 2027 года. Вас ждут лекции, тренировочные соревнования и обсуждение задач с экспертами, среди которых Павел Маврин и Нияз Нигматуллин.

Отбор участников будет проводиться на основании результатов конкурса и предыдущих достижений.

Узнайте больше и зарегистрируйтесь до 27 ноября!

Увидимся на раунде! Удачи в решении задач.

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

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

What topics are generally asked in educational rounds

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

is problem rating distribution for educational rounds not announced beforehand?

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

Update: the contest will contain 7 problems.

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

Looking for advice

would you participate? from one hand I only do codeforces to practice from the other hand registering for a div2 when I am 2085 is a guaranteed to go down especially when there is a div1 in 3 days where going to 2100+ is practically guaranteed

Just that with all the cheaters and with the fact this is only 2 hours and not IOI — ICPC times I am leaning a bit toward unranked registration but it's kind of cowardly. what do you think?

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

Noooo why 10 min delay

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

Why it is delayed?

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

Delayforces

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

Why delayed?

Don't waste my time to sleep

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

Thank you so much for the delay

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

Delay no more

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

why delay 10 minutes ^o^

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

yoo I was doomscrolling and forgot to get into the contest, W delay

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

Honestly, it was a pretty cooked rating distribution:

A: 900, B: 1000, C: 1300, D: 2000.

A == B < C <<<<< D, E, F, G.

Or did I miss some easy observation that makes the trivial solution to D not O(n^3) simulation.

Edit: For me, C felt easier because it was just greedy.

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

nice problems, but too tight TL

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

I can't be the only one who just assumed that $$$\sum{n} \leq 5000$$$ in E, and spent half an hour trying to optimise my $$$O(t \cdot 5000^2)$$$ solution T_T

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

5 seconds away from solving G ;_;

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

This was a competition testing how fast you can code

I think I spent the most time thinking on C :)

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

$$$C$$$ was harder than everything else.

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

C took quite a while for me to debug, but I got it!

Now I'm thinking about D

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

I don't know whether I'm stupid or not, but I genuinely believe that C is much, much harder than D and E. Yet somehow, C got significantly more ACs. I'm honestly very confused.

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

    because it's C, most people read in order and never jump

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

    for C, is it the right idea to count 1s at each bitwise place and then check which places will be 1/0 based on parity of the count (odd = 1, even = 0)

    and then greedily compare it with 2*m and then for every bitwise place try to construct it?

    I just couldn't figure out how to implement the last part

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

      You have the right idea on counting parity.

      To implement the last part, if the parity isn't correct (even == 0) then you can just decide to NOT shift a power of 2 (since that has only 1 bit set). and keep doing this from largest bit to smallest bit

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

      Here is my solution, which took me an hour of thinking and brute-forcing to arrive at this observation. .-.

      By doubling the i-th element, its value becomes 2i, which changes k to k XOR (i XOR 2i).

      Now, we can observe that i XOR 2*i consists of exactly two set bits.

      For convenience, we can choose elements of the form 2^k, since doubling such an element simply shifts its set bit one position to the left, resulting in two adjacent set bits in the XOR.

      With this observation, we can process the bits from the highest to the lowest and use the operation described above to construct the desired k.

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

      you can look at my solution, I implemented the same approach but with 2*or (111..110) instead of 2^m-1 (1111..1). It was a pain to work out but it works because you move from highest bit to lowest bit and recursively choose only one number from each (10000.. to 1111..) range with top bit set to 1, and then double it, so now it won't impact higher bits we have already traversed. here

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

    I just iterated in reverse and kept a track of xorsum if I xor it with i or with 2*i and kept whichever resulted in a greater xorsum I'm kind of able to prove it but too lazy to find out if the proof's correct

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

$$$0$$$ IQ solution for problem C: you can just toggle a random number until you get a big enough xor.

See 397353027

Unless someone can hack it :D

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

My solutions for A through D:

A:

  • If all numbers are positive, delete all except 0 and 1. Same strategy for negative.
  • If the numbers span across 0, then we can cancel 2 numbers with the same absolute, which leaves us with only positive or only negative, which we then refer to the above strategy.

B:

  • The final array must start with smallest value X, and the rest can be multiples of X. This guarantees that any 2 indices offset by X have the same binary string value.

C:

  • We want the final XOR to have all bits be 1 (except the smallest bit doesn't matter)
  • By default assume we multiply everything by 2
  • ^ if we do the above and there are any XOR bits set to 0, then find the corresponding power of 2 (which has only 1 bit set) and DON’T multiply that by 2
  • ^ iterate from largest bit to smallest bit

D:

  • If n is even, then the answer is just n (because every vertex will be black)
  • If n is odd, then we should test out n, n+1, n+2, since these will make all nodes black EXCEPT 1 node. We just need to check if that 1 node is gray. We do this by checking each edge on that 1 node. Collect the vertices reachable by that single edge. If that set contains the pair (k — i, i) then it won't be colored grey. Otherwise, it will.
»
4 дня назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

D was much easier than C. Not my day tho :(

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

C is such a garbage

BIG L to this round

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

D is really just https://cses.fi/problemset/task/1136. really fun round tho

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

Could someone hack my solution to C? Filled the answer array with ones and randomly change one position at a time until found

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

Editorial when?

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

C was too hard. at least D and C were have to be swapped :)

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

How do I know if I am ranked or unranked?

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

I am currently finishing the editorial, it will be posted in about 2-3 hours. Sorry for the delay.

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

come on... The number of solves was way higher than the difficulty of the problems. Honestly, this is really disappointing...

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

The number of solutions was way higher than the difficulty of the problems. Honestly, this is really disappointing.

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

Am I the only feeling that time constraint on D is too low ?

I was lacking time so I went straight to recursion (in python), and I got TLE (even after using bootstrap)

I know recursion is slow in python, but see, I increased the time constraint by moving it to a private contest, and the runtime was 2.8s.

Please tell me if I should ask for rejudging :)

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

What is the intended complexity for problem G?

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

Is C always solvable by doubling only 1 or 2 numbers? I just doubled N and if the xor wasn't high enough, I iterated from 1 to N-1 and tried doubling one of those.

Seems like that worked?

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

    It's true

    Spoiler
    • »
      »
      »
      3 дня назад, скрыть # ^ |
       
      Проголосовать: нравится 0 Проголосовать: не нравится
      O(1) implementation
»
3 дня назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

To me C is more challenging than D and E. My greedy didn't use exponents of 2 but passed the data,welcome hacking

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

Wait what?

For problem G, the $$$O(n2^n + qn\log t)$$$ solution works out to only about 2e8 operations, yet with a 7-second time limit, it got TLE!?

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

Why so many people (including me) got FST on G? Is the pretest too weak?

I think 7s is enough so I used O(n2^n+qn(logt+n)) instead of O(qn) which I think is slightly hard to implement...QAQ

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

Why didnt my rating increase?