aboutsummaryrefslogtreecommitdiff
path: root/works/life/algorithm-experiment/5.1c.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
commit205f243379919b7830726f9dcc4ae7d33c84e857 (patch)
treeb18b433bcd9d1d9bb38e6da18c880f8fddb1cea9 /works/life/algorithm-experiment/5.1c.cpp
parent3c9273676b785c6ba4fc11e865851ba2319f41bf (diff)
downloadcrupest-205f243379919b7830726f9dcc4ae7d33c84e857.tar.gz
crupest-205f243379919b7830726f9dcc4ae7d33c84e857.tar.bz2
crupest-205f243379919b7830726f9dcc4ae7d33c84e857.zip
import(life): Add algorithm experiment 5.
Diffstat (limited to 'works/life/algorithm-experiment/5.1c.cpp')
-rw-r--r--works/life/algorithm-experiment/5.1c.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/works/life/algorithm-experiment/5.1c.cpp b/works/life/algorithm-experiment/5.1c.cpp
new file mode 100644
index 0000000..f38d199
--- /dev/null
+++ b/works/life/algorithm-experiment/5.1c.cpp
@@ -0,0 +1,24 @@
+#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 << '\n';
+ }
+ }
+
+ return 0;
+}