Problem Description

Each employee of a bureaucracy has a job description - a few paragraphs that describe the responsibilities of the job. The employee's job description, combined with other factors, such as seniority, is used to determine his or her salary.

The Hay Point system frees the Human Resources department from having to make an intelligent judgement as to the value of the employee; the job description is merely scanned for words and phrases that indicate responsibility. In particular, job descriptions that indicate control over a large budget or management over a large number of people yield high Hay Point scores.

You are to implement a simplified Hay Point system. You will be given a Hay Point dictionary and a number of job descriptions. For each job description you are to compute the salary associated with the job, according to the system.

The first line of input contains 2 positive integers: m <= 1000, the number of words in the Hay Point dictionary, and n <= 100, the number of job descriptions. m lines follow; each contains a word (a string of up to 16 lower-case letters) and a dollar value (a real number between 0 and 1,000,000). Following the dictionary are the n job descriptions. Each job description consists of one or more lines of text; for your convenience the text has been converted to lower case and has no characters other than letters, numbers, and spaces. Each job description is terminated by a line containing a period.

For each job description, output the corresponding salary computed as the sum of the Hay Point values for all words that appear in the description. Words that do not appear in the dictionary have a value of 0.

Sample Input

7 2 administer 100000 spending 200000 manage 50000 responsibility 25000 expertise 100 skill 50 money 75000 the incumbent will administer the spending of kindergarden milk money and exercise responsibility for making change he or she will share responsibility for the task of managing the money with the assistant whose skill and expertise shall ensure the successful spending exercise . this individual must have the skill to perform a heart transplant and expertise in rocket science .

Sample Output

700150
150
 
题目比较简单,但对于我这种英语渣渣来说太痛苦了,连看带猜在加上样例终于把题意搞懂了,就是每个单词对应一个数字,在一大堆单词里找到有多少个和那些单词相等,加上他们相应的数字就行,so easy!

];
 {
                    {
           ;i<=n;i++)
           cin>>k[i].s>>k[i].p;
           sum=;
           ;i<=m;i++)
           {
                              {
                     ;j<=n;j++)
                                          sum+=k[j].p;
               }
               cout <<sum<<endl;
               sum=;
           }
     }
     ;
 }

Problem 1008 Hay Points的更多相关文章

  1. Hay Points

    Hay Points TimeLimit: 1 Second   MemoryLimit: 32 Megabyte Totalsubmit: 1022   Accepted: 602 Descript ...

  2. Problem : 1008 ( Elevator )

    好操蛋啊,电梯竟然能原地不动,你大爷的,这逻辑,太弱智了.... Problem : 1008 ( Elevator )     Judge Status : Accepted RunId : 103 ...

  3. POJ 2403 Hay Points

    Hay Points Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 5735   Accepted: 3695 Descri ...

  4. 题解西电OJ (Problem 1008 - 数星星)

    题目内容: Description “不要问我太阳有多高 我会告诉你我有多真 不要问我星星有几颗 我会告诉你很多很多” 一天Qinz和wudired在天上数星星,由于星星可以排列成一条直线,他们比赛看 ...

  5. HDU contest808 ACM多校第7场 Problem - 1008: Traffic Network in Numazu

    首先嘚瑟一下这场比赛的排名:59 (第一次看到这么多 √ emmmm) 好了进入正文QAQ ...这道题啊,思路很清晰啊. 首先你看到树上路径边权和,然后还带修改,不是显然可以想到 树剖+线段树 维护 ...

  6. 【线段树】Petrozavodsk Summer Training Camp 2016 Day 6: Warsaw U Contest, XVI Open Cup Onsite, Sunday, August 28, 2016 Problem H. Hay

    有一些草,一开始高度都是0,它们的生长速率不同. 给你一些单增的日期,在这些日期要将>b的草的部分都割掉,问你每次割掉的部分有多少. 将草的生长速率从大到小排序,这样每次割掉的是一个后缀,而且不 ...

  7. AtCoder Grand Contest 025 Problem D - Choosing Points

    题目大意:输入$n,d1,d2$,你要找到$n^2$个整点 x, y 满足$0 \leqslant x, y<2n$.并且找到的任意两个点距离,既不是$\sqrt{d1}$,也不是 $\sqrt ...

  8. Poj 2403 Hay Points(Map)

    一.题目大意 实现一个工资计算系统.工资的计算规则是:首先,给定一些关键字和对应的价值,这个相对于字典.然后给出的是求职者的描述,如果这个描述中包含关键字则加上对应的价值,总得价值就是这个求职者的工资 ...

  9. UVa 10295 - Hay Points

    题目:有非常多工人.相应一个能力描写叙述表,每种能力有一个权值,求每一个工人的能力值. 分析:字符串.hash表,字典树.利用散列表或者字典树存储相应的单词和权值.查询就可以. 说明:注意初始化,计算 ...

随机推荐

  1. 话说 MAX_FILE_SIZE

    PHP关于文件上传部分,特别提到表单隐藏域:MAX_FILE_SIZE,意思是接收文件的最大尺寸.文档中给出的例子如下: <form enctype="multipart/form-d ...

  2. js编程风格

    1.缩进层级,建议四个空格. 2.语句结尾使用分号. 3.行的长度不超过80个字符. 4.换行建议加两个缩进,即8个空格. 5.合理的利用空行. 6.命名: 6.1 变量,驼峰式大小写,有小写字母开始 ...

  3. DOT + graphviz 轻松画图

    一.简介DOT & graphviz1. DOT    DOT是一种文本图形描述语言.DOT语言文件通常具有.gv或是.dot的文件扩展名.当然,在编写好.dot或者.gv的文件之后,需要有专 ...

  4. BC 65 ZYB's Premutation (线段树+二分搜索)

    题目简述:有一个全排列,一直每个前缀区间的逆序对数,还原这个排列. fi记录逆序对数,pi记录该位置数值,则k=fi-f(i-1)表示前i-1个数比pi大的数的个数,那么只要在剩余元素求出按大小顺序第 ...

  5. 利用raspberry pi搭建typecho笔记(二) sqlite和typecho部署

    sqlite概述 typecho可以支持MYSQL和Sqlite两种数据库,因为Sqlite更为轻量,并且不需要额外的进程,而是直接对数据库文件进行读取,所以配置相对于MySQL也更为简单,仅需指定数 ...

  6. Android 中常用代码片段

    一:AsyncTask 的使用 (1)activity_main.xml <TextView android:id="@+id/tvInfo" android:layout_ ...

  7. js加载优化-二

    http://www.cnblogs.com/radom/archive/2011/04/26/2028886.html ontrolJS 主要为了是解决网页加载中Js文件的性能问题,ControlJ ...

  8. eMMC的MMC模式与SPI模式

    MMC存贮卡可以分为MMC和SPI两种工作模式,MMC模式是标准的默认模式,具有MMC的全部特性.而SPI模式则是MMC存贮卡可选的第二种模式,这个模式是MMC协议的一个子集,主要用于只需要小数量的卡 ...

  9. Keil中如何消除UNCALLED SEGMENT,IGNORED FOR OVERLAY PROCESS警告

    在Keil C中,如果没有显式调用到定义过的函数,就会出现这样的的警告.当出现这样的警告时,可以不用管,因为不影响其它部分.但是,我们知道,即使没有调用这个函数,Keil仍然把它编译连接进整个程序,不 ...

  10. awk 处理

    find . -type f | awk '{print $NF}' | grep pdf$ |grep -v preview | while read A; do ls -ltr $A| awk ' ...