美文网首页
Gym - 101350M (map初次用)

Gym - 101350M (map初次用)

作者: Alan66 | 来源:发表于2017-07-12 18:20 被阅读0次
#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<map>
#include<algorithm>
using namespace std;

map<string,double> mp;
int main()
{
    int T;
    scanf("%d",&T);

    while (T--) {
        int C,N;
        scanf("%d%d",&C,&N);
        string c;
        double v;
        for(int i = 0;i < C;i++){
            cin >> c;
            scanf("%lf",&v);
            mp[c] = v;
        }
        mp["JD"]=1;
        string name;
        double sum = 0,num;
        for(int i = 0;i < N;i++){
            scanf("%lf",&num);
            cin >> name;
            sum += mp[name]*num;
        }

        printf("%.6lf\n",sum);
    }
    return 0;
}

相关文章

  • Gym - 101350M (map初次用)

  • Gym gym

    自从加入新的健身房之后,坚持一周三次上不同的力量训练和举铁高强度课,还尝试了拳击课和打击棍子的pound;四个星期...

  • Python Package:OpenAI Gym通俗理解和简单

    OpenAI Gym 为了做实验,发现有文章用OpenAI gym去做些小游戏的控制,主要是为了研究RL的算法,逐...

  • 微信小程序之map组件初体验

    此文为笔者初次尝试map组件后的学习笔记,由于笔者功力有限,如有不足,还望指教 参考资料:map组件map组件相关...

  • Fastlane - gym

    认识Xcodebuild命令 gym概述: 使用方法: fastlane gym fastlane gym --w...

  • map

    map,取key用map.keySet().取value用map.get(key).

  • OpenAI Gym介绍及安装

    OpenAI Gym学习求助,安装openai gym all老是出错?

  • 15/70 豆苗写作:My gym class

    Every Monday evening I have a gym class at the Little Gym...

  • 鞋带鞋带

    想标题很头疼,还是直接用日期。 晚上去gym,本来打算锻炼一个多小时,然而去了趟超市到gym晚了点,最最最重要的是...

  • fastjson

    1、JSONObject:json对象 属性:Map map,键值对实际存在该map中 方法: 实际用map的方...

网友评论

      本文标题:Gym - 101350M (map初次用)

      本文链接:https://www.haomeiwen.com/subject/rczbhxtx.html