题目:http://poj.org/problem?id=2503

不知道为什么 poj  的 数据好像不是100000,跟周赛的不一样

2000MS的代码:

  1. #include <iostream>
  2. #include<cstdio>
  3. #include<cstring>
  4. #include<cstdlib>
  5. #include<stack>
  6. #include<queue>
  7. #include<iomanip>
  8. #include<cmath>
  9. #include<algorithm>
  10. #include<map>
  11. using namespace std;
  12.  
  13. char str[][];
  14. int main()
  15. {
  16. int i,j;
  17. char s1[];
  18. map<string,int>mp;
  19. i=;
  20. while()
  21. {
  22. char t; j=;
  23. if((t=getchar())=='\n')
  24. break;
  25. str[i][j++]=t;
  26. while()
  27. {
  28. t=getchar();
  29. if(t==' ')
  30. {
  31. str[i][j]='\0';
  32. break;
  33. }
  34. else
  35. str[i][j++]=t;
  36. }
  37. scanf("%s",s1);
  38. mp[s1]=i;
  39. i++;
  40. getchar();
  41. }
  42. while(gets(s1)!=NULL)
  43. {
  44. if(mp[s1]>=)
  45. printf("%s\n",str[mp[s1]]);
  46. else
  47. printf("eh\n");
  48. }
  49. return ;
  50. }

poj 2503 Babelfish (查找 map)的更多相关文章

  1. POJ 2503 Babelfish(map,字典树,快排+二分,hash)

    题意:先构造一个词典,然后输入外文单词,输出相应的英语单词. 这道题有4种方法可以做: 1.map 2.字典树 3.快排+二分 4.hash表 参考博客:[解题报告]POJ_2503 字典树,MAP ...

  2. 题解报告:poj 2503 Babelfish(map)

    Description You have just moved from Waterloo to a big city. The people here speak an incomprehensib ...

  3. poj 2503 Babelfish(Map、Hash、字典树)

    题目链接:http://poj.org/bbs?problem_id=2503 思路分析: 题目数据数据量为10^5, 为查找问题,使用Hash或Map等查找树可以解决,也可以使用字典树查找. 代码( ...

  4. Poj 2503 Babelfish(Map操作)

    一.Description You have just moved from Waterloo to a big city. The people here speak an incomprehens ...

  5. poj 2503 Babelfish(字典树或map或哈希或排序二分)

    输入若干组对应关系,然后输入应该单词,输出对应的单词,如果没有对应的输出eh 此题的做法非常多,很多人用了字典树,还有有用hash的,也有用了排序加二分的(感觉这种方法时间效率最差了),这里我参考了M ...

  6. poj 2503:Babelfish(字典树,经典题,字典翻译)

    Babelfish Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 30816   Accepted: 13283 Descr ...

  7. poj 2503 Babelfish(字典树或着STL)

    Babelfish Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 35828   Accepted: 15320 Descr ...

  8. poj 2503 哈希 Map 字典树

    Babelfish Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 36967   Accepted: 15749 Descr ...

  9. POJ 2503 Babelfish

    Babelfish Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 28766 Accepted: 12407 Descripti ...

随机推荐

  1. 判断IE版本的语句 [if lte IE 6]...[endif]

    <!–[if lte IE 6]>……<![endif]–>Ite:less than or equal to意思是小于或等于IE6浏览器,用于IE浏览器的条件注释,常用于CS ...

  2. 定时备份服务器数据库(借助windows任务计划以及mysqldump)

    最近社区多了,考虑到数据的安全性,要每天备份一次数据库,以防万一: linux目前还不是很了解,先用windows的计划任务吧: 大体思路就是 借用windows的计划任务来执行备份远程数据库到本地: ...

  3. zencart后台增加菜单选项

    如果要在程序中使用额外的参数,在后台控制,添加到菜单属性 在后台 SQL脚本 运行如下 SQL语句 INSERT INTO configuration (configuration_title, co ...

  4. xaml中绑定单例属性

    在项目中经常会遇到,同一个字典表绑定到多个ItemsControl上的情况,可以在单例中创建一个List,xaml上绑定即可.看代码: 1,XAML <Grid> <StackPan ...

  5. C# asp Aspose.Cells 教程,包含增加勾选框,单元格,字体设置

    1,引用Aspose.Cells  dll 2,using Aspose.Cells; 3, Workbook excel = new Workbook(); string strFilePath = ...

  6. Group 原则

    select 后面的所有劣种,没有使用聚合函数的列,必须出现在 group by 后面,比如下面的例子 insert into #temp_move2 ) from #temp_move group ...

  7. NSInvocation的使用(转)

    转载自:http://www.cnblogs.com/pengyingh/articles/2359199.html http://blog.iosxcode4.com/?p=125 在 iOS中可以 ...

  8. Jquery实现自动提示下拉框

    1.引入脚本库:     <script type="text/javascript" src="/Jscripts/jquery-1.3.2.js"&g ...

  9. HTML网页中添加音频视频动画...(转)

    在网页中适当嵌入音频和视频能够充分显示网页的多媒体特性,特别是随着宽带网的普及,使得网络广播和网络视频成为现实,网页音频和视频的重要性也日益突显.具体来说,网页音频和视频的嵌入方法主要有三种: 一.b ...

  10. SSH开发框架搭建参考

    一, 参考文章: 1, http://blog.csdn.net/communicate_/article/details/8644040 这篇文章讲的还算详尽,但是貌似有一些多余的代码: 2,