Hi all!

This weekend, at Nov/29/2020 10:05 (Moscow time) we will hold Codeforces Round 687. It is based on problems of Technocup 2021 Elimination Round 2 that will be held at the same time.

Technocup is a major olympiad for Russian-speaking high-school students, so if you fall into this category, please register at Technocup 2021 website and take part in the Elimination Round.

Div. 1 and Div.2 editions are open and rated for everyone. Register and enjoy the contests!

The problems authors are; amethyst0, eidan, Diegogrc, bensonlzl, Maripium, antontrygubO_o, and KAN. Thanks to antontrygubO_o and 300iq for their help in coordination. Also huge thanks to testers for their invaluable help: Golovanov399, rkm62, golions, dantrag, _cherry_, gigabuffoon, Andres_Alumets, firiexp, growup974, Nero, GGMU, K0u1e, Bench0310, dorijanlendvaj, Um_nik, thenymphsofdelphi, Merkurev, kokokostya, wucstdio, smile_boi, abhishhh1!

Have fun!

Thank you for participation! We hope you enjoyed the problems. Congratulations to winners!

Technocup 2021 - Elimination Round 2

Codeforces Round #687 (Div. 1, based on Technocup 2021 Elimination Round 2)

Codeforces Round #687 (Div. 2, based on Technocup 2021 Elimination Round 2)

Upd: Rating updates published.

UPD2: The editorial is published.

Notice the unusual start time!!!Thanks, I might have missed this round.

Why do people even downvote this comment?)

Probably because of ratism rip

or username

Because those comments and similar ones are just filling the comment section making finding useful content takes more time.

I missed :(

I missed too :(

I nearly missed the round today!! :/

Notice the unusual time.Best of luck everyone.

please upvote me , i am getting too many downvotes !! please push me to a +ve side !!

haha every one voted u down

push me to zero please!!!!!

Why the unusual start time?It is based on problems of Technocup 2021 Elimination Round 2 that will be held at the same time.So, it must be at the same time!Today is my Birthday and I enjoyed testing this amazing round on my birthday. Problems are very very interesting. (May I get my gift now, you know what I want)

Happy birthday _cherry_ ....one of the most consistent tester

Happy Birthday _cherry_. You will get your contribution.

Happy birthday _cherry_...Keep testing :-)

Happy bday _cherry_ aka Cherry. May this bday come with lots of positive deltas and positive contributions.

Happy birthday postscript, a very good tester.

Happy birthday postscript.

happy birthday to you!!!

Happy birthday _cherry_.

Heppy birthday _cherry_ and keep testing :)

I wonder why the birthday wishes being downvoted :(

Happy birthday _cherry_ :) ...

Happy birthday _cherry_, all the best for your future endeavors!!

.

Happy birthday _cherry_ !!!

Happy birth _cherry_. I wish you good luck in next contests!

Happy Birthday _cherry_

Happy birthday my dear friend _cherry_.

And that's how it's done uwu

This competition is friendly for Chinese competitor! Thanks KAN!

Yes, it's not only an unusual time but also a good time for us (Chinese), we needn't stay up until midnight. But unluckily I have no time to participate it.

Pacific time zone people are probably celebrating, lol, better than waking up at 6am in the morning.

I'd prefer to take those rounds in 6am compared to the time when I normally need to be at work

So many red coders as authors N testers, Well I'm a little scared!!

I'm sorry to hear that. I will miss the contest. I will not at home tomorrow afternoon because I have to participate in a competition in my school. (-_-!)

Have fun and good luck!

Score distribution?Is this rated??

Nice contest, thanks KAN and your team !!!

Goodluck to everyone ^_^

As a tester, doing it for the first time, I have to say that preparing a round seems like an enormous amount of work by the problemsetters and coordinator. Much more work than I imagined. Huge respect for everyone who makes rounds happen, even when something goes not as planned!

As a tester, KAN amethyst0 antontrygubO_o Maripium eidan Diegogrc bensonlzl are great problemsetters. I would highly recommend all to participate in the round.

