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