cgy12306

[백준 BoJ] 17219 - 비밀번호 찾기 본문

Algorithm/C++

[백준 BoJ] 17219 - 비밀번호 찾기

cgy12306 2021. 6. 30. 14:50
// https://www.acmicpc.net/problem/17219
// 비밀번호 찾기

#include<iostream>
#include<string>
#include<map>
#include<algorithm>
using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);

	int N, M;
	string id, pw;

	map<string, string> account;
	
	cin >> N >> M;

	for (int i = 0; i < N; i++) {
		cin >> id >> pw;
		account[id] = pw;
	}

	for (int i = 0; i < M; i++) {
		string site;
		cin >> site;
		cout << account[site] << "\n";
	}
}

Map

'Algorithm > C++' 카테고리의 다른 글

[백준 BoJ] 7569 - 토마토  (0) 2021.06.30
[백준 BoJ] 7576 - 토마토  (0) 2021.06.30
[백준 BoJ] 17626 - Four Squares  (0) 2021.06.30
[백준 BoJ] 1012 - 유기농 배추  (0) 2021.06.30
[백준 BoJ] 2606 - 바이러스  (0) 2021.06.29
Comments