BOJ 10815 숫자 카드

1 개요[ | ]

BOJ 10815 숫자 카드


2 C++[ | ]

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

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int N, M, temp, card[500000];
    cin >> N;
    for(int i=0; i<N; i++) {
        cin >> card[i];
    }
    sort(card, card+N);
    cin >> M;
    for(int i=0; i<M; i++) {
        cin >> temp;
        if(binary_search(card, card+N, temp)) cout << "1 ";
        else cout << "0 ";
    }
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}