Baekjoon #14425

Baekjoon #14425

3개의 풀이 · C++, Go, Python

문제 원문 보기 ↗

SOLUTION INFO

C++ · main.cpp

main.cpp
#include<bits/stdc++.h>

using namespace std;

unordered_set<string> st;

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

    int N, M; cin >> N >> M;
    for(int i=0;i<N;i++) {
        string s; cin >> s;
        st.insert(s);
    }
    
    int answer = 0;
    for(int i=0;i<M;i++){
        string s; cin >> s;
        if(st.find(s) != st.end()) answer ++;
    }
    cout << answer;

    return 0;
}

SOLUTION DESCRIPTION

풀이 설명

등록된 풀이 설명이 없습니다.