A great time for Chinese competitors! I won't miss this round :)

Do you mean Technocup 2021?

Will i be rated ,if i register on that site . Also i am able to register in div2 and official , both contests.

In the techno cup round 1 my rating decreased sharply I hope to get my rating back in round 2 .

I just want to say good luck to everyone

Can the string hash to O(1) to compare the dictionary order size

What will be the difficulty level of this contest (div2) ???

Same as difficulty of other DIV2 contests.

Thanks for starting contest not in dawn.

Today is my birthday

Happy Birthday bro :)

To be honest every round is the birthday of ~50 people participating

lol, you gotta save maths xD

Russian students are very lucky. They get introduced to programing at a very early age! As for us, country like Bangladesh India Pakistan, we rarely get to know what is programing before university! Hope one day it will be changed! Good luck everyone.

In China, kids now get introduced to programing usually in middle school and sometimes in Grade 4 or 5. I really got a shock that Russian kids starts programing so early... Maybe we should learn something from it.

In India as per New Education Policy, Programming is going to start from 6th grade.

That would be really cool then! India will go one step further! In Bangladesh, remains the same, no changes ;(

What if I had registered and won't be able to participate? Because I am not sure whether I would be able to participate?

Nothing happens, the contest will be unrated for you unless you submit a solution.

Your rating will be unchanged

You don't need to worry about it because your rating will change

if and only ifyou participate in a contest and submit your solutions during the contest.When Scoring distribution will update?

Expecting for it too...

First of all, how many tasks are there...?

6, it is written in Russian announsement

What amazed me is there are only 5 tasks in D1 ... :(

just a simple question regarding contests : once I submitted solution and got WA on pretest 1 and still I didn't get any penalty!! Is it true to say that if I fail on the sample test cases then no penalty will be there?

only testcase 1, not all sample testcases.

I'm a simple man. I see anton, I take part.

Not able to solve even a single problem RIP.

Is everyone getting Queued in their submission?If so, what is the issue?Nope

Yes. Its running on pretest since last 4-5 minutes

yeah I am also having queued submissions

KAN Great contest sir... Loved it.

khó v pip dm

đúng vậy khó như đấm mồm người khác dm thằng ra đề

This queue is a joke... spending ~3-5 minutes just to see if your submission is wrong isn't fun when you're really on the edge to solve a problem. EDIT: now more than 5 minutes:)

no queue very fast i got my result only 5 secs còn m lâu do m ngu :)

