Comments

there might be other errors also

but one i can see is in

cout<<(ll)(power(2,res[i].first,mod)+power(2,res[i].second,mod))<<" ";

you also need to take mod after doing sum. (Did the same mistake :(

Wasn't div2C/div1A a simple wrapper over https://mirror.codeforces.com/contest/1043/problem/F ?

Congrats Mike for winning

If you take all the gcd ending at arr[i] there will be atmost log(n) different gcd possible. So for finding all the gcd ending at (i+1) you can just do gcd(arr[i+1],ending at i) log(n) time.

+5

No it's final, winners will be decided from this round only.

+5

GG

0

Ohh that happened :( the solution I wrote passed in 0.47 seconds so I thought 1 second is enough.

+26

Thanks for participating. I am sorry for the lot of inconvenience during contest, almost all problem setter are new and it was first time they were writing the contest, also we created the contest in hurry to just be inclined with Pragyan timings. So I know there were some problems and inconsistencies in the statements I am really sorry for that, hope will never repeat this again. Apart from this we tried our best to conduct the contest within 5 days with new problem set so hope you enjoyed the contest. Will post the editorials soon.

+5

It's a beginner friendly contest, like ABC.

So for checking if a subarray is good after removing [l,r] you need to count the f(rem) array, for that you can take the contribution of each bit for example if ith bit is set in k subarrays then the contribution will be 2^i*k for finding the number of subarray that has ith bit set you can do is total_subarray-number_of_subarrays_where_ith_bit_is_off. For achieving this you can keep some prefix suffix arrays.

Refer this code for solution: here

PS: Sorry for my alien language :(

For each L you can find the smallest R by binary search and if L,R is good then L,(R+1) is also good.

When can we submit and upsolve problems, like I am unable to submit even after system testing.

Let's say any of x,y is even then y*x^y+x*y^x is also even, and if both are odd then also it's even so whatever you choose x,y the parity of y*x^y+x*y^x is even.

"so after choosing some x and changes a[i] to a[i]+x. The maximum number of all a[i]+x will be at most 2e9 or even less than 2e9"

How you came to this fact?, like x can be upto 10^18.

DFS ? I think you mean BFS

Wait why the infinite loop does not giving TLE, it's cool hack can you explain lill more about running this infinite loop and system rejudge thing.

I tried this approach (just participated virtually now), and it does not work, instead of choosing a random pair I choose a random Y from all multiples of a X, but pretest-5 is evil. :(

First make the sum 999999..., for that you can do b[i]=9-a[i], and check if first digit of b is 0 now, then you can add 11111..2 (n-1 ones and 1 two) in b that will keep sum still palindrome and your b will have same digits as a.

Lewd0
Lewd1
Lewd2
Lewd3

As a problem setter I assure that problems are challenging, sincerely inviting you all to take part.

On liouzhou_101Codeforces Round #700, 5 years ago
+5

worked for me, but still wrong answer on pretest:6

On sobhagyaSDA series sum, 5 years ago
0

Got it, Thank you so much.

On sobhagyaSDA series sum, 5 years ago
0

Auto comment: topic has been updated by sobhagyaSD (previous revision, new revision, compare).

Test cases for problem F were weak, like I just calculate the maximum sum I can get in matrix choosing m/2 element in each row lets call it sum then I print (sum/k)*k , its like greatest multiple of k just smaller then sum, and boom I got AC :). PS:: Later it got hacked (:.