-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathI041.java
More file actions
31 lines (28 loc) · 960 Bytes
/
I041.java
File metadata and controls
31 lines (28 loc) · 960 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package levelB;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class I041 {
public static void main(String[] args) throws Exception{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int N=Integer.parseInt(br.readLine());
String[] id=new String[N];
String[] shiji=new String[N];
String[] kaoshi=new String[N];
for(int i=0;i<N;i++){
String[] str=br.readLine().split(" ");
id[i]=str[0];
shiji[i]=str[1];
kaoshi[i]=str[2];
}
int M=Integer.parseInt(br.readLine());
String[] compare=br.readLine().split(" ");
for(int i=0;i<M;i++){
for(int j=0;j<N;j++){
if(compare[i].equals(shiji[j])){
System.out.println(id[j]+" "+kaoshi[j]);
break;
}
}
}
}
}