"BOJ 10816 숫자 카드 2"의 두 판 사이의 차이

 
1번째 줄: 1번째 줄:
==개요==
==개요==
{{BOJ|단계=14}}
{{BOJ|단계=14}}
{{BOJ|단계=27}}


==C++==
==C++==

2023년 10월 23일 (월) 20:32 기준 최신판

1 개요[ | ]

BOJ 10816 숫자 카드 2


BOJ 10816 숫자 카드 2


2 C++[ | ]

#include <bits/stdc++.h>
using namespace std;

int N, M, i, temp;
map<int, int> m;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    cin >> N;
    for(i=0; i<N; i++) {
        cin >> temp;
        if (m.find(temp) == m.end()) m[temp] = 0;
        m[temp]++;
    }
    cin >> M;
    for(i=0; i<M; i++) {
        cin >> temp;
        cout << m[temp] << ' ';
    }
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}