ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#211814 | #2103. 生日礼物 | badn | Judgement Failed | / | / | C++11 | 294b | 2024-10-06 11:32:50 | 2024-10-06 11:32:53 |
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;
}
详细
Failed to show details