gym-101350M
题意:给你一堆货币汇率,再给你一堆货币,算下值多少钱;
思路:直接map搞定;
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<map>
using namespace std;
int main()
{
int n,c;
int t;
char s[];
double ans,temp;
scanf("%d",&t);
while(t--)
{
map<string,double>money;
ans=;
scanf("%d%d",&c,&n);
for(int i=;i<c;i++)
{
scanf("%s",s);
scanf("%lf",&temp);
money[s]=temp;
}
money["JD"]=;
for(int i=;i<n;i++)
{
scanf("%lf",&temp);
scanf("%s",s);
ans=ans+money[s]*temp;
}
printf("%.6lf\n",ans);
}
return ;
}
gym-101350M的更多相关文章
- stl应用(map)或字典树(有点东西)
M - Violet Snow Gym - 101350M Every year, an elephant qualifies to the Arab Collegiate Programming C ...
- ACM: Gym 101047M Removing coins in Kem Kadrãn - 暴力
Gym 101047M Removing coins in Kem Kadrãn Time Limit:2000MS Memory Limit:65536KB 64bit IO Fo ...
- ACM: Gym 101047K Training with Phuket's larvae - 思维题
Gym 101047K Training with Phuket's larvae Time Limit:2000MS Memory Limit:65536KB 64bit IO F ...
- ACM: Gym 101047E Escape from Ayutthaya - BFS
Gym 101047E Escape from Ayutthaya Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I6 ...
- ACM: Gym 101047B Renzo and the palindromic decoration - 手速题
Gym 101047B Renzo and the palindromic decoration Time Limit:2000MS Memory Limit:65536KB 64 ...
- Gym 101102J---Divisible Numbers(反推技巧题)
题目链接 http://codeforces.com/gym/101102/problem/J Description standard input/output You are given an a ...
- Gym 100917J---Judgement(01背包+bitset)
题目链接 http://codeforces.com/gym/100917/problem/J Description standard input/outputStatements The jury ...
- Gym 100917J---dir -C(RMQ--ST)
题目链接 http://codeforces.com/gym/100917/problem/D problem description Famous Berland coder and IT mana ...
- Gym 101102D---Rectangles(单调栈)
题目链接 http://codeforces.com/gym/101102/problem/D problem description Given an R×C grid with each cel ...
- Gym 101102C---Bored Judge(区间最大值)
题目链接 http://codeforces.com/gym/101102/problem/C problem description Judge Bahosain was bored at ACM ...
随机推荐
- 蓝牙LMP概述
LMP 全称是Link Manager Protocol,我们还是要一张图,说明LMP 在哪里? 他是在HCI 以下,baseband 以上,实现在蓝牙控制器中. 按照协议规范,我们分几个部分来分别介 ...
- 基于注解处理器开发自动生成getter和setter方法的插件
昨天无意中,逛到了lombok的网站,并看到了首页的5分钟视频,视频中的作者只是在实体类中写了几个字段,就可以自动编译为含setter.getter.toString()等方法的class文件.看着挺 ...
- Typescript 发布到npm
https://blog.csdn.net/yiershan1314/article/details/79999726 https://cloud.tencent.com/developer/arti ...
- 自建 Gitlab (邮箱配置、拆分 PostgreSQL、Redis) + 随想
前言 最近折腾了一番自建 gitlab,在此做个记录,供君参考.整个构建过程基于 Docker Swarm(近期有计划将微服务移植到 Kubernetes,但还没倒腾顺手,暂时先沿用旧的方案),主题配 ...
- linux screen 工具
一.背景 系统管理员经常需要SSH 或者telent 远程登录到Linux 服务器,经常运行一些需要很长时间才能完成的任务,比如系统备份.ftp 传输等等.通常情况下我们都是为每一个这样的任务开一个远 ...
- JS 有趣的JS
一. var arr = []; for (var i = 0; i < 3; i++) { arr[i] = function() { console.log(i+'__') // 3 3 3 ...
- Mysql MyISAM与InnoDB 表锁行锁以及分库分表优化
一. 两种存储引擎:MyISAM与InnoDB 区别与作用 1. count运算上的区别: 因为MyISAM缓存有表meta-data(行数等),因此在做COUNT(*)时对于一个结构很好的查询是不需 ...
- NET操作RabbitMQ组件EasyNetQ
NET操作RabbitMQ组件EasyNetQ使用中文简版文档. 本文出自EasyNetQ官方文档,内容为自己理解加翻译.文档地址:https://github.com/EasyNetQ/EasyNe ...
- Git文件冲突的常用解决方法
在提交代码时,偶尔会有文件冲突的情况,当出现: Please, commit your changes or stash them before you can merge. 提示后,可用依次输入下列 ...
- 福州大学软件工程1816 | W班 第7次作业成绩排名
写在前面 汇总成绩排名链接 1.作业链接 第七次作业--项目需求分析(团队) 2.评分准则 本次作业映射总分为100分+贡献度得分,由以下部分组成: 引言(5 points) . 用户场景(15 po ...