:( The queue is bad today

6 minutes in queue and I think this contest is going to be unrated..this is so frustrating

Will the contest be extended or will any other measures be taken, because the queue is pretty bad?

It better be rated :-(

I was solving wrong C, thought that you could remove any element :(. Realized it in the last 10 minutes. But I think i managed to get correct answer.

me too (I realized it the last 20 seconds)

ohh man, i was solvig the verion too :( (realized after reading your comment)

is it rated now?

What is test case 9 of D Div2 / B Div1?

Upd: got it.

there was a queue of around 5 minutes in end and the round wasnot extended this waas the only problem I faced with this round!

How to solve D(div2)?

how to solve problem D? I just bruteforce and passed sample...

what was ur approach for D?

just enumerate the interval of len 2 3 4 ...

I guess the length won't be too large

good questions!^^

Did anyone else face a queue in the last minutes of the round ?

What is the hack for Div1B ?

At the last moment, I was facing In queue prblem :(

How to solve div2-D?

u have already solved it so u tell us how u solved it ?

I wrote shitcode, which 100% fails on the systests.

ohh but what was your approach ?

If n > 60, answer = 1; else Run brute force. I did in O(n^3) brute.

For the first condition, by Pigeonhole principle, there will be atleast 1 bit which is the most-significant-bit for 3 consecutive numbers. Choose the later 2 numbers from them and perform operation on them, their xor-sum will be less than the earlier number from them. So the answer will be just 1 move.

What are hack cases for div1B?

And the answer is...?

It should be 2 since 5⊕11 = 14 > 13 = 19⊕30

Some code only considers only single range for xor, which fails to answer these cases since 5⊕11⊕19 = 29 < 30 and 5 < 6 = 11⊕19⊕30

But how to consider all the ranges?

You only have to consider two consecutive ranges; i. e. [i, j) and [j, k)

Time for some Fs in the chat for the half of contestants... It seems insane that this was not included in the pretests.

Will the answer be -1?

It should be 2

Ok, there is a conflict between our answers, LoL.

what the

will system test must contain this type of test sir ???? then a lots of people failed !!

UPD: Then sir can you please mention the author or mike sir if they must look into this test :(

conflict

It

should.I submitted C in last 2nd minute but the judgement didn't came in contest. If it gets passed. Will it be considered in rankings or not?

It'll be considered

It passed :)

Hey, I submitted the solution of problem C 5 minutes before the contest was going to get over, but it remained in the queue till the contest ended. Will my solution be judged? plz help

Yes it will . Even if you submit in last second it counts .

Don't worry, it will be judged, mine is still stuck on pretest, even after the contest is over.

Thankyou very much.

hey i am new at recursion..so i was trying to solve problem c in div 2(Bouncing Ball).i was using this recursion->

`ll aa( ll i) { if (i >= n)return 0; if (s[i] == '0') { return min(y + aa( i + 1), x + aa( i + k)); } else return aa( i + k); }`

it passed me the given test case but i got TLE in pretest 2.i know i have to use dp or some other approach to imporve time . but i was thinking is my recursive approach is right or wrong .can some one help me if it is wrong what would be the recursion? any kind of help is appreciated. (sorry for bad english)dp is not required to solve problem C its simple O(N) solution bro !!

yeah i saw the solution it can be solved in o(n) with single loop..but i am asking if my recursive approach is correct or not

I would say no. I used the same memoisation approach as yours during the contest and got wrong answer on pretest#2.

Regarding the queue: unfortunately during the last 5 minutes of the contest the queue was around 5 minutes due to huge number of submissions. I understand this is not very convenient, but we decided not to modify the length of the contest due to the following reasons:

This delay is not that large considering the total contest time.

Extension of the contest can bring a longer queue anyway.

Sorry for inconvenience, we hope for your understanding.

is it rated KAN ?

Yes.

But I messaged you the same 15 minutes before the round ended I hoped you will understand that queue is going to increase more thus extension was the only way to resolve at least some queue. And the queue at ending time is nail biting in div2 when you are getting wrong answer due to vector length overbound runtime error and it is indicated as WA. I think action is needed to remove last 15 minute queues for further rounds.

what is the approach for Div2-C ?

DP. I think..

no single for loop implementation NO Dp !!

One of the solution is as follow : let us iterate over all possible values for the index where p will hit, i.e. if we don't remove anything from start and we have 0-based indexing, then we will hit on p-1, if we remove 1 from starting we will start at p, if we remove 2, then at p+1 and so on.

So, if I know the starting point, what I would like to know is, going forward at interval of k, how many 0s, we will be hitting. This part can actually be stored first.

So, pseudo code

'''

3 10 3 2 0101010101 2 2 5 4 1 00000 2 10 11 2 3 10110011000 4 3

'''

n=int(input()) for i in range(0,n): o=input().rstrip().split(' ') p=input().rstrip() s=input().rstrip().split(' ') x=list(p) L=[] Q=[] W=[] S=[] D=[] for j in range(int(o[1])-1,len(x)): if j not in L: L.append(j) Q.append(j) S = 0; for k in range(j,len(x),int(o[2])): L.append(k) if x[k]=='0': S+=1; W.append(S) # print(Q,W) mini = 10000000000000; for j in range(0,len(W)): A=Q[j]+1-int(o[1]) T=int(s[1])*A; T+=(int(s[0])*W[j]) mini = min(mini,T) print(mini)

my O(N) solution

do not directly paste your code, use spoiler

how to use spoiler please tell me ??

Like this

SpoilerSpoiler inside spoilerPlace anything here

where to create this spoiler from ??

Spoiler...

got it man thanks much

There is a Spoiler option in codeforces tags icon

got it man thanks much see above i created one ...!

Nice contest. Nice problems. Managed to solve 2 Good Going

Get a shirt and sufficient nutrition. Edit: The pic changed after some time.

I have to money , I am poor (crying noise intensifies)

That feeling when you solve the problem 5 minutes after the contest.

why was their so much of queue time? my 2 solns were in queue for more than 8 mins?

The problems are perfect, but around the ending the query queue is so long that I feel very nervous .

if this is the problem than it should be unrated? as i eas dont able to concentrate on further problems due to this issue.

I think it won't be unrated since it's just a small problem.

Why this solution passed in Div1B/Div2D its complexity is O(n^2). It should get TLE?

This block will return answer if there are atleast 3 numbers with same most significant bits.

So, for each most significant bit, there can be atmost 2 numbers. For $$$a_i \leq 10^9$$$, there are at most 30 bits, so $$$N \leq 60$$$ holds.

I'm going to FST in B. Very sad times. Otherwise I might +100 according to the predictor....

The case for me to FST:

What's the real answer for this case?

2

How?

8^18>34^59

FST = Fail system test? right?

Yes

Editorail link?

good problem set

f*ck B pretests

Hi, Can anyone explain B I got stuck there

how a 10^4*10^2*10^5 passed in 1 sec ?

It's 1 sec per test case, and not for 10^4!

How to solve Div2 B?

Complete search

how a 10^4*10^2*10^5 passed in 1 sec ?

It is guaranteed that the sum of n over all test cases does not exceed 10^5.After how much time I can submit my solution to a problem after the contest ends? It is showing "contest is over" and I dont see problems in problemset section. Anybody have any idea? Please

pending system test is going on

How to solve D? (Edit : I was thinking of prefix and suffix xors, and I see some people talking about it in the thread. But I was not able to prove it. So didn't code.)

I think the idea is to create a prefix xor array $$$p$$$ and now we need for each $$$i$$$

$$$p[j] > v[i+1] \oplus p[i] \ j < i$$$.

So you need the $$$min(i-j)$$$ over all $$$i,j$$$. And update the answer doing the same on the reversed array.

It seems that D1B has too weak pretests and clearly I'll fst...

upd:TEST 51 is GOD!

Any example corner case?

sorry for stupid question. But what is fst ?

FailedSystemTests.That means your code passed pretest(maybe very weak)and failed in a extra test made by other person because your solution is not correct.fail system tests

Make It Unrated .Why wasn't there additional time after such a long queue? It's so unfair. :)

Did anyone else face a

queuein the last minutes of the round ?... My solution was in queue even when the contest was over... !!Is it fair?

Same here I also faced the same problem in the last 15 minutes!! The solution I submit was in queue for a very long time!!

B was the only good task in Div1 (possibly other than E), but you managed to ruin it with disgusting pretests

How to solve div2E/div1C?

Can D be solved with trie?

using prefix and suffix we can insert them into different tries, and then with each index we check using dp on the trie of the suffix: the minimum index which makes the current xor smaller than v[index-1], and we do the opposite for the prefix.

is there anything wrong with this idea?

i saw many people solved it in an easier way but i think this solution might be interesting.

Even Contest is Over But In Queue.

Sure sir

Yup! I will be really disappointed if it goes Rated

.

No buddy, The contest should be rated. It is not a big issue.

Agreed.

In A div 1 they fixed the statement by eliminating a possible case. I had 3 WA's in A div1. That is not why I will say that it is made unrated. Improve your skills and don't cry.

[deleted]

.

jaisa app bolenge baisa hi hoga

no.... :(

System testing still pending for all?

Nice contest. Problems were really good comparing to previous rounds.

Can someone explain why in div2-B O(n*100) will not give TLE given the time limit is 1 second.

$$$10 ^ 7$$$ operations under a second is cakewalk for C++.

But there are 10^4 test cases also. The total time complexity should have been O(t*n*100) which will be 10^11. Is there something which I have misunderstood regarding the time complexity?

*It is guaranteed that the sum of n over all test cases does not exceed 10^5.

But 10^4 for every testcase does not count ?Then it will be 10^11.

I see someone said: "Codeforces works fine with 100M operations for 1 secs"

As sum of n over all testcases does not exceed 10^5 hence O(10^5 * 100) = O(10^7) which easily runs in 1 second.

I am so dumb. I did not saw this line in the problem.

If this is the first time then you're not dumb. But if you repeat this again then you're.

But 10^4 for every testcase does not count ?Then it will be 10^11.

n is 10^5 so O(n*100) = O(10^5 * 10^2) = O(10^7) Usually TLE occurs when no of operations are more than 10^8. Hence, No TLE will occur

But 10^4 for every testcase does not count ?Then it will be 10^11.

"It is guaranteed that the sum of n over all test cases does not exceed 10^5". Read this statement carefully.

Thanks KAN for the time that friendly for Chinese OIers.

I hope I would not FST and become CM!

update:I got an FST on div2 D ...... But it seems that I can still become CM?

Congratulations! :)

As an alumni, it is pretty interesting to see someone from xue jun high school :)

Make It Unrated .

Why? The problems were pretty balanced, statements pretty clear

for DIV 2, Last problem, NEW GAME PLUS! I found some issue with the third pretest,

13 2

3 1 4 1 5 -9 -2 -6 -5 -3 -5 -8 -9

the answer I calculated by logic is

70, yet the output given is71,can anyone

please explainthis pretest?Take as: 5 4 3 1 1 -2 -3 -5 -5 -9 reset -9 reset -6 -8

Can you kindly explain this test case more clearly? How could you reset -6 -8?

In my opinion, the order of bosses should be 5 4 3 1 1 -2 -3 -5 -5 -6 -8

-9-9. Then, we will reset before we meet the "bold" bosses.I know that it will be inconvenient for you to read the problem again. I would really appreciate it if you could help me.

No problem, actually if we regard it as three arrays:

[5 4 3 1 1 -2 -3 -5 -5

-9], [-9], [-6-8]You can see that the last element of eary array (the bold ones) is not counted into the sum. So we would like to place the smallest ones at end of each array

I got it. Thank you very much.

You should explain your calculation "by logic" resulting in 70.

Div2D/Div1B is ruining the ratings of many. xD

Pretests were so weak for it:)))

and improving for many!

I also FST on D. ??????

unlucky day...

From +100 to -100??

INTEGER OVERFLOW

I passed the pretest but failed in the system test for Div2B. Is there any way for me to improve code efficiency?

https://codeforces.com/contest/1457/submission/99863237

Seriously, don't use Python.

Oh please

Don't push the blame for this onto python

Python is more than enough for div2

Try submitting the same usin pypy

Damn, it worked :) Thanks!

