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 ...
随机推荐
- ADO.NET 中可以发送包含多个SQL语句的批处理脚本到SQL Server,但是用MySQL的ODBC驱动不行
众所周知,我们在ADO.NET中可以使用NuGet包System.Data.SqlClient来操作SQL Server,并且ADO.NET是支持向SQL Server发送包含多个SQL语句的批处理脚 ...
- Docker镜像存储-overlayfs
一.概述 Docker中的镜像采用分层构建设计,每个层可以称之为“layer”,这些layer被存放在了/var/lib/docker/<storage-driver>/目录下,这里的st ...
- ML.NET 示例:推荐之One Class 矩阵分解
写在前面 准备近期将微软的machinelearning-samples翻译成中文,水平有限,如有错漏,请大家多多指正. 如果有朋友对此感兴趣,可以加入我:https://github.com/fei ...
- Java面试MySQL的一些问题
MySQL InnoDB存储的文件结构 索引树是如何维护的? 数据库自增主键可能的问题
- Lambda表达式介绍(转)
刚开始学lambda,lambda与linq的联合使用. Lambda表达式实际上是一个匿名函数.它包含表达式和语句,常用于创建委托或表达式目录树类型.所有Lambda表达式都是用Lambda运算符- ...
- linux screen 工具
一.背景 系统管理员经常需要SSH 或者telent 远程登录到Linux 服务器,经常运行一些需要很长时间才能完成的任务,比如系统备份.ftp 传输等等.通常情况下我们都是为每一个这样的任务开一个远 ...
- Django Rest framework基础使用之 serializer
rest-framework文档地址:http://www.django-rest-framework.org/ Django Rest framework是一个非常强大且灵活的工具包,用于构建web ...
- Appium-超过60s的应用场景如何处理
前言: 最近在搞appium自动化项目,遇到超过60s的应用场景时,总是报错报错.如何解决呢?见下文. 报错信息: 2018-05-21 14:03:42:253 - [HTTP] <-- PO ...
- 剑指Offer-- 翻转链表 (python版)
输入一个链表,反转链表后,输出链表的所有元素. # -*- coding:utf-8 -*- # class ListNode: # def __init__(self, x): # self.val ...
- session与cookie的区别以及HTML5中WebStorage理解
一.session与cookie的区别 二.HTML5中WebStorage理解 WebStorage的目的是克服由cookie所带来的一些限制,当数据需要被严格控制在客户端时,不需要持续的将数据发回 ...