RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
COCI00304

Hash

Unrated 레이팅 미적용
난이도
1s
시간 제한
256MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

\(6^{th}\) round, March \(8^{th}\), 2014

Little Mirko is studying the hash function which associates numerical values to words. The function is
defined recursively in the following way:
• f( empty word ) = 0
• f( wo\(rd + le\)tter ) = ( ( f( word ) * 33 ) XOR ord( letter ) ) % MOD
The function is defined for words that consist of only lowercase letters of the English alphabet. XOR
stands for the bitwise XOR operator (i.e. 0110 XOR \(1010 = 1100\)), ord(letter) stands for the ordinal
number of the letter in the alphabet (ord(a) = 1, ord(z) = 26) and A % B stands for the remainder of
the number A when performing integer division with the number B. MOD will be an integer of the
form \(2^{M}\).
Some values of the hash function when \(M = 10\):
• f( a ) = 1
• f ( aa ) = 32
• f ( kit ) = 438
Mirko wants to find out how many words of the length N there are with the hash value K. Write a
programme to help him calculate this number.

제약

In test cases worth 30% of total points, N will not exceed 5.
Additionally, in test cases worth 60% of total points, M will not exceed 15.

입력 형식

The first line of input contains three integers N, K and M (\(1 \le N \le 10\), \(0 \le K < 2^{M}\), \(6 \le M \le 25\)).

출력 형식

The first and only line of output must consist of the required number from the task.

예제 1
입력
1 0 10
출력
0
예제 2
입력
1 2 10
출력
1
예제 3
입력
3 16 10
출력
4
설명

Clarification of the first example: None of the characters in the alphabet has an ord value 0.
Clarification of the second example: It is the word “b”.
Clarification of the third example: Those are the words “dxl”, “hph”, “lxd” and “xpx”.

문제 정보

생성자가 기록되지 않았습니다.

출처 COCI 2013/2014 Contest 6

평가 및 의견

Hash

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

Hash

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8