C. Vanya and Label
time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

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 109 + 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.
Input

The only line of the input contains a single word s (1 ≤ |s| ≤ 100 000), consisting of digits, lowercase and uppercase English letters, characters '-' and '_'.

Output

Print a single integer — the number of possible pairs of words, such that their bitwise AND is equal to string s modulo 109 + 7.

Examples
input
z
output
3
input
V_V
output
9
input
Codeforces
output
130653412
思路:打表得到并之后的种数;
#include<bits/stdc++.h>
using namespace std;
#define ll __int64
#define mod 1000000007
#define inf 999999999
#define pi (4*atan(1.0))
const int N=1e2+,M=1e5+;
ll flag[N];
ll getnumber(char a)
{
if(a=='-')
return ;
if(a=='_')
return ;
if(a>=''&&a<='')
return a-'';
if(a>='a'&&a<='z')
return a-'a'+;
if(a>='A'&&a<='Z')
return a-'A'+;
}
char a[];
int main()
{
ll x,y,z,i,t;
for(i=;i<=;i++)
for(t=;t<=;t++)
{
ll gg=(i&t);
if(gg<)
flag[gg]++;
}
scanf("%s",a);
x=strlen(a);
ll ans=;
for(i=;i<x;i++)
{
ans*=flag[getnumber(a[i])];
ans%=mod;
}
printf("%I64d\n",ans);
return ;
}

codeforces 355 div2 C. Vanya and Label 水题的更多相关文章

  1. Codeforces Round #355 (Div. 2) C. Vanya and Label 水题

    C. Vanya and Label 题目连接: http://www.codeforces.com/contest/677/problem/C Description While walking d ...

  2. Codeforces Round #355 (Div. 2) A. Vanya and Fence 水题

    A. Vanya and Fence 题目连接: http://www.codeforces.com/contest/677/problem/A Description Vanya and his f ...

  3. codeforces 677A A. Vanya and Fence(水题)

    题目链接: A. Vanya and Fence time limit per test 1 second memory limit per test 256 megabytes input stan ...

  4. codeforces Gym 100187L L. Ministry of Truth 水题

    L. Ministry of Truth Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100187/p ...

  5. Codeforces Round #185 (Div. 2) B. Archer 水题

    B. Archer Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/312/problem/B D ...

  6. Educational Codeforces Round 14 A. Fashion in Berland 水题

    A. Fashion in Berland 题目连接: http://www.codeforces.com/contest/691/problem/A Description According to ...

  7. Codeforces Round #360 (Div. 2) A. Opponents 水题

    A. Opponents 题目连接: http://www.codeforces.com/contest/688/problem/A Description Arya has n opponents ...

  8. Codeforces Round #190 (Div. 2) 水果俩水题

    后天考试,今天做题,我真佩服自己... 这次又只A俩水题... orz各路神犇... 话说这次模拟题挺多... 半个多小时把前面俩水题做完,然后卡C,和往常一样,题目看懂做不出来... A: 算是模拟 ...

  9. Codeforces Round #256 (Div. 2/A)/Codeforces448A_Rewards(水题)解题报告

    对于这道水题本人觉得应该应用贪心算法来解这道题: 下面就贴出本人的代码吧: #include<cstdio> #include<iostream> using namespac ...

随机推荐

  1. Android屏幕适配和文字屏幕适配

    http://blog.sina.com.cn/s/blog_9996c67e0101euwd.html 最近在一个项目中要实现屏幕适配平板和手机等不同的型号,而蛋疼的美工给了一套图,而且这些图纸有在 ...

  2. 310实验室 Linux 软件安装常见问题

    电脑装好Linux系统后,系统默认安装软件不齐,需要自己根据自己的需要安装一些列工具软件,在linux系统中,用的最多的就是Synaptic Package Manager,什么是Synaptic?新 ...

  3. jQuery Ajax 全解析(转载)

    本文地址: jQuery Ajax 全解析 本文作者:QLeelulu 转载请标明出处! jQuery确实是一个挺好的轻量级的JS框架,能帮助我们快速的开发JS应用,并在一定程度上改变了我们写Java ...

  4. MP3 ID3信息编辑器(附源码)

    练习WPF时写的编辑MP3 ID3信息的小工具,方便对歌曲的统一管理,同时增加了调用豆瓣音乐API获取专辑信息的功能:1.主界面: 2.没有ID3 信息的MP3歌曲: 3.点击自动获取,从豆瓣音乐获取 ...

  5. Optimal Milking---poj2112(多重匹配+Floyd+二分)

    题目链接:http://poj.org/problem?id=2112 题意:K个挤奶器(编号1~K),每个挤奶器每天最多供M头奶牛.共有C头奶牛(编号K+1~K+C).挤奶器和奶牛间有不同长度的路. ...

  6. centos Linux系统日常管理1 cpuinfo cpu核数 命令 w, vmstat, uptime ,top ,kill ,ps ,free,netstat ,sar, ulimit ,lsof ,pidof 第十四节课

    centos Linux系统日常管理1  cpuinfo cpu核数   命令 w, vmstat, uptime ,top ,kill ,ps ,free,netstat ,sar, ulimit ...

  7. Docker学习笔记(一):在本地安装和配置Docker

      由于公司里测试服务器时常会有变动,每次变动之后都需要在新的服务器上配置一遍环境,实在是麻烦.后来我突然想到了在网上看到的资料中说Docker能快速部署可移植的容器,所以我就试着用Docker搭建了 ...

  8. 20155305乔磊2016-2017-2《Java程序设计》第九周学习总结

    20155305 2016-2017-2 <Java程序设计>第九周学习总结 教材学习内容总结 JDBC入门 JDBC简介 1.JDBC是java联机数据库的标准规范,它定义了一组标准类与 ...

  9. springcloud13---zuul

    Zuul:API  GATEWAY (服务网关): http://blog.daocloud.io/microservices-2/ 一个客户端不同的功能请求不同的微服务,那么客户端要知道所有微服务的 ...

  10. 【知识总结】Activiti工作流学习入门

    1. 我理解的工作流: 在工作中慢慢接触的业务流程,就向流程控制语言一样,一步一步都对应的不同的业务,但整体串联起来就是一个完整的业务.而且实际工作中尤其是在企业内部系统的研发中,确实需要对应许多审批 ...