diff options
author | crupest <crupest@outlook.com> | 2021-11-19 11:57:35 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-11-19 11:57:35 +0800 |
commit | f1c97716c363f1095520b8ddd9c83cab6e339f54 (patch) | |
tree | 087bc8a680951f78c6be3849b24b7977d2cd307b /algorithm-experiment/5.1c.cpp | |
parent | a80df838667eb5015b83e93169c6cad197c61aa4 (diff) | |
download | life-f1c97716c363f1095520b8ddd9c83cab6e339f54.tar.gz life-f1c97716c363f1095520b8ddd9c83cab6e339f54.tar.bz2 life-f1c97716c363f1095520b8ddd9c83cab6e339f54.zip |
Add algorithm experiment 5.
Diffstat (limited to 'algorithm-experiment/5.1c.cpp')
-rw-r--r-- | algorithm-experiment/5.1c.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/algorithm-experiment/5.1c.cpp b/algorithm-experiment/5.1c.cpp new file mode 100644 index 0000000..f38d199 --- /dev/null +++ b/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; +} |