303501: CF677C. Vanya and Label
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Vanya and Label
题意翻译
给你一串长度为s的字符串,每个字符对应64以内的数字,请你求出长度与s相等的一对字符串每一位进行&运算后与所给字符串相等的对数,答案可能很大,对1e9+7取模。 数字‘0’~‘9’对应数字0~9; 小写字母‘a’~‘b’对应数字10~35; 大写字母‘A’~‘B’对应数字36~61; 字符‘-’(减号)对应数字62; 字符‘’(下划线)对应数字63; 输入一串只有数字,小写字母,大写字母,‘-’,‘’的字符串(1<=s<=100000) 输出&后等于所给字符串的字符串对数,对1e9+7取模题目描述
While walking down the street Vanya saw a label "Hide&Seek". Because he is a programmer, he used $ & $ as a bitwise AND for these two words represented as a integers in base $ 64 $ and got new word. Now Vanya thinks of some string $ s $ and wants to know the number of pairs of words of length $ |s| $ (length of $ s $ ), such that their bitwise AND is equal to $ s $ . As this number can be large, output it modulo $ 10^{9}+7 $ . To represent the string as a number in numeral system with base $ 64 $ Vanya uses the following rules: - digits from '0' to '9' correspond to integers from $ 0 $ to $ 9 $ ; - letters from 'A' to 'Z' correspond to integers from $ 10 $ to $ 35 $ ; - letters from 'a' to 'z' correspond to integers from $ 36 $ to $ 61 $ ; - letter '-' correspond to integer $ 62 $ ; - letter '\_' correspond to integer $ 63 $ .输入输出格式
输入格式
The only line of the input contains a single word $ s $ ( $ 1<=|s|<=100000 $ ), consisting of digits, lowercase and uppercase English letters, characters '-' and '\_'.
输出格式
Print a single integer — the number of possible pairs of words, such that their bitwise AND is equal to string $ s $ modulo $ 10^{9}+7 $ .
输入输出样例
输入样例 #1
z
输出样例 #1
3
输入样例 #2
V_V
输出样例 #2
9
输入样例 #3
Codeforces
输出样例 #3
130653412