ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#211817 | #2103. 生日礼物 | badn | Judgement Failed | / | / | C++11 | 389b | 2024-10-06 11:42:16 | 2024-10-06 11:42:19 |
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
map<string,ll> mp;
int n,k,w[10001],wt;
string c,v[10001];
long long ans;
int main(){
cin>>n>>k;
for(int i=1;i<=n;++i)cin>>v[i]>>w[i];
while(k--)cin>>c>>wt,mp[c]=wt+1;
for(int i=1;i<=n;++i){
if(mp[v[i]])ans+=(mp[v[i]]-1)*1ll*w[i];
else return cout<<("Unknow"),0;
}
cout<<ans<<endl;
return 0;
}
Details
Failed to show details