Could you just use brute force for div2D/div1B? My approach got 46ms on tests up to 45 but WA on it: https://codeforces.com/contest/1457/submission/99889304

For $$$N$$$ $$$\leq$$$ $$$60$$$, brute force. Otherwise, you can find a set of atleast three consecutive elements with same highest set bit. Choose the last two elements, the xor of which will be less than the first element. So, just one operation required in this case.

Wow, thank you! This is very smart!

what's with the weak pretests!!

Before system testsAfter system testsI feel the luckiest person on Earth.

I'm luckier lol

WHy this submission is WA Instead of RUntime error. If some index is out of vector size why I got WA . the same submission when I increased length of the vector passed easily. AM I missing something with properties of vector.

More like you're missing something about the properties of C++

C++ does not care that you accessed some who-knows-what-storing memory

Very WEAK Pretests!!!

FROM +100 TO -100, for an obvious mistake and an INTEGER OVERFLOW issue.

Though it is me that wrote the FST code, how can pretests be SO WEAK? I AM ANGRY!

But it was you who wrote the FST code. Pretests should cover the basic understanding of a problem and they do.

I believe according to codeforces problem setting guidelines, pretests should also be STRONG and make mistakes like INTEGER OVERFLOW fail. Covering the basic understanding of a problem is the main job for examples, not pretests.

