题目描述
暴力出奇迹
#include<bits/stdc++.h>
using namespace std;
map<string,int>p;
int n,m,s;
string give,collect,name[15];
int main(){
cin>>n;
for(int i=0;i<n;++i) cin>>name[i];
for(int i=0;i<n;++i){
cin>>give>>s>>m;
for(int j=0;j<m;++j){
cin>>collect;
p[give]-=s/m;
p[collect]+=s/m;
}
}
for(int i=0;i<n;++i) cout<<name[i]<<' '<<p[name[i]]<<endl;
return 0;
}