Комментарии
На Vladik → Codeforces Round #678 (Div. 2). Editorial, 6 лет назад
0

Yes I got it now. Thanks btw

На Vladik → Codeforces Round #678 (Div. 2). Editorial, 6 лет назад
0

The answer will be 0 for those cases.

На Vladik → Codeforces Round #678 (Div. 2). Editorial, 6 лет назад
0

I think even if you break the loop, the if statement below will take care of that.

На Vladik → Codeforces Round #678 (Div. 2). Editorial, 6 лет назад
0

You answer is failing on the 10th test case i.e for "3 3 1" your answer is 2 which I believe is correct as "1 3 2" and "2 3 1" are valid permutation. I don't know why they are showing 0 as output.

На Vladik → Codeforces Round #678 (Div. 2). Editorial, 6 лет назад
+1

Can you tell me the answer for input "3 3 1", the output shown is 0 but "1 3 2" and "2 3 1" are valid permutations.

На Vladik → Codeforces Round #678 (Div. 2). Editorial, 6 лет назад
0

I think they have made some mistake. Since middle element can be found in a single step, "1 3 2" and "2 3 1" should be valid permutations.

На Vladik → Codeforces Round #678 (Div. 2). Editorial, 6 лет назад
+4

Even if you break the loop, the if statement below will take care of that.

For input 3 3 1, answer should be 2.

0

The first question can be done in constant time using the fact that if n is odd then a=x, b=x-1 where x=floor(n/2) and if n is even and x is also even, then a=x-1 and b=x+1 and if n is even and x is odd then a=x-2 and b=x+2.

На vovuh → Codeforces Round #605 (Div. 3), 7 лет назад
0

Same here. I solved 1st and 3rd question on paper within few minutes and when I clicked submit button after writing the code on their editor, connection failed and page could not reload for about an hour. After some time the issue resolved but after submitting solution of 1st question, same thing happened again