Meaning of the questions:
A matrix structure, so that from the top left to the bottom right corner of the actual maximum ratio provided the title \ (DP \) method Big \ (K \) .
analysis:
Such that \ (DP \) maximum value is determined \ (0 \) , for the practical maximum \ (K \) .
For the matrix:
According to the title of \ (DP \) approach,
\ (A_} = max {2,2 & \ A_ {1,1} {\ & A_ {1,2} \} & 2,2 & A_ {\, \ A_. 1 { , 1} \ & a_ {2,1
} \ & a_ {2,2} \} \) matrix is constructed:
There are: \ (A_ {2,2 &} = max \ {(X \ bigoplus K) \ & X, (X \ bigoplus K) \ & K \} \)
and also because there are: \ ((X \ bigoplus K) \ & X \ & k = 0 \)
be modified on the basis of the original matrix:
So we want the \ ((the X-\ bigoplus k) \ & the X-> (the X-\ bigoplus k) \ & k \) , in order to ensure press (dp \) \ The results obtained to practice \ (0 \) .
So \ (x \) values is very critical. \ (X \) should be taken than \ (k_ {max} \) is large and is \ (2 \) is an integer power, such as \ (2 ^ {17} \) .
So \ (DP \) maximum value is acquired \ ((x \ bigoplus k)
\ & x \ & k = 0 \) practical maximum of \ ((X ^ K) \ & K = K \) .
The final matrix is:
Code:
C++:
#include <bits/stdc++.h>
using namespace std;
int main()
{
int k;
scanf("%d",&k);
printf("2 3\n");
int x=1<<17;
printf("%d %d %d\n",x^k,x,0);
printf("%d %d %d\n",k,x^k,k);
return 0;
}
python:
k=int(input())
print("2 3\n")
x=1<<17
print(x^k,x,0)
print(k,x^k,k)