题目:
代码部分:
import java.io.*;
import java.util.StringTokenizer;
public class Main{
private static PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
static class Kattio extends PrintWriter {
private BufferedReader r;
private StringTokenizer st;
public Kattio() { this(System.in, System.out); }
public Kattio(InputStream i, OutputStream o) {
super(o);
r = new BufferedReader(new InputStreamReader(i));
}
public String next() {
try {
while (st == null || !st.hasMoreTokens())
st = new StringTokenizer(r.readLine());
return st.nextToken();
} catch (Exception e) {}
return null;
}
public int nextInt() { return Integer.parseInt(next()); }
}
public static void main(String[] args){
Kattio sc = new Kattio();
int n=sc.nextInt();
int[] a = new int[n];
String[] b = new String[n];
String str;
int num1;
for(int i=0;i<n;i++){
str = sc.next();
num1 = sc.nextInt()-1;
a[num1]=sc.nextInt();
b[num1]=str;
}
int m=sc.nextInt();
int p=0;
for(int i=0;i<m;i++){
p=sc.nextInt()-1;
// System.out.println(b[p]+" "+a[p]);
pw.println(b[p]+" "+a[p]);
pw.flush();
}
}
}