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

Автор Serval, история, 3 года назад, По-английски

UPD: The start time has been changed. Note that the start time is unusual.

Hi Codeforces!

Bazoka13, Toxel, and I Serval are glad to invite everyone to participate in Codeforces Round 853 (Div. 2), which will be held on Feb/25/2023 17:20 (Moscow time).

This round will be rated for participants with rating lower than 2100. We will be glad to see the participants with a higher rating to take part in our round unofficially as well!

You will be given 6 problems to solve in 2 hours. Scoring distribution will be announced later.

We would like to thank everyone that makes this round possible:

Good luck & Have fun! :P

UPD2: Scoring distribution: 500 — 1000 — 1250 — 1750 — 2000 — 2750.

UPD3: Editorial is out. Thanks for your participation!

Congratulations to the winners!

Overall:

  1. allvik66
  2. BurnedChicken
  3. maspy
  4. tute7627
  5. Um_nik

Div. 2:

  1. MakaPakka
  2. inhabitant
  3. b8LI
  4. Reisael
  5. stkwill
  • Проголосовать: нравится
  • +394
  • Проголосовать: не нравится

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

As an author, the problems are very interesting. I wish everyone could enjoy this round and have good luck!

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

--DELETED--

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

As an author, I hope you enjoy this round!

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

Hope to get positive delta this time. ALL the best guys!

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

This will be my "birthday-contest"✔️

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

As a tester, I hope you will enjoy the round! The problems are very interesting and educational. Good luck for everyone!

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

As a tester, I witness the great effort made by authors to make this round better. The problemset in fact changed a lot compared to the very beginning version and I believe the current version is worth participating.

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

As a tester, I encourage everyone to participate!

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

good luck QwQ

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

I hope this contest will help us to learn new things. wish everybody a good contest :)

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

Wish I could participate but I don't have time. I hope I can enjoy upsolving the problems!

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

As a chinese university student,I wish the constest be successful.

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

Hope this is my CM promotion contest !

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

I hope you will enjoy these interesting problems. Good luck to you!

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

Hey could i get some likes to remove negative contribution.

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

Well, just completed with implementation and basic questions of trie data structure, and I have already completed bst. Now that I have another tool in my toolkit, hoping to solve more questions this time.

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

    I don't know if you're talking seriously but if you are trie won't get you to pupil

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

      I never aimed for the pupil rank, at least not until I finished the basics of DSA. Earlier, I learned about stack, queue, and linked list, but they weren't useful for contests. So unknowingly, I got the assumption that maybe trees and graphs are more useful for contests. Anyhow, learning a new data structure opens up more ways to approach a problem, and even if I can't solve more questions, it is still valuable.

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

    We will be glad to see you making your tries to solve our Bazoka13 & Serval & Toxel problems. :P

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

As a tester, I hope that all the participants could enjoy the contest! Good luck & have fun! I'm more than excited to say that it's the first time I took part in the management of a CodeForces contest. Thanks Serval for inviting me! QwQ

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

Another Chinese Round :) Will it be hard?

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

Hope I can get back to expert :)

Edit: I appreciated the Paldea reference in C, but problem D is just way too hard.

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

I hope after this round I will stop being a prisoner of the blue

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

Does anyone know the reason for the contest time change?

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

Omg unusual time for codeforces round

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

I want to enjoy this contest together!

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

I hope I'll be able to solve problem C, Glad to learn new tips & trick apart from Practice & consistency

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

Hoping for a quality contest!

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

Остаётся 9 рейтинга до ученика... Хоть бы всё получилось...

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

which is better starting with B to A or vice versa ?

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

Why the unusual time?

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

Thanks for 3 problems contest.

Please correct the blog.

You will be given 3 problems to solve in 2 hours.

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

Why is an O(m+n) solution giving TLE for problem C??

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

Wonderful. But I think you meant Div 1 not 2.

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

Honestly, I dont think testers tested this round.

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

