poj 2895 Best SMS to Type 模拟
来源:互联网 发布:淘宝处方药品货到付款 编辑:程序博客网 时间:2024/05/20 12:24
水题,直接贴代码。
//poj 2895//sep9#include <iostream>using namespace std;int map[200][2];char a[1024];int main(){map[' '][0]=1,map[' '][1]=1;map['A'][0]=2,map['A'][1]=1;map['B'][0]=2,map['B'][1]=2;map['C'][0]=2,map['C'][1]=3;map['D'][0]=3,map['D'][1]=1;map['E'][0]=3,map['E'][1]=2;map['F'][0]=3,map['F'][1]=3;map['G'][0]=4,map['G'][1]=1;map['H'][0]=4,map['H'][1]=2;map['I'][0]=4,map['I'][1]=3;map['J'][0]=5,map['J'][1]=1;map['K'][0]=5,map['K'][1]=2;map['L'][0]=5,map['L'][1]=3;map['M'][0]=6,map['M'][1]=1;map['N'][0]=6,map['N'][1]=2;map['O'][0]=6,map['O'][1]=3;map['P'][0]=7,map['P'][1]=1;map['Q'][0]=7,map['Q'][1]=2;map['R'][0]=7,map['R'][1]=3;map['S'][0]=7,map['S'][1]=4;map['T'][0]=8,map['T'][1]=1;map['U'][0]=8,map['U'][1]=2;map['V'][0]=8,map['V'][1]=3;map['W'][0]=9,map['W'][1]=1;map['X'][0]=9,map['X'][1]=2;map['Y'][0]=9,map['Y'][1]=3;map['Z'][0]=9,map['Z'][1]=4;int cases,t1,t2;scanf("%d",&cases);while(cases--){scanf("%d%d",&t1,&t2);getchar();gets(a);int ans=t1*map[a[0]][1];for(int i=1;a[i]!='\0';++i){ans+=t1*map[a[i]][1];if(map[a[i]][0]==map[a[i-1]][0]&&a[i-1]!=' ')ans+=t2;}printf("%d\n",ans);}return 0;}
0 0
- poj 2895 Best SMS to Type 模拟
- POJ 2895 Best SMS to Type 笔记
- POJ 2895 Best SMS to Type 再想想
- Best SMS to Type pku 2895
- BNUOJ Best SMS To Type
- POJ 2895 Best SMS to Type 发送短信的时间计算
- poj 1699 Best<script type=
- POJ 3623 Best Cow Line, Gold(模拟)
- POJ 3623 Best Cow Line, Gold(模拟)
- HDU 2577 How to Type(模拟)
- HDU 2577 How to Type(模拟)
- hdu 2577- How to Type (dp)&&(模拟)
- HDU-2577-How to Type(模拟)
- POJ 3617 Best Cow Line(模拟+贪心)
- HDU 2577 How to Type DP也可以模拟
- hdoj.2577 How to Type【模拟】 2015/07/22
- HDU 2577 How to Type(DP+模拟)
- POJ 2039 TO and Fro(模拟)
- 我为什么要写FansUnion个人官网-BriefCMS-电子商务malling等系统
- 两个CRunTime库排序算法调用,但是更值得注意的”指针“以及“三目”
- Linux系统:当前目录与PATH变量,安全问题
- LeetCode[Tree]: Construct Binary Tree from Inorder and Postorder Traversal
- BNUOJ 44583 Star Trek: First Contact
- poj 2895 Best SMS to Type 模拟
- ubuntu系统下wireshark普通用户抓包设置
- TCP发送源码学习(3)--tcp_transmit_skb
- 我真的很想说出来
- HDU 5115 Dire Wolf (区间DP)
- pkg-config and ldconfig
- BNUOJ 44584 平面切割者
- 距离和相似度度量
- android 为按钮添加响应事件的五种写法