记录编号 |
15153 |
评测结果 |
AAAAAAAAAA |
题目名称 |
查字典 |
最终得分 |
100 |
用户昵称 |
Hamster |
是否通过 |
通过 |
代码语言 |
Pascal |
运行时间 |
1.830 s |
提交时间 |
2009-11-10 15:44:49 |
内存使用 |
64.58 MiB |
显示代码纯文本
- program scanword;
- var
- a:array['a'..'z',1..10000]of string;
- n:array['a'..'z',1..10000]of longint;
- m:array['a'..'z']of longint;
- i,j,nn,mm,k,q:longint;
- s:string;
- aaa:char;
- begin
- assign(input,'scanword.in');
- assign(output,'scanword.out');
- reset(input); rewrite(output);
-
- readln(nn);
-
- for aaa:='a' to 'z' do begin
- for j:=1 to nn do a[aaa,j]:='';
- end;
- fillchar(n,sizeof(n),0);
- fillchar(m,sizeof(m),0);
- for i:=1 to nn do
- begin
- readln(s);
- readln(k);
- inc(m[s[1]]);
- a[s[1],m[s[1]]]:=s;
- n[s[1],m[s[1]]]:=k;
- end;
- readln(mm);
- for i:=1 to mm do begin
- readln(s);
- for j:=1 to m[s[1]] do if a[s[1],j]=s then writeln(n[s[1],j]);
- end;
-
- close(input);
- close(output);
- end.