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.1a.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.1a.cpp')
-rw-r--r-- | algorithm-experiment/5.1a.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/algorithm-experiment/5.1a.cpp b/algorithm-experiment/5.1a.cpp new file mode 100644 index 0000000..d0d442f --- /dev/null +++ b/algorithm-experiment/5.1a.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); + + while (true) { + long long current; + std::cin >> current; + + auto b = f[current - 10000000]; + if (b) { + std::cout << current; + break; + } else { + b = true; + } + } + + return 0; +} |