Empty Quartz
시간 제한2초메모리 제한1024 MB
길이 N인 0과 1 문자열 가운데 홀수 합을 갖는 부분배열의 개수가 정확히 K인 것의 수를 998244353으로 나눈 나머지를 여러 질의에 대해 구한다.
문제
crystals are aligned in a row. However, some of them may be phantoms.
Jun counted the number of real crystals from -th to -th (closed interval) for every , () pair and recorded their evenness.
His records show that there were intervals that contained an odd number of real crystals. How many possible crystal alignments are there? Answer the remainder divided by .
Note that if there is such that the -th crystal from the left is real on one side and phantom on the other, the two alignments are considered different.
You are given of the above problems. Answer each of them.
입력
출력
Output lines. On the line , answer the problem when , . Add a new line at the end of each line.
제한
- All inputs consist of integers.
힌트
If we denote a real crystal as and an phantom as , the following three alignments satisfy the condition at Sample Input 1.