Are these guidelines publicly available? Knowing what to expect during a round would be beneficial to participants as well, even if they don't prepare any problems themselves — but I didn't manage to quickly find any post on that.

It seems like the expectations changed a lot over the last several years: 5+ years ago integer overflow not being covered by pretests would've been totally OK, and nowadays most of contestants see it as something utterly wrong and unfair.

Yeah I had one when I did problem setting. I'll try to find it.

In guideline:

It is here:

https://docs.google.com/document/d/e/2PACX-1vRhazTXxSdj7JEIC7dp-nOWcUFiY8bXi9lLju-k6vVMKf4IiBmweJoOAMI-ZEZxatXF08I9wMOQpMqC/pub

https://docs.google.com/document/d/e/2PACX-1vRhazTXxSdj7JEIC7dp-nOWcUFiY8bXi9lLju-k6vVMKf4IiBmweJoOAMI-ZEZxatXF08I9wMOQpMqC/pub

According to this file:

IF YOU ARE TO PREPARE A ROUND ON CODEFORCES, THESE ADVICES ARE RULES. FOLLOW THEM AS CLOSE AS YOU CAN.

against integer overflow, a few random small tests. All corner cases that are easy to miss. If you deliberately don’t include some corner case, talk to the coordinator about this.Can anyone please tell me what is FST?

