본문 바로가기
Algorithm

Codeup 1430: 기억력 테스트 2

by Edward Agape Kim 2023. 11. 9.
#include <iostream>

using namespace std;

int n, m, tmp1, tmp2;
bool inp[10001000];

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	
	cin >> n;
	for(int i=0; i<n; i++){
		cin >> tmp1;
		inp[tmp1] = true;
	}
	cin >> m;
	for(int i=0; i<m; i++){
		cin >> tmp2;
		if(inp[tmp2] == false) cout << "0 ";
		else cout << "1 ";
	}
	
	return 0;
}

'Algorithm' 카테고리의 다른 글

BOJ 1300: k번째 수  (0) 2023.11.09
BOJ 2512: 예산  (0) 2023.11.09
Codeup 3006: 완전 제곱수 찾기  (0) 2023.11.09
Edmonds-Karp  (2) 2023.08.29
memoization 기법을 이용한 피보나치 수열  (0) 2023.06.26