Run ID:148844
提交时间:2026-03-01 19:20:22
#include <cstdio> #include <iostream> using namespace std; int exist[1000001]; int main() { int N, M; scanf("%d %d", &N, &M); int height; for (int i = 0; i < N; ++i) { scanf("%d", &height); exist[height] = 1; } for (int i = 0; i < M; ++i) { int k; scanf("%d", &k); if (exist[k] > 0) { cout << 1; } else { cout << 0; } if (i < M - 1) { cout << " "; } } return 0; }