Задачи очень интересные. Особенно задача С. К сожалению, я несколько раз неправильно прочитал условия задач и потерял много времени. И еще, я считаю, что за третью задачу можно давать больше баллов, все же она сильно сложнее второй, а баллы практически одинаковые.

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

I know how to do D with $$$n + 1$$$ operators but with $$$n$$$ operators I can't. :DD

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

Easyforces, but tasks are still cool!

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

DEF are hard

How to solve E?

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

How solve D?

  • »
    »
    3 года назад, скрыть # ^ |
    Rev. 4  
    Проголосовать: нравится +6 Проголосовать: не нравится
    One possible solution to D
»
3 года назад, скрыть # |
Rev. 3  
Проголосовать: нравится +18 Проголосовать: не нравится

This contest gives me some Chinese amazing!

Translate: We will give them some little Chinese amazing

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

This round is 6 stages of grief

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

Can Anyone help how to solve C problem?

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

    HINT-> Just think of how much a number from range 1->n+m would contribe to the answer.

    It was a really cool question just try to solve it using this HINT if you still can't solve see the editorial as it would be available soon I guess.

    Hope you solve the question by seeing the hint yourself :)

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

    Just think in terms of contribution of each value when u form pairs. we need to know in how many arrays out of m+1 total , does a particular value occur. Then apply simple PnC for the arrays it appears in and for the arrays it doesn't appear in

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

WHY is TL on E so tight???

Edit: It turns out that my solution could be greatly optimized. It got AC in 1.7sec.

Edit2: My slow solution without optimizations works in under 3s. If the authors set TL to 4s, it would pass...

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

D is too hard,why

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

How to solve E? I've thought long and hard about how to optimize the complexity of my approach,which was $$$O(n \sqrt{s_n})$$$

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

ABC were good problems overall.

I just feel a bit dumb for missunderstanding C and solving it when you concatenate Ai, A(i+1)...Aj...

It is a pretty interesting problem though

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

