Problem 1008 Hay Points
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
Sample Output

{
{
;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的更多相关文章
- Hay Points
Hay Points TimeLimit: 1 Second MemoryLimit: 32 Megabyte Totalsubmit: 1022 Accepted: 602 Descript ...
- Problem : 1008 ( Elevator )
好操蛋啊,电梯竟然能原地不动,你大爷的,这逻辑,太弱智了.... Problem : 1008 ( Elevator ) Judge Status : Accepted RunId : 103 ...
- POJ 2403 Hay Points
Hay Points Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 5735 Accepted: 3695 Descri ...
- 题解西电OJ (Problem 1008 - 数星星)
题目内容: Description “不要问我太阳有多高 我会告诉你我有多真 不要问我星星有几颗 我会告诉你很多很多” 一天Qinz和wudired在天上数星星,由于星星可以排列成一条直线,他们比赛看 ...
- HDU contest808 ACM多校第7场 Problem - 1008: Traffic Network in Numazu
首先嘚瑟一下这场比赛的排名:59 (第一次看到这么多 √ emmmm) 好了进入正文QAQ ...这道题啊,思路很清晰啊. 首先你看到树上路径边权和,然后还带修改,不是显然可以想到 树剖+线段树 维护 ...
- 【线段树】Petrozavodsk Summer Training Camp 2016 Day 6: Warsaw U Contest, XVI Open Cup Onsite, Sunday, August 28, 2016 Problem H. Hay
有一些草,一开始高度都是0,它们的生长速率不同. 给你一些单增的日期,在这些日期要将>b的草的部分都割掉,问你每次割掉的部分有多少. 将草的生长速率从大到小排序,这样每次割掉的是一个后缀,而且不 ...
- AtCoder Grand Contest 025 Problem D - Choosing Points
题目大意:输入$n,d1,d2$,你要找到$n^2$个整点 x, y 满足$0 \leqslant x, y<2n$.并且找到的任意两个点距离,既不是$\sqrt{d1}$,也不是 $\sqrt ...
- Poj 2403 Hay Points(Map)
一.题目大意 实现一个工资计算系统.工资的计算规则是:首先,给定一些关键字和对应的价值,这个相对于字典.然后给出的是求职者的描述,如果这个描述中包含关键字则加上对应的价值,总得价值就是这个求职者的工资 ...
- UVa 10295 - Hay Points
题目:有非常多工人.相应一个能力描写叙述表,每种能力有一个权值,求每一个工人的能力值. 分析:字符串.hash表,字典树.利用散列表或者字典树存储相应的单词和权值.查询就可以. 说明:注意初始化,计算 ...
随机推荐
- 镜像树(dfs)
1214: J.镜像树 时间限制: 1 Sec 内存限制: 64 MB提交: 18 解决: 7 标签提交统计讨论版 题目描述 一棵二叉树,若其与自己的镜像完全相同,就称其为镜像树(即这棵二叉树关于 ...
- CentOS6.4x64安装mysql5.6.23(rpm)
#查看已安装的的mysql shell>rpm -qa|grep -i mysql #根据上条命令的结果卸载mysql shell>rpm -e -nodeps mysql* #下载mys ...
- C++ Primer day 01
1.标准输入与输出 #include<iostream> int main(){ int v1,v2; std::cout<<"Enter two numbers:& ...
- C# 语法技巧_三目运算_switch_case
一.三目运算符 三目运算符的一种简便写法: bool b = str == "abc" ? false : true; 当是自身时,实际上别吝啬那一个括号,有一个括号,实际上更容易 ...
- winform datagridview 添加行号。
private void dataGridView_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { private ...
- 开源欣赏wordpress之intall.php
引导式安装 $weblog_title = isset( $_POST['weblog_title'] ) ? trim( wp_unslash( $_POST['weblog_title'] ) ) ...
- vi常用命令笔记
1.Vi 删除全部内容,删除某行到结尾,删除某段内容 (1)转到文件指定行 nG (2)删除所有内容(先用G转到文件尾) ,使用: $G :1,.d (3)删除第9行到第200行的内容(先用200G转 ...
- MD5加密算法(转)
获取字符串的MD5摘要 原文更详细: http://www.weixuehao.com/archives/474 代码如下: import java.security.MessageDigest; p ...
- .NET 4 并行(多核)编程系列之一入门介绍
.NET 4 并行(多核)编程系列之一入门介绍 本系列文章将会对.NET 4中的并行编程技术(也称之为多核编程技术)以及应用作全面的介绍. 本篇文章的议题如下: 1. 并行编程和多线程编程的区别. ...
- Ruby中,&:(ampersand colon)的用法
前几日看Ruby代码,发现一个奇怪的用法,如下: a=['a', 'b', 'c'].map! &:upcase p a #["A", "B", &qu ...