ABC126-F : XOR Matching 작성일 2019-05-25 https://atcoder.jp/contests/abc126/tasks/abc126_f 0부터 $2^M-1$까지 xor하면 0이 된다는 것을 이용한 수학문제. 솔직히 풀이를 딱 알아야만 하기 때문에 노잼.. 12345678910111213141516171819202122232425#include <cstdio> class Problem { int M, K; public: Problem() { scanf("%d %d", &M, &K); } void solve() { int bound = 1 << M; if (K >= bound || (K == 1 && M == 1)) printf("-1"); else if (K == 0 && M == 1) printf("0 0 1 1"); else { printf("%d ", K); for(int i = 0; i < bound; i++) { if(i == K) continue; printf("%d ", i); } printf("%d ", K); for(int i = bound-1; i >= 0; i--) { if(i == K) continue; printf("%d ", i); } } } };