锘??xml version="1.0" encoding="utf-8" standalone="yes"?>
Totalsubmit: 676 Accepted: 426
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.
Input
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.
Output
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
榪欓寰堟按鐨勶紝鐩存帴瀹氫箟涓string綾繪暟緇勶紝鐒跺悗鍐嶄粠鏂囨鏌ユ壘璁板綍灝辮錛岀洿鎺ョ湅浠g爜
Totalsubmit: 1413 Accepted: 326
Description
If a tree falls in the forest, and there's nobody there to hear, does it make a sound? This classic conundrum was coined by George Berkeley (1685-1753), the Bishop and influential Irish philosopher whose primary philosophical achievement is the advancement of what has come to be called subjective idealism. He wrote a number of works, of which the most widely-read are Treatise Concerning the Principles of Human Knowledge (1710) and Three Dialogues between Hylas and Philonous (1713) (Philonous, the "lover of the mind," representing Berkeley himself).
Input
A forest contains T trees numbered from 1 to T and P people numbered from 1 to P. Standard input consists of a line containing P and T followed by several lines, containing a pair of integers i and j, indicating that person i has heard tree j fall. People may have different opinions as to which trees, according to Berkeley, have made a sound.
Input contains multiple test cases. Subsequent test cases are separated with a single blank line.
Output
How many different opinions are represented in the input? Two people hold the same opinion only if they hear exactly the same set of trees. You may assume that P < 100 and T < 100.
Sample Input
3 4
1 2
3 3
1 3
2 2
3 2
2 4
Sample Output
2
Totalsubmit : 165 Accepted : 38
There is a football game between teamX and teamY, we assume the position of the center of football ground is (0, 0),the position of the teamY's goal is(100,0),the position of the teamX's goal is(-100,0).
Now xiaoA in teamX wants to pass the football to his teammate xiaoB, was xiaoB offside(瓚婁綅)錛?/span>
The first line of input contains a positive integer N <= 10, the number of test cases. For each test case there is one line contains 24 number, the first and second number indicate the position of xiaoA, the third and forth number indicate the position of xiaoB, and the remaining numbers indicate the positions of the team members in teamY.
If xiaoB is offside output "Oh, My god!", else output "Come on!"
1
-99 0 99 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0
Oh, My god!
If xiaoA passes the football to xiaoB錛?/span> and there is no members of teamY in front of xiaoB錛?/span>then xiaoB is offside.
榪欓寰堟按錛屼絾瑕佹敞鎰忚秺浣嶈鍒欙紝鍦ㄥ郊鏂瑰崐鍦哄茍涓攛iaob鐨剎鍧愭爣澶т簬褰兼柟鎵鏈夌悆鍛樼殑x鍧愭爣灝辯畻瓚婁綅銆傚彧闇瑕佸垽鏂璽eamY鐨勬墍鏈夐槦鍛樼殑鏈澶鍧愭爣涓巘eamX鐨剎iaoB鐨勫潗鏍囩殑鍏崇郴鍗沖彲銆?/p>
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int ax,ay,bx,by,otherx,othery,max;//鍙橀噺鍙噸澶嶄嬌鐢紝涓嶈繃鎴戣寰楁病蹇呰
int n;
cin>>n;
while(n--)
{
max=0;
cin>>ax>>ay>>bx>>by;
for(int i=0;i<10;i++)//姹傚彇teamy鏈澶х殑X鍧愭爣
{
cin>>otherx>>othery;
if(max<otherx)max=otherx;
}
if(bx>max)cout<<"Oh, My god!"<<endl;
else
cout<<"Come on!"<<endl;
}
//system("PAUSE");
return 0;
}
Totalsubmit : 954 Accepted : 214
xiaoA is a beautiful girl, and she has so many skirts that she won't wear a skirt a second time before the skirt is washed.Now xiaoA wants to go shopping,
how many skirts she can choose to wear.
In order to distinguish these skirts,she gives out every skirt with a unique name.
Input
The first line of input contains a positive integer T (T <= 100), the number of test cases.
Each test case contains two integers N and M (1<=N,M<=100) in the first line.
N is the number of skirts.M is the number of operations.
Then N lines follow.Every line contains a word and the word is not longer than 10.
Then M lines follow.Each line contains a character 'D' or 'W' and the name of a skirt.
'D' indicates that xiaoA has wore the skirt. 'W' indicates that xiaoA has washed the skirt.
Output
After the M operations, you need to output that how many skirts can be chosen by xiaoA to wear.
Sample Input
1
5 5
SkirtA
SkirtB
SkirtC
SkirtD
SkirtE
D SkirtA
D SkirtB
D SkirtC
D SkirtD
W SkirtA
Sample Output
2
姘撮?shù)竴涓?#8230;…錛屾妸鎵鏈塻kirt name璇誨彇鍒頒竴涓猻tring鏁扮粍涓紝鐒跺悗璇誨彇鐘舵侀噺錛屽悓鏃朵笌skirt name鍖歸厤錛屽啀鐢ㄤ竴涓猙ool琛屾暟緇剆tate 璁板綍skirt鐨勫強(qiáng)鏃剁姸鎬併?/p>
Losing Mobile Phone
TimeLimit : 1 Second Memorylimit : 32 Megabyte
Totalsubmit : 1 Accepted : 1
XiaoA has N friends , now he would like to contact his friend N , but unfortunately , he lost his mobile phone, and he can just come up with friend 1 's phone number. Can you tell us whether he can build contact with his friend N.
The first line of input contains a positive integer T <= 100, the number of test cases. For each case , there is an integer N (1<=N<=100) in the first line , means xiaoA has N friends , then follows N lines , in the ith line , there is an integer M first, means xiaoA’s friend i can contact with M xiaoA’s friends , then follows M integers kij , means friend i of xiaoA can contact with xiaoA’s friend kij (1<=i<=N, 1<=j<=M,1<=kij<=N) .
For each test case , print one line "yes" if xiaoA can contact with friend N , or "no" instead.
2
5
1 2
1 3
1 4
1 5
4 1 2 3 4
5
3 2 3 4
3 1 3 4
3 1 2 4
3 1 2 3
4 1 2 3 4
yes
no
鐢ㄩ掑綊鐨勬柟娉曢亶鍘嗘墍鏈塮riends錛屾煡鎵炬槸鍚︿細(xì)鍒拌揪friends N濡傛灉鍒拌揪鍒欐爣璁癟RUE銆?/p>