记录编号 |
358606 |
评测结果 |
AAAAAAAAAA |
题目名称 |
查字典 |
最终得分 |
100 |
用户昵称 |
kZime |
是否通过 |
通过 |
代码语言 |
C++ |
运行时间 |
0.374 s |
提交时间 |
2016-12-17 12:54:16 |
内存使用 |
0.31 MiB |
显示代码纯文本
- #include<iostream>
- #include<cstdio>
- #include<map>
- #include<string>
- #include<cstring>
- using namespace std;
- string word;
- map<string,int>mp;
- int n,m,x;
- void read(){
- scanf("%d",&n);
- for(int i=0;i<n;i++){
- cin>>word>>x;
- mp[word]=x;
- }
- }
- void solve(){
- scanf("%d",&m);
- for(int i=0;i<m;i++){
- cin>>word;
- printf("%d",mp[word]);
- }
- }
- int main(){
- freopen("scanword.in","r",stdin);
- freopen("scanword.out","w",stdout);
- read();
- solve();
- }