题意:
把字母当做64进制的数,问你存在多少对这样的数,是的他们位与的结果都等于z。
解法:
因为是位与,所以把这个数的每一位的数分解成6位二进制, 对于1的哪一位,肯定是两个1,因为是与,而如果是0,就会有三种可能,这样一位一位的统计,就是最后答案。
//
// Created by CQU_CST_WuErli
// Copyright (c) 2016 CQU_CST_WuErli. All rights reserved.
//
//#pragma comment(linker, "/STACK:102400000,102400000")
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <algorithm>
#include <sstream>
#define CLR(x) memset(x,0,sizeof(x))
#define OFF(x) memset(x,-1,sizeof(x))
#define MEM(x,a) memset((x),(a),sizeof(x))
#define BUG cout << "I am here" << endl
#define lookln(x) cout << #x << "=" << x << endl
#define SI(a) scanf("%d", &a)
#define SII(a,b) scanf("%d%d", &a, &b)
#define SIII(a,b,c) scanf("%d%d%d", &a, &b, &c)
const int INF_INT=0x3f3f3f3f;
const long long INF_LL=0x7f7f7f7f;
const int MOD=1e9+7;
const double eps=1e-10;
const double pi=acos(-1);
typedef long long ll;
using namespace std;
int mp[300];
string s;
void init() {
int cnt = -1;
for (char i = '0'; i <= '9'; i++) mp[i] = ++cnt;
for (char i = 'A'; i <= 'Z'; i++) mp[i] = ++cnt;
for (char i = 'a'; i <= 'z'; i++) mp[i] = ++cnt;
mp['-'] = ++cnt;
mp['_'] = ++cnt;
}
ll gao(char c) {
int tmp = mp[c];
int a[7];
ll ret = 1;
for (int i = 0; i < 6; i++) {
if (tmp % 2 == 0) ret *= 3;
tmp >>= 1;
}
return ret;
}
int main(int argc, char const *argv[]) {
#ifdef LOCAL
freopen("C:\\Users\\john\\Desktop\\in.txt","r",stdin);
// freopen("C:\\Users\\john\\Desktop\\out.txt","w",stdout);
#endif
init();
while(cin >> s) {
ll ans = 1;
for (int i = 0; i < s.size(); i++) {
// cout << mp[s[i]] << ' ';
ans *= gao(s[i]);
ans %= MOD;
}
printf("%I64d\n", ans);
}
return 0;
}