ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#211811 | #2103. 生日礼物 | badn | Judgement Failed | / | / | C++ | 303b | 2024-10-06 11:26:36 | 2024-10-06 11:26:38 |
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
map<string,ll> mp;
int n,k,w;
string c;
unsigned 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