题目链接:http://codeforces.com/contest/677/problem/C
题意:给一个字符和数字的映射关系,然后再给一个字符串。问有多少个其他的字符串,使得那些字符串之间相互操作:每一个字符相与的结果不变。
这题给了一组映射关系,由于只有64个字符,那也就是说明只用到了6个bit位。如果这个字符串中某个字符与另一个字符串的同一位的字符相与结果想要不变,举个例子:
字符串s中有一个字符的数字映射是101010,那对应的字符的结果应当是1X1X1X,X有可能是1&0、0&1、0&0,所以遇到一个X就有三种情况,那么这个例子里有3个X,也就是3^3种情况。推广一下就是有k个X,那就有3^k个。
/*
━━━━━┒ギリギリ♂ eye!
┓┏┓┏┓┃キリキリ♂ mind!
┛┗┛┗┛┃\○/
┓┏┓┏┓┃ /
┛┗┛┗┛┃ノ)
┓┏┓┏┓┃
┛┗┛┗┛┃
┓┏┓┏┓┃
┛┗┛┗┛┃
┓┏┓┏┓┃
┛┗┛┗┛┃
┓┏┓┏┓┃
┃┃┃┃┃┃
┻┻┻┻┻┻
*/
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <climits>
#include <complex>
#include <fstream>
#include <cassert>
#include <cstdio>
#include <bitset>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <ctime>
#include <set>
#include <map>
#include <cmath>
using namespace std;
#define fr first
#define sc second
#define cl clear
#define BUG puts("here!!!")
#define W(a) while(a--)
#define pb(a) push_back(a)
#define Rlf(a) scanf("%lf", &a);
#define Rint(a) scanf("%d", &a)
#define Rll(a) scanf("%I64d", &a)
#define Rs(a) scanf("%s", a)
#define Cin(a) cin >> a
#define FRead() freopen("in", "r", stdin)
#define FWrite() freopen("out", "w", stdout)
#define Rep(i, len) for(int i = 0; i < (len); i++)
#define For(i, a, len) for(int i = (a); i < (len); i++)
#define Cls(a) memset((a), 0, sizeof(a))
#define Clr(a, x) memset((a), (x), sizeof(a))
#define Full(a) memset((a), 0x7f7f, sizeof(a))
#define lrt rt << 1
#define rrt rt << 1 | 1
#define pi 3.14159265359
#define RT return
#define lowbit(x) x & (-x)
#define onenum(x) __builtin_popcount(x)
typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;
typedef pair<int, int> pii;
typedef pair<string, int> psi;
typedef map<string, int> msi;
typedef vector<int> vi;
typedef vector<LL> vl;
typedef vector<vl> vvl;
typedef vector<bool> vb; const int maxn = ;
const int mod = ;
int cv[];
char s[maxn]; int quickmul(int x, int n) {
int ret = , t = x;
while(t) {
if(n & ) ret = (ret * t) % mod;
t = t * t % mod;
n >>= ;
}
return ret;
} int main() {
// FRead();
Rep(i, ) cv[''+i] = i;
For(i, , ) cv['A'+i-] = i;
For(i, , ) cv['a'+i-] = i;
cv['-'] = ; cv['_'] = ;
while(~Rs(s)) {
int n = strlen(s);
LL ret = ;
Rep(i, n) {
int p = cv[s[i]];
int t = - __builtin_popcount(p);
ret = (ret * quickmul(, t)) % mod;
}
printf("I64d\n", ret);
}
RT ;
}