Hamming
시간 제한25초메모리 제한1024 MB
이진 문자열의 길이 k 부분수열 모든 쌍에 대해 해밍 거리의 합을 각 k마다 40961로 나눈 나머지를 구한다.
문제
You are given a binary string of length . Compute the sum of pairwise Hamming distances between all subsequences of string with length exactly for all from to . Since the answers can be very large, find them modulo .
Hamming distance between two strings of equal length is the number of positions in which these two strings are different.
입력
The only line of input contains a string of length () containing only characters "0" and "1".
출력
Print numbers: -th of them must be the sum of pairwise Hamming distances between all subsequences of string with length exactly , taken modulo .