It's a special data structure that's mostly known at lower levels: Failed System Test.

Nice one

It's always good to prove the solution is exactly correct...You know that not only CF but CCF provides weak samples too

Alright, maybe I'll get those lost rating back next week

I FSTed two times by a) allocating incorrect array size and b) reading the input wrong and somehow passing pretests (1-indexed instead of 0-indexed)

This is life I guess

use #define int long long.

Finally going to be violet It seems

Most likely this wouldn't happen without mass-FSTs, so I waited for them, and they came to me. So sweet :3

finally going to be blue ..wouldn't happen if not for FST

congrats my dude. <3

Congrats!!

waiting for editorial

Is the following solution for Div2 D correct, or are the system tests weak? (this gets OK and passes the system tests)

The code iterates over the location of the potential decreasing pair of elements, and tries applying the XOR gun at most 32 times at both endpoints of the pair (and if the XORs are decreasing, updates the answer).

Yeah, it is correct I think

Range of length 66 is guaranteed to contain at least one triplet with the same most significant bit. And if you have such a triplet, you can solve the task for one move

And if the answer is bigger than 1, you basically do bruteforce

First of all, in order to keep the comment section readable, please don't post whole code here...

Yes, this solution is correct, although it may sound weird in the beginning. For this, suppose there are 3 integers in the array with the same leading bit. Because the array is sorted, if there are three, then there are three consecutive. Then by xoring the second and the third, the resulting number will have this bit off, and thus will be smaller than the first number (of the three we looked at). Thus if the answer can only be bigger than one if $$$n \leq 2 \cdot log(max(a))$$$, which in this case gives $$$n < 60$$$. But in this case, your code bruteforces all the possible ranges, and will find the best groups.

EDIT: As mango_lassi pointed out, I don't really see why it's correct if the bruteforce only checks sets with size up to 32...

Shouldn't the loops go up to 60 for the code to brute-force all possible ranges? What if, there was somehow a case where, say, $$$n = 41$$$ and you need to xor the first 40 to make them larger than the 41st number?

True, I didn't think that far, I only saw the bruteforce...

I wonder what is the actual worst case here? Skimming through the system tests, it looks like 29 is the largest answer?

Can somebody show how to get more strict upper bound of log instead of 2*log?

Let's say we have one number for each most significant bit

And now we add one more for one of the bits

So we have a pair (A, B)

Now look at A^B

If it doesn't create an answer immediately, it joins the neighboring bit on the left

So if we count numbers by the most sign bit and we have something like

[1,1,1,2,1,1,1,2]

It is already enough to create a decreasing sequence

`[1,1,1,2,1,1,2] -> [1,1,1,2,1,2] -> [1,1,1,2,2] -> [1,1,1,3]`

