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; }
相关文章推荐
- HDFS常用命令列表
- Linux下的Tomcat+Maven+Jenkins+Github环境的搭建
- Swift学习第九枪之SQLite的使用
- linux文件授权粗解
- poj 1698(最大流)
- getch(),getche(),getchar()的区别
- mysql:java程序向mysql中插入数据的中文乱码
- Maven插件(plugin)goal的执行与生命周期(lifecycle)phase的关系
- js模拟点击事件实现代码
- HDU-5714-拍照(区间线段覆盖)
- 【C++】 ofstream列对齐和设置小数点精度
- 【java并发】线程并发库的使用
- sql语句中----删除表数据drop、truncate和delete的用法
- 第 1 章 jQuery EasyUI 入门
- 《校园封神榜》第二阶段个人工作总结——第十天
- redis安装,检测redis是否安装成功以及配置redis密码
- 2011年以来发表文章一览表
- linux----目录介绍
- linux下sed命令对文件执行文本替换
- SVN分支的合并和同步