Advertisement
Guest User

Untitled

a guest
May 19th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.48 KB | None | 0 0
  1. using A=System.Collections.ArrayList;using C=System.Console;using F=System.String;class P{static void Main(){System.Func<F> r=()=>C.ReadLine();r();var w=new System.Collections.Hashtable();int i=int.Parse(r());for(;i-->0;){int x=0;F y=r();foreach(char c in y)x=x*10+(c<97?1:c<115?(c-97)/3+2:c>118?9:c>115?8:7);try{w.Add(x,new A());}catch{}((A)w[x]).Add(y);}for(i=int.Parse(r());i-->0;)try{C.WriteLine(F.Join(", ",(F[])((A)w[int.Parse(r())]).ToArray(typeof(F))));}catch{C.WriteLine("-");}}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement