codeforces 883 F. Lost in Transliteration
来源:互联网 发布:twemproxy 源码解析 编辑:程序博客网 时间:2024/06/02 00:13
这是一个大水题,为什么要写他呢,因为我用错了一个string的方法,写下来提醒下自己。
string 如果定义了s=“”;那么s就是等于空了,如果想加入值 s+=“1”,如果直接写s[0]=‘1’;就等于没写
#include<bits/stdc++.h>using namespace std;map<string ,int>mp;int main(){int n,ans=0;cin>>n;string s,s1,s2;while(n--){ cin>>s; s1=""; for(int i=0;i<s.length();i++) { if(s[i]=='u'){s1+="oo";continue;} if(s[i]=='h'){ int len=s1.length(); len--; while(s1[len]=='k') len--; s2=""; //cout<<s1[len]<<" 12311"<<endl; for(int j=0;j<=len;j++) s2+=s1[j];//开始s2[j]=s1[j]错了 s2+='h'; s1=s2; continue;} s1+=s[i]; } // cout<<s1<<endl; if(mp[s1]==0)ans++,mp[s1]++;}cout<<ans<<endl; return 0;}
阅读全文
0 0
- codeforces 883 F. Lost in Transliteration
- codeforces F. Lost in Transliteration
- codeforces 883F. Lost in Transliteration (字符串处理)
- Codeforces883F-Lost in Transliteration
- 2017-2018 ACM-ICPC, NEERC, Southern Subregional Contest F. Lost in Transliteration
- Codeforces 845F Guards In The Storehouse
- codeforces 566F F. Clique in the Divisibility Graph(dp)
- lost in 2012
- Lost in the City
- Lost in the City
- Codeforces 659F F
- Codeforces 566 F. Clique in the Divisibility Graph
- codeforces 566F. Clique in the Divisibility Graph dp
- Codeforces All-Ukrainian School Olympiad in Informatics F.Tourist
- CodeForces Gym 100989F Mission in Amman (A)
- #1094 : Lost in the City
- #1094 Lost in the City
- #1094 : Lost in the City
- 抽屉效果的tableview功能组件:PYScalableTableView
- JSP登录界面(连接并验证数据库)
- 考试技巧篇
- spring管理bean的原理
- quick3.3listview-button刷新失效问题
- codeforces 883 F. Lost in Transliteration
- 欢迎使用CSDN-markdown编辑器
- 针对第3方合进来的插件或者sdk,一些测试体验
- 彻底解决 根级别上的数据无效 行1 位置1
- Git和SVN的区别
- Spring管理Bean的三种创建方式
- Xshell连接不上阿里云报错:connection failed的解决方案
- ssm框架
- PHP中基本排序算法