aboutsummaryrefslogtreecommitdiff
path: root/algorithm-experiment/5.1b.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-11-19 11:57:35 +0800
committercrupest <crupest@outlook.com>2021-11-19 11:57:35 +0800
commitf1c97716c363f1095520b8ddd9c83cab6e339f54 (patch)
tree087bc8a680951f78c6be3849b24b7977d2cd307b /algorithm-experiment/5.1b.cpp
parenta80df838667eb5015b83e93169c6cad197c61aa4 (diff)
downloadlife-f1c97716c363f1095520b8ddd9c83cab6e339f54.tar.gz
life-f1c97716c363f1095520b8ddd9c83cab6e339f54.tar.bz2
life-f1c97716c363f1095520b8ddd9c83cab6e339f54.zip
Add algorithm experiment 5.
Diffstat (limited to 'algorithm-experiment/5.1b.cpp')
-rw-r--r--algorithm-experiment/5.1b.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/algorithm-experiment/5.1b.cpp b/algorithm-experiment/5.1b.cpp
new file mode 100644
index 0000000..a6dd32e
--- /dev/null
+++ b/algorithm-experiment/5.1b.cpp
@@ -0,0 +1,25 @@
+#include <bitset>
+#include <ios>
+#include <iostream>
+
+std::bitset<10000000> f;
+
+int main() {
+ std::ios_base::sync_with_stdio(false);
+ std::cin.tie(nullptr);
+
+ long long current;
+
+ while (std::cin >> current) {
+ f[current - 10000000].flip();
+ }
+
+ for (int i = 1; i < 10000000; ++i) {
+ if (f[i]) {
+ std::cout << i + 10000000;
+ break;
+ }
+ }
+
+ return 0;
+}