11 lines
355 B
TypeScript
11 lines
355 B
TypeScript
export {};
|
|
const input:string[] = require("fs").readFileSync(0, "utf8").toString().trim().split('\n');
|
|
const [N, M] = input[0].split(" ").map(Number);
|
|
const keychain = new Map<string, string>();
|
|
input.slice(1,N+1).forEach(v => {
|
|
const [a,b] = v.split(' ');
|
|
keychain.set(a,b);
|
|
});
|
|
input.slice(N+1).forEach(v=>{
|
|
console.log(keychain.get(v));
|
|
}); |