`(log + 2)`

numbers seems enough to gurantee the existence of the triplet with the same sign bit.And there will be no more than log operations before we stop

So it seems it is

`rounddown(log n)`

any hint for [problem C] and thank u

The deleting first element is like to increase

pby one so check the brute force and preprocessing you need check if you'repincrease bycso you needx*ctime and the number of elements such as equals to0and placed at the one ofp+c, p+c+k, p+c+2k, ...positions product byy.Hint 1You can pick The index of the first cell on which the ball will fall.It can be: p, p+1, p+2, ... , n-1. using the second operation.

What is the cost to pick index i>=p?

Hint 2After You can pick The index of the first cell on which the ball will fall, let it be index i, then the ball will only hit the cells i, i+k, i+2k, ... until the ball leaves the bar. Do you see the critical question now ?

Hint 3If the ball to start at index i, then it must visit cells at i, i+k, i+2k, ... So, each of those cells must contain a platform. so if a cell does not contain one, you have to place a platform in it!

The question is: given the starting cell i, what is the min number of platforms you have to add?

Can you find a bruteforce to solve it?

Hint 4Bruteforce is easy but not good enough! but there is overlapping subproblems!! so..

Hint 5use simple DP to solve the subproblem for each index. The rest is easy.

Now, you can explore each option of the starting cell p, p+1, ..., n-1, in O(1) This is how I solved it.

i'm new to dp, but why are we going backwards.

What was there in test case 51 of div 2 problem D? Many people got a wrong verdict on that testcase.

11 22 71 92 -> People were trying all subarrays but did not consider this case Most of them got -1 in it but here we can do

11^22-> 29

71^92-> 27

This will give ans 2 :)

Why D is O(n^3) and not TLE??? My own computer TLE

Are you sure the solution you viewed is $$$O(n^3)$$$ ? For that if you check whether the answer is $$$1$$$, the time complexity will become $$$O(n+\log^3 n)$$$ (Update: It is wrong... but $$$n\leq 100$$$ is always held if the answer is greater than $$$1$$$).

https://codeforces.com/contest/1457/submission/99860413 rep(l,1,n-1)rep(r,l+1,n)rep(k,l,r-1) Is this not $$$O(n^3)$$$?

So it means if $$$n>64$$$ the $$$O(n^3)$$$ loop will not be executed.

Thanks, but why when $$$n=64$$$ then answer is $$$1$$$?

if $$$n>64$$$ there must be $$$a_i,a_{i+1},a_{i+2}$$$ with same highest binary bit. Then you can xor $$$a_{i+1},a_{i+2}$$$ and the answer is less than $$$a_i$$$.

Thanks

Amazing

Got stuck on B , such an easy problem

Can anyone tell me why my solution 99882642 is giving Runtime error on pretest 3. I have checked it by giving the input present in pretest 3, and it is giving correct answer.

You are trying to access element s[n].

No, it was not the reason for that runtime error. I have figured out the reason.

https://codeforces.com/contest/1457/submission/99878780

Can you please help me figure out reason behind TLE? IN TC 30/33

Where's the

editorialWhy dont you

watch participant's codewhile waiting : DFrom the announcement:

Have you guys seen anyone going from CM to GM in one contest ? check this

.

have you seen anyone getting this lucky before ?

.

XD XD... I would be grateful if you can show a few of them, LOL

.

Sorry but we can't believe you then, get some facts to support your statement first XD XD.

User : Jerry

Round: #372

Hi, it's my first contest, will I get any rating for it? If yes when? I solved 1 problem so I have some points.

It generally takes anywhere between 2-12 hours to update, doesn't seem like it is an automatic action.

Yeah , just wait for the ratings to get updated, it takes a few hours to atmost half a day(in worst case).

Yes if you submit at least one solution (it doesn't matter be accepted or not) . So usually 3-8 hours after contest the final ratings will be announced.

Thanks guys! I really like this community, so friendly.

()

Can someone provide me a hint for DIV2.C??