Skip to content

Commit

Permalink
Create S4_1620
Browse files Browse the repository at this point in the history
  • Loading branch information
RangKoon authored Jul 18, 2024
1 parent b1455aa commit 7ea4847
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions 진민혁/S4_1620
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import java.util.*;
import java.io.*;

public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] input = br.readLine().split(" ");
int n = Integer.parseInt(input[0]);
int m = Integer.parseInt(input[1]);
HashMap<String,String> map = new HashMap<>();

for(int i=1; i<=n; i++) {
String s1 = Integer.toString(i);
String s2 = br.readLine();
map.put(s1, s2);
map.put(s2, s1);
}
StringBuilder sb = new StringBuilder();
for(int i=0; i<m; i++) {
String str = br.readLine();
sb.append(map.get(str) + "\n");
}
System.out.println(sb);
}
}

0 comments on commit 7ea4847

Please sign in to comment.