Comments

nah not Bessie its messi

D is not 1500 are u kidding me :(

I was not able to deduce that case 2 can be less than case 1 as per your solution can you think of a tc where this happens

ok so as a pupil myself what i understood first simply by observation and casework that if i choose say my p as x then i can find a q which is the optimal solution this was done purely based on casework. Now once i fix say p=x now i want a q which is as close as possible to y so to minimize the sum so to do that i can only use those bits which are unset in x since we want p&q==0 so i crate a mask where those bits are set which are unset in x now we build our q first as close to y as possible to do this we would build two numbers l and h where l is the largest number closest to y and h be the smallest number greater than y how you build you can see my code it would be much more clear to you

As a pupil I am really afraid of participating due to enormous number of cheaters in div 4

Can anyone tell me why does this submmission 322398512 for div2C passes as i didn't precompute the gcd values as expected by the author

-12

Past

I had a more intuitive solution for B We can reverse our scenario that is start from k=n and so the first sum is the sum of the array now we calculate the second sum depending on which is max of the first two elements that is V[0] and V[1] now and save the max of those as currmax. From now we put a loop and whenever we see any element greater than currmax then only we subtract currmax from sum and output otherwsie we subtract current element v[i] from sum here is the submission 320683657

-18

..

0

you too!

0

Pupil?

I am a newbie to cp , the first observation of index parity was easy to spot for me but i wasn’t able to get the second observation of inversion parity thing neither i was aware of such terms so i wanted to ask is it ok to learn these things as we solve the problems or is it bot ao hard to spot such observations without knowing about even swaps results in same parity of inversion this is an example there are numerous such things that i dont know about and they might come in next contest say

Do you know any blog or site where i could read about such bitwise relations it would be really helpful Thanks

Hello I actually went through your submissions for this problem and had the same logic that if x is odd we do ceil for max and floor for min value and if even we do the opposite but it gave TLE due to large m and n so i limited m/n to 30 but still it gives wrong answer can you tell me why because the correct answer just does floor first then ceil for max. Your help would be really appreciated

On KitasCraft → I feel like I'm not improving, 21 month(s) ago
0

Hey i am facing the same problem can you help me?