Even and Odd Combinations
시간 제한2초메모리 제한1024 MB
n이 1부터 50일 때 짝수 크기 부분집합과 홀수 크기 부분집합 사이의 전단사 함수를 만들고, 주어진 부분집합에 대응하는 부분집합을 출력한다.
문제
Let a -combination out of be a -element subset of the -element set . To denote a combination, list its elements in ascending order. For example, -combinations out of look as follows: , , .
Let a combination be even if the number of its elements is an even number, and odd otherwise. For a fixed , consider two sets: , the set of all even combinations out of , and , the set of all odd combinations out of . It can be shown that and contain the same number of combinations.
For each , your task is as follows. Construct any bijection (a one-to-one correspondence) between the sets and . After that, given an element of one of these sets, print the corresponding element of the other set.