We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f456fe7 + 9affce4 commit 81abc68Copy full SHA for 81abc68
1 file changed
weekly/week01/BOJ_1920_수 찾기/lsy1307.cpp
@@ -0,0 +1,23 @@
1
+#include <iostream>
2
+#include <unordered_set>
3
+using namespace std;
4
+
5
+int main() {
6
+ ios_base::sync_with_stdio(false);
7
+ cin.tie(nullptr);
8
+ cout.tie(nullptr);
9
+ int N, num1, M, num2;
10
+ cin >> N;
11
+ unordered_set<int> numbers;
12
+ numbers.reserve(N);
13
+ while (N--) {
14
+ cin >> num1;
15
+ numbers.insert(num1);
16
+ }
17
+ cin >> M;
18
+ while (M--) {
19
+ cin >> num2;
20
+ if (numbers.find(num2) != numbers.end()) cout << 1 << "\n";
21
+ else cout << 0 << "\n";
22
23
+}
0 commit comments