poj 2503 Babelfish (查找 map)
2013-08-19 20:17
330 查看
题目:http://poj.org/problem?id=2503
不知道为什么 poj 的 数据好像不是100000,跟周赛的不一样
2000MS的代码:
不知道为什么 poj 的 数据好像不是100000,跟周赛的不一样
2000MS的代码:
#include <iostream> #include<cstdio> #include<cstring> #include<cstdlib> #include<stack> #include<queue> #include<iomanip> #include<cmath> #include<algorithm> #include<map> using namespace std; char str[200010][30]; int main() { int i,j; char s1[30]; map<string,int>mp; i=1; while(1) { char t; j=0; if((t=getchar())=='\n') break; str[i][j++]=t; while(1) { t=getchar(); if(t==' ') { str[i][j]='\0'; break; } else str[i][j++]=t; } scanf("%s",s1); mp[s1]=i; i++; getchar(); } while(gets(s1)!=NULL) { if(mp[s1]>=1) printf("%s\n",str[mp[s1]]); else printf("eh\n"); } return 0; }
相关文章推荐
- POJ 2503 Babelfish [map & string]
- poj 2503 Babelfish (map,trie 树)
- POJ 2503 Babelfish(二分查找)
- poj 2503_Babelfish_map
- POJ2503 Babelfish(Map键值对的应用)
- POJ 2503 Babelfish 字典树经典题 三种方法 (map,排序+二分,字典树)
- Poj 2503 Babelfish(Map操作)
- POJ 2503 Babelfish ,map
- Poj 2503 Babelfish(Map操作)
- POJ 2503 Babelfish (Trie树 或 map)
- Babelfish - POJ 2503 map
- POJ 2503 Babelfish(map,字典树,快排+二分,hash)
- POJ 2503 Babelfish(人造字典map)
- POJ 2503-Babelfish(STL-map)
- POJ 2503 Babelfish(map)
- POJ 2503 Babelfish(map,字典树,快排+二分,hash)
- [ACM] [算法基础] POJ 2503 在线翻译Babelfish(二分查找 字符串)
- POJ 2503-Babelfish(map)
- POJ 2503 Babelfish(hash + map)
- poj 2503 Babelfish (map)