M. Make Cents?

题目描述

Every year, an elephant qualifies to the Arab Collegiate Programming Competition. He graduated this year, but that’s irrelephant. What’s important is that the location of the competition might not have been the same every year. Therefore, after every trip, he always has leftover money in the currency of the country he visited.

Now he wants to see how much Jordanian Dinars he has after all those competitions. Can you help him convert the leftover money from all competitions to Jordanian Dinar, if that makes any cents?

输入

The first line of input is T – the number of test cases.

The first line of each test case contains C and N (1 ≤ C, N ≤ 100000), the number of currency types and the number of competitions, respectively.

The next C lines each contain the name of the currency Ci of maximum length 10 in lowercase and/or uppercase letters, and the value Vi of that currency in Jordanian Dinar (0 < Vi ≤ 1000). The names are case-sensitive.

The next N lines each contains an amount left over from each competition (0 ≤ Ni ≤ 1000), and the name of the currency of that amount (it is guaranteed that the name was either given in the input or is “JD”).

输出

For each test case, print on a single line the total amount of money he has in Jordanian Dinar(JD) rounded to 6 decimal digits.

样例

inputCopy
1
3 5
dollar 0.71
euro 0.76
turkish 0.17
5.1 dollar
6 dollar
7 turkish
3 euro
1.1 JD
outputCopy
12.451000

题意

用map维护一下就可以了QAQ

AC代码

GYM 101350 M. Make Cents? ( STL相关推荐

  1. C++ 笔记(19)— 标准模板库(STL容器、STL迭代器、STL算法、STL容器特点、STL字符串类)

    C++ 标准库可以分为两部分: 标准函数库: 这个库是由通用的.独立的.不属于任何类的函数组成的.函数库继承自 C 语言. 面向对象类库: 这个库是类及其相关函数的集合. C++ 标准库包含了所有的 ...

  2. 【常用技巧】标准模板库(STL)

    [常用技巧]标准模板库(STL) 在前几个章节中我们已经使用了诸如队列.堆.堆栈.vector 等标准模板库中的模板,切身感受到了它给我们带来的极大便利.在本节中,我们还要介绍两种标准模板--stri ...

  3. 实验8.3 C++标准模板库(STL)中的双向队列类(deque)

    题目 使用C++标准模板库(STL)中的双向队列类(deque)重新实现上一小题. C++代码如下: #include <iostream> #include <deque> ...

  4. 标准模板库(STL)之 map 列传 (二)

    标准模板库(STL)之 map 列传 map 容器的遍历 修改 key or value 实用的成员函数 下标 vs at map 容器的遍历 使用 range-based for 循环访问 map ...

  5. 标准模板库(STL)之 vector 列传 (二)

    标准模板库(STL)之 vector 列传 两种搭配 vector 为空的判断 所能容纳的数据类型 push_back 一个新元素 resize 的两个重载 clear的含义 两个 vector 的相 ...

  6. c++ 的 stl模板库_C ++中的标准模板库(STL)

    c++ 的 stl模板库 Standard Template Library (STL) is a collection of standard C++ template classes. It co ...

  7. R语言用LOESS(局部加权回归)季节趋势分解(STL)进行时间序列异常检测

    全文下载链接:http://tecdat.cn/?p=22632 这篇文章描述了一种对涉及季节性和趋势成分的时间序列的异常点进行建模的方法. 相关视频 我们将对一种叫做STL的算法进行研究,STL是 ...

  8. PCL 从 CAD模型(STL,OBJ) 采样得到点云 (renderViewTesselatedSphere 函数详解)

    利用PCL点云库从CAD模型(stl,obj格式)采样得到点云(pcd,ply格式)有两种方式: 1. 整体点云采样,包括原来CAD模型各个面(可能会包含从外面看不到的内部结构),用的是 pcl_me ...

  9. C++的标准库和C++的标准模板库(STL)

    https://www.cnblogs.com/jpfss/p/10025771.html C++强大的功能来源于其丰富的类库及库函数资源.C++标准库的内容总共在50个标准头文件中定义.在C++开发 ...

  10. C++——类模板库(STL)

    类模板库的定义 1.类模板库(STL) 2.类模板的定义 3.类模板实例化 4.类模板的成员函数 5.类模板的静态数据成员 关于模板的更多的内容,参见以下链接: C++--成员模板 C++--友元模板 ...

最新文章

  1. Oracle中不同条件的日期查询
  2. 定时发送服务器运行数据并设置阀值警报方法
  3. Python生成器与迭代器详细教程
  4. 聚类分析(Clustering Analysis)
  5. 卷积网络和卷积神经网络_卷积神经网络的眼病识别
  6. 编译py-faster-rcnn全过程
  7. 选择分集matlab程序,瑞利衰落信道下采用MRC分集误码性能Matlab程序
  8. c++ 智能指针auto_ptr (c++98)、shared_ptr(c++ 11)、unique_ptr(c++ 11)、weak_ptr(c++ 11)
  9. 数学建模专栏 | 第十一篇:MATLAB CUMCM真题求解实例二:优化型
  10. MSC-51单片机原理与实践——第四章习题及答案解析
  11. 离散数学知识点总结(6):自然推理系统;13 个推理规则; 如何使用推理规则
  12. 几款主流快速开发平台比较
  13. surface pro 7 linux,微软正式发布Surface Pro 7
  14. 计算机演奏喀秋莎教程,微课制作之喀秋莎演示教学.doc
  15. C# 开发企业订货系统构架,手机版本订货/订单系统
  16. Java8 Signature探秘
  17. Java学习路线图(2020最新版)
  18. 《GitHub入门与实践》第4章 通过实际操作学习Git 基本操作——学习笔记
  19. ubuntu18.04下优盘存在只读问题
  20. SEO网站结构优化详解

热门文章

  1. 同步回调与异步回调的实现与学习
  2. Servlet请求与响应
  3. HTML Typo.css 中文网页重设与排版
  4. 概率论—期末复习速成笔记(自用)
  5. 构造Dominator Tree以及Dominator Frontier
  6. dns劫持如何完美修复?dns被劫持如何解决如何完美修复
  7. 【7gyy】教你快速对异常错误进行更正
  8. widows安装wxPython
  9. 《计算机工程》从投稿到录用之一手经验
  10. 如何VUE写桌面应用(electron)