题意:语言翻译,

直接map即可

#include "pch.h"
#include <string>
#include<iostream>
#include<map>
#include<memory.h>
#include<vector> namespace cc
{
using std::cout;
using std::endl;
using std::cin;
using std::map;
using std::vector;
using std::string; constexpr int N = 100000; string eh = "eh"; map<string, string>strMaps;
void solve()
{
string str;
int k = 0;
while (getline(cin, str))
{
if (str.size() == 0)
break;
int index = str.find(" ");
string str1 = str.substr(0,index);
string str2 = str.substr(index+1);
strMaps[str2] = str1;
} using IT = map<string, string>::iterator;
while (getline(cin, str))
{
IT it = strMaps.find(str);
if (it == strMaps.end())
cout << eh << endl;
else
cout << it->second << endl;
} } }; int main()
{ #ifndef ONLINE_JUDGE
freopen("d://1.text", "r", stdin);
#endif // !ONLINE_JUDGE
cc::solve(); return 0;
}

  

uva-10282-枚举的更多相关文章

  1. UVa 12169 (枚举+扩展欧几里得) Disgruntled Judge

    题意: 给出四个数T, a, b, x1,按公式生成序列 xi = (a*xi-1 + b) % 10001 (2 ≤ i ≤ 2T) 给出T和奇数项xi,输出偶数项xi 分析: 最简单的办法就是直接 ...

  2. UVa 140 (枚举排列) Bandwidth

    题意较复杂,请参见原题=_=|| 没什么好说的,直接枚举每个排列就好了,然后记录最小带宽,以及对应的最佳排列. STL里的next_permutation函数真是好用. 比较蛋疼的就是题目的输入了.. ...

  3. UVa 1151 (枚举 + MST) Buy or Build

    题意: 平面上有n个点,现在要把它们全部连通起来.现在有q个套餐,如果购买了第i个套餐,则这个套餐中的点全部连通起来.也可以自己单独地建一条边,费用为两点欧几里得距离的平方.求使所有点连通的最小费用. ...

  4. Even Parity UVA - 11464 (枚举)

    从来没有觉得枚举有多费脑子的.但是这道题还是很香的. 思路:就是非常简单的枚举啦.   从一般的枚举开始考虑.一般的做法就是在所有的格子中有两种状态1, 0. 而一共有225个格子,所有一共要枚举的情 ...

  5. UVa 1354 枚举子集 Mobile Computing

    只要枚举左右两个子天平砝码的集合,我们就能算出左右两个悬挂点到根悬挂点的距离. 但是题中要求找尽量宽的天平但是不能超过房间的宽度,想不到要怎样记录结果. 参考别人代码,用了一个结构体的vector,保 ...

  6. UVA 10282 (13.08.18)

    Problem C: Babelfish You have just moved from Waterloo to a big city. The people here speakan incomp ...

  7. Uva 11754(枚举+中国剩余定理)

    #include<iostream> #include<cstdio> #include<cmath> #include<cstring> #inclu ...

  8. 10年省赛-Greatest Number (二分+暴力) + 12年省赛-Pick apples(DP) + UVA 12325(暴力-2次枚举)

    题意:给你n个数,在里面取4个数,可以重复取数,使和不超过M,求能得到的最大的数是多少: 思路:比赛时,和之前的一个题目很像,一直以为是体积为4(最多选择四次)的完全背包,结果并不是,两两求和,然后二 ...

  9. UVa 10465 Homer Simpson (枚举)

    10465 - Homer Simpson Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onli ...

  10. uva 11825 Hackers&#39; Crackdown (状压dp,子集枚举)

    题目链接:uva 11825 题意: 你是一个黑客,侵入了n台计算机(每台计算机有同样的n种服务),对每台计算机,你能够选择终止一项服务,则他与其相邻的这项服务都终止.你的目标是让很多其它的服务瘫痪( ...

随机推荐

  1. Thinkphp 3.1. 3 ueditor 1.4.3 添加水印

    1.引入Ueditor  <!-- 实例化编辑器 --> <script type="text/javascript"> window.UEDITOR_HO ...

  2. Android 如何让EditText不自动获取焦点 (转)

    在项目中,一进入一个页面, EditText默认就会自动获取焦点. 那么如何取消这个默认行为呢? 在网上找了好久,有点 监听软键盘事件,有点 调用 clearFouse()方法,但是测试了都没有! x ...

  3. Winform 实现无边框窗体移动功能

    #region 窗体移动 [DllImport("user32.dll")] public static extern bool ReleaseCapture(); [DllImp ...

  4. 关于namespace的使用

    #include <string> #include <pcl/io/pcd_io.h> #include <pcl/point_types.h> int main ...

  5. VS中的类模板

    在目录C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ItemTemplates\CSharp\Co ...

  6. elasticsearch 安装(基于java运行环境)

    解压安装包 [root@Aliyun resource]# tar -xvf elasticsearch-5.5.2.tar.gz 添加当前主机的普通账户 [root@Aliyun resource] ...

  7. 学习笔记之Machine Learning by Andrew Ng | Stanford University | Coursera

    Machine Learning by Andrew Ng | Stanford University | Coursera https://www.coursera.org/learn/machin ...

  8. etcd集群部署与遇到的坑(转)

    原文 https://www.cnblogs.com/breg/p/5728237.html etcd集群部署与遇到的坑 在k8s集群中使用了etcd作为数据中心,在实际操作中遇到了一些坑.今天记录一 ...

  9. python urlib2报错gaierror: [Errno 11004] getaddrinfo failed

    gaierror : get address info error,获取网络地址信息错误. url不正确,代理信息配置不正确都会报这个错误. 摘自https://blog.csdn.net/qq_19 ...

  10. docker镜像创建redis5.0.3容器集群

    拉取redis5.0.3镜像 # docker pull daocloud.io/library/redis:5.0.3 [root@localhost ~]# docker pull daoclou ...