Comments

I am not able to find what's wrong in this solution for E, can somebody help :) 177207734

Did anyone else also thought that the lid can be moved more than once in Problem C :")

On AmirrzwMCodeforces Global Round 23, 4 years ago
0

Wrong Ans on test case 46, what? :( 176324763

For C1: Firstly count the number of all possible pairs i.e. n+nC2. Now we subtract the pair which is not possible. In the equation max(0,i-a[i]-q)*(n-i+1), max(0,i-a[i]-q) represents the no of options of choosing the left l and (n-i+1) represents the no of right choices. Here to avoid re-counting q is used which represents all the left before q are already chosen.

+4

Take an example a = {4,2,4}. Let the array b={b1,b2,b3,b4}. since gcd(b1,b2)=4, b2 is a multiple of 4 and since gcd(b3,b4)=4, b3 is a multiple of 4. Therefore the greatest common divisor of b2 and b3 will be a multiple of gcd(4,4)=4 (i.e. a[i] must be a multiple of gcd(a[i-1],a[i+1])). We cannot construct the array when it is not a multiple.

(sorry for any language mistakes :))

+4

Check out my precise solutions for A,B and C1: A: 175371876 B: 175384691 C1: 175422140

Thanks!

Can anyone please check why my code is failing on pretest 3 173225741

Did Problem D just 15 seconds after the contest :(