@alei sounds good since I am curious if manipulation of the whole block of bits in a single pass wasn’t enough optimization, what was.
Yeah I missed that K=1 for the final subtask and @apptica already pointed that out to me.
I would say its a coincidence because if N would have been smaller my approach would have failed. But any incidence matrix of this sort has this inherent property that the 1s do not form a rectangle and that is what we needed for this question. Since the whole matrix has this property, it wasn’t likely that its subset won’t have it as well. The only question was of satisfaction of 8N criteria, which I checked at N = 100.
@sapjv You can also use cout << setprecision(10) << n/2.0; as the setprecision function removes the error caused due to double.
You live real THUG LIFE!
I don’t know where is the editorial of may long challenge? Please help me to find the link.
Quite pathetic that some people always ask for solutions on StackOverflow and try to climb rating that way: https://cs.stackexchange.com/questions/109000/how-do-we-place-8n-objects-in-a-grid-of-size-n-times-n I don’t know what’s the point doing stuff this way.
How the stackers and some people here are able to solve it so fast…I have given a lot of time to this question still did not got anything on time…Is the finite projections solution so obvious?..i have not even heard of it…any good tutorials for it??..
not published yet…
same i am thiking !
No bro no… The obvious solution is this one… In the first column, place rooks at co-ordinates:-1,4,7…47 … Then for the second column, add 1 to previous co-ordinates and hence, the problem is over
Link to my solution:-https://www.codechef.com/viewsolution/24244089
@thesmartguy read this. Its the same question and more than 2 years old. My guess is this is why a lot of people knew about this approach.
Here is the unofficial editorial:-Unofficial Editorial for ADAROOKS2-MAY-2019-LONG-CHALLENGE