您的位置:首页 > 其它

Codeforces 677 C Vanya and Label

2016-06-02 21:17 274 查看
按位考虑大水题,,感觉没有什么好说的。。还是看代码吧

#include<cstdio>
#include<cctype>
#include<cassert>
#include<algorithm>
using namespace std;
#define LL long long
const int mod = 1000000007;

int cove(char c){
if(isdigit(c)) return c-'0';
if(isupper(c)) return c-'A'+10;
if(islower(c)) return c-'a'+36;
if(c == '-') return 62;
if(c == '_') return 63;
return -1;
}

LL getpair(int x){
assert(x != -1);
LL ret = 1;
for(int i=0;i<6;i++){
if(!(x&1))
(ret *= 3) %= mod;
x>>=1;
}
return ret;
}

char arr[112345];

int main(){
LL ans = 1;
scanf("%s",arr);
for(int i=0;arr[i];i++){
(ans *= getpair(cove(arr[i]))) %= mod;
}
printf("%I64d\n",ans);
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: