fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. int a,b,c;
  6. map<string, int>mp;
  7. cin>>a>>b;
  8. string ss,s;
  9. for(int i=0;i<a;i++)
  10. {
  11. cin>>ss>>c;
  12. mp[ss]=c;
  13. }
  14. for(int i=0;i<b;i++)
  15. {
  16. long long sum=0;
  17. for(int j=0;;j++)
  18. {
  19. cin>>s;
  20. if(s==".")break;
  21. sum+=mp[s];
  22. }
  23. cout<<sum<<endl;
  24. }
  25. return 0;
  26. }
  27.  
Success #stdin #stdout 0s 4488KB
stdin
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
.
stdout
700150
150