Worst contest I have ever seen. I could not see the update in the start time :( (But problems were good.)

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

Div2 problems: A-B-C- E -E-F

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

read "not need to minimize the number of operations"

did not read "no more than n operations"

sadge :(

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

cp is hard

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

people from rank 200 to 2000 (in official standings) solved only three problems. problem set in unbalanced.

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

A very hard contest..

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

My solution to E was very cancerous and prone to random errors (no idea). My solution works in $$$\mathcal O(s_n \log s_n + n)$$$ per test case with somewhat large constant factors (there are a couple of linear passes). Is there a faster solution? I didn't find a way to reduce to $$$s_n \log n$$$. You could always precompute sieve earlier instead of doing it implicitly in the computation from $$$x = 1$$$ to $$$s_n$$$ but I for some reason thought it would to be too slow and wouldn't work. In particular, I feel like $$$s_n$$$ plays a very big role in deciding the complexity, $$$n$$$ doesn't even matter. Is it possible to get $$$s_n \log \log s_n$$$?

[EDIT: OKAY, it passed at 1200ms, so I guess $$$s_n \log s_n$$$ implemented with a somewhat not large constant factor does pass.]

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

Again I'm Unable to solve problem C ಠ╭╮ಠ feeling sad,but I'll not give up Let's see how long it will take.

By the way problem C is very good.

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

How to solve D

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

worst D ever

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

If I've consumed 10 minutes less on problem D, I could have solved E. So unfortunate!

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

Can anyone please explain what is pi and qi in problem E?

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

i think you should find more candidate master, expert, specialist, pupil and newbie to test the round, instead of most of the testers' rating are > 2100.

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

:C

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

Am I correct to think that D is in fact just super easy construction?

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

For D, is't there an O(n) solution?

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

How to solve E, when sn % x != 0.

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

    I think I got the problem down to counting numbers from the array that are in ranges of the form $$$\left[ k \cdot \lfloor \frac{s_n}{x} \rfloor, k \cdot \lfloor \frac{s_n}{x} \rfloor + k \right]$$$ for any $$$k$$$. I believe this should be $$$O(s_n \cdot \log{s_n})$$$ if done correctly, but I got TLE.

  • »
    »
    3 года назад, скрыть # ^ |
    Rev. 2  
    Проголосовать: нравится 0 Проголосовать: не нравится
    One possible solution to E
»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I stucked at A for an hour just because I thought that O(T*N^2) will result TLE...turns out that it don't

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

screencast with commentary

Also nice problem F. But gifting arrays is cancer.

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

Any hints for D apart from the "obvious" observation below?

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

Explanation for D:

If a and b are both all-zero, we don't need any operation. If a is all-zero, we can't change a by operation, so if b is not all-zero, there's no solution. Also if b is all-zero but a is not, there's no solution because shift(a, k) must be different from a since k!=0, so a^shift(a, k) can't be zero. Therefore, we can assume there are some 1 in a and b.

Let min_a = the minimum position that a[pos]=1, min_b = the mininum position that b[pos]=1. We solve the problem by different situations:

--min_a<min_b. If we right-shift by k, we will flip a[min_a+k] and leave a[1...min_a+k-1] unchanged, so we can use right-shift (n-min_a) times to make a and b same on range [min_a+1, n]. Then let max_a = the maximum position that a[pos]=1. because min_a<min_b, we have max_a>min_a, so we can use left-shift min_a times to make a and b same on range [1, min_a].

--min_a==min_b. We still can let a[min_a+1...n]==b[min_a+1...n] first. Because min_a==min_b, we have a[min_a]==b[min_a]==1, so we can use left-shift (min_a-1) times to let a[1...min_a-1]==b[1...min_a-1].

--min_a>min_b. Now we need to left-shift a[max_a] to make a[1...max_a-1]==b[1...max_a-1], and then right-shift a[min_a] to make a[max_a...n]==b[max_a...n].

Explanation for E:

First, we find maximal blocks [l, r] such that floor(s[n]/x) is same for x in range [l, r]. Let a=floor(s[n]/l), then for x in [l, r-1], we have ceil(s[n]/x)=a+1. Let's check how many s[i] can be represented as sum of several a and (a+1). In fact, only numbers in these ranges satisfy the condition: [a, a+1], [2*a, 2*a+2], [3*a, 3*a+3], ..., [(a-1)*a, (a-1)*a+(a-1)], [a*a, s[n]]. We can use prefix-sum to count them, and multiply it by sum[l, r-1]=(l+r-1)*(r-l)/2. Then for x==r, if ceil(s[n]/r)=a+1, we just change sum[l, r-1] to sum[l, r]. If ceil(s[n]/r)=a, we need to check how many s[i] can be represented as sum of a: we just need to check all multiples of a. (My upsolve submission for E: 194975227)

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

When can we expect rating changes to occur?

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

great F

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

Why can you come up with problem E during playing music games? Is there any story-like problem statement?

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

yaa , problems are really good

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

It seems that the difficulties of some constructive problems like D are often underestimated.

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

What is the edge case in problem D that gives this many fst??

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

The data of question C is weak. Someone memset in every test case and he got accepted.

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

Started the contest late because you thought it will start at 20:05(IST) gang:(

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

You can find the editorial video for the problem C on my channel.

Problem C: https://www.youtube.com/watch?v=7nYE42FZzN4

wishing positive deltas to everyone :)

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

What is the expected rating for C?

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

Вопрос по задаче А. Что я не так делаю? Отсортировал массив, нашел для всех префиксов ноды. Потом иду по массиву нодов и смотрю если нод больше длины, то ответ нет. Если для всего массива условие выполняется то ответ да. Конкретно на примере: есть массив 1 4 2 6 сортирую его получается массив 1 2 4 6 для его строю массив нодов 1 1 1 1. Каждый текущий нод меньше текущей длины значит массив хороший. Может кто подскажет контрпример. Вылетает на 231 тесте, а его невидно.

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

How are you supposed to find the solution of problems such as C in a reasonable amount of time? I participated in a lot of contests (this is a new account), and my weakest point has always been spotting these small "tricks" and "observations" that these problems require in order to be solved.

Before saying the "duuh, just practice!", I want to say that I tried practicing a lot, trying to understand the solution of the problems and the whole process of finding it, but for me it's still so hard to see the solutions of problems like these.

I couldn't find it during contest, it took me like 2 hours after that to see the solution is that you must know at the end how many times does each element appear throughout the whole transformations over all arrays, and from that you can calculate the solution. But the thing is, I just stumbled upon this randomly, because I tried different ideas that didn't work, it wasn't because there was some heavy thought to it. I find it frustrating that after years of trying (again, this is a new account, I used to be 'expert' rating) sometimes I can't even solve C problems, while other participants who are newer to this just finish it in like 20-30 mins (or even less).

Am I too stupid for this?

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

    As a CM, I even couldn't solve some problems between B-D for several times (and that's why I've dropped from master). I think everyone will perform badly at some times, so cheer up please.

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

    Man I feel this so much, and honestly, I don't know any better advice than to practice more and don't look at tutorials :/

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

    The trick is to break down the problem, first into any solution then optimize it. Here, I will perform it on problem C.

    We need to transform into a palindrome, right? We need to change a segment so that our thing becomes a palindrome. Obviously, we could just check every possible change in O(n^3) complexity but that's too slow. Here, we can make use of something that we know — the symmetry. A palindrome is, by definition, symmetrical so we can notice that changing the same segment in the first half or its mirrored counterpart in the other is virtually the same for the purpose of the solution. That also means that we will only ever change something on one of the halves (because if we were to start our segment in the first half and end somewhere in the second one, we might just as well not change the middle parts and reduce the operation to changing only in one half. So here we are, we reduced it only to a half. What does that mean? That means that we need to change every single bit that isn't equal to the mirrored counterpart in the other half. Now, when is that possible? When all of those form a single segment and checking that is really easy.

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

      That's B, not C

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

        oh, ye, my bad

        Anyways, for C then. Obviously, we can just try and merge every 2 arrays and count the distinct numbers but the complexity would be O(n^2 * m) which we cannot afford. Even if we had a magical box that would merge arrays in O(1), we would still have an O(nm) solution. That means that we need a much different approach than testing all combinations. We can see that the arrays change by one number at a time and for every number that appears during the whole thing we can denote when it appears and disappears (we can do that as numbers are pairwise distinct). Using that information, we can see in how many arrays the number appears. That allows us to count the score for each number (there are max n + m distinct numbers) and then conunting in how many combinations the number appears (that's just combinatronics, you can do it many ways)

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

      the general idea is that you try and find every single, even useless consistency you can and note them down until you find something that is useful

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

    Well, you just move from one idea to another until it works

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

Had 6 WA's because I missed one return statement :(

Anyways, got AC on D 2 min before the contest ends :)

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

It's good to be cyan :)

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

Ratings updated preliminary, it will be recalculated after removing the cheaters.

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

became cyan today!!

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

O-oooooooooo AAAAE-A-A-I-A-U- JO-oooooooooooo AAE-O-A-A-U-U-A- E-eee-ee-eee AAAAE-A-E-I-E-A- JO-ooo-oo-oo-oo EEEEO-A-AAA-AAAA

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

Can someone please explain why these 2 solution differ only in one operation that is theoretically the same in both cases but one gives wrong answer ?

correct one: https://mirror.codeforces.com/contest/1789/submission/194991180

wrong one: https://mirror.codeforces.com/contest/1789/submission/194991257

ps: the difference is where I initialized ans

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

For problem D, I use boost/dynamic bitset to allocate dynamic size. But it's not accepting on cf compiler. What can I do? Here is my code https://mirror.codeforces.com/contest/1789/submission/197297649