CF1205 problem solution

B

Have the highest \ (64 \) bit, when the \ (n \ le 128 \) , the worst case can not form three-membered ring, \ (Floyed \) violence do

Otherwise, direct output \ (3 \)

C

Meaning of the title \ (n-\) are odd, provided \ ((I, J) \) , the \ (i + j \) is even called even cells, the other for Cottage

According to \ ((1,1) \) we can determine all the even grid, and then set \ ((1,2) \) to any value, we can draw Cottage is relatively answers

Next only to determine a Cottage, you can launch all Cottage

Since \ (n \) is an odd number, so we will be able to find a square of length 3, and the upper-left corner for the \ (1 \) , the lower right corner to \ (0 \)

And \ ((1,1) - (1,2) - (2,2) - (2,3) \) and \ ((1,2) - (2,2) - (2,3) - ( 3,3) \) there is an exclusive oR and \ (0 \)
query on the path end points, if the same end to end, constituting the certain palindrome; palindromic constitute if, given the different inclusive

Guess you like

Origin www.cnblogs.com/y2823774827y/p/11506512.html