Solved.ac Class3++
public class Main {
public static void main(String[] args) throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder();
String[] counts = br.readLine().split(" ");
int dataSize = Integer.parseInt(counts[0]);
int askSize = Integer.parseInt(counts[1]);
Map<String, String> values = new HashMap<>();
for (int i = 0; i < dataSize; i++) {
String[] data = br.readLine().split(" ");
values.put(data[0], data[1]);
}
for (int i = 0; i < askSize; i++) {
sb.append(values.get(br.readLine())).append("\n");
}
System.out.println(sb);
}
}
성공
fun main() {
val sb = StringBuilder()
val counts = readln().split(" ")
val dataSize = counts[0].toInt()
val askSize = counts[1].toInt()
val values: HashMap<String, String> = HashMap()
for (i in 0..<dataSize) {
val data = readln().split(" ")
values.put(data[0], data[1])
}
for (i in 0..<askSize) {
sb.append(values.get(readln())).append("\n")
}
print(sb)
}