回答編集履歴
1
edit
answer
CHANGED
@@ -1,12 +1,13 @@
|
|
1
|
-
一部無駄な部分がありますが。
|
1
|
+
~~一部無駄な部分がありますが。~~
|
2
|
+
こっそり`unordered_set`にすり替えておく…
|
2
3
|
|
3
4
|
```c++
|
4
5
|
#include <iostream>
|
5
6
|
#include <algorithm>
|
6
|
-
#include <
|
7
|
+
#include <unordered_set>
|
7
8
|
|
8
9
|
int main() {
|
9
|
-
std::
|
10
|
+
std::unordered_set<int> lookup = {1, 2, 3};
|
10
11
|
int a;
|
11
12
|
std::cin >> a;
|
12
13
|
if (lookup.find(a) == lookup.end()) {
|