Codeforces and Polygon may be unavailable from December 6, 19:00 (UTC) to December 6, 21:00 (UTC) due to technical maintenance. ×

CandidFlakes's blog

By CandidFlakes, history, 16 months ago, In English

I am trying to solve this question. I am facing difficulty in understanding the diagram of test case 2. As far as I have understood this question, the question asks to check whether is it possible to create 180 degree rotated image by changing colour of any possible combination of blocks exactly k times. If we look at the sample test case 2, it's image is

So, it's 180 degree rotated image should look like this

But, in the question the rotated image is give like this

I am unable to understand how is it possible? Please explain the logic behind it.

My next question is that suppose we have n=1. Then the answer should be "YES" if and only if k%2==0, because if we change the colour of the block odd times then the final colour of the only block will be changed (making it impossible to form 180 degree rotated image of the original block). But, I have made submission with this logic and the output was wrong answer. Please correct me where am I thinking wrong?

I will be thankful for any help!

  • Vote: I like it
  • +6
  • Vote: I do not like it

»
16 months ago, # |
  Vote: I like it +5 Vote: I do not like it

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

»
16 months ago, # |
  Vote: I like it +5 Vote: I do not like it

in the second image 3 blocks have been colored as value of k is 3.