Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class scorify {
- public static void main(String[] args){
- Scanner in=new Scanner(System.in);
- int N=Integer.valueOf(in.next());
- for(int i=0;i<N;i++){
- int p=Integer.valueOf(in.next());
- String[] s=new String[p];
- String[] t=new String[p];;
- for(int j=0;j<p;j++){
- s[j]= in.next();
- t[j]=in.next();
- }
- int pe=Integer.valueOf(in.next());
- String[] c=new String[pe];
- for(int k=0;k<pe;k++){
- c[k]=in.next();
- }
- for(int j=0;j<p;j++){
- int comp=0;
- for(int k=0;k<pe;k++){
- String se="";
- se=c[k];
- se=se.substring(0,t[j].length());
- if(se.equals(t[j])) comp++;
- }
- System.out.print("|"+s[j]+":"+comp);
- }
- System.out.println();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement