aboutsummaryrefslogtreecommitdiff
path: root/works/life/algorithm-experiment/5.1a.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.1a.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.1a.cpp')
-rw-r--r--works/life/algorithm-experiment/5.1a.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/works/life/algorithm-experiment/5.1a.cpp b/works/life/algorithm-experiment/5.1a.cpp
new file mode 100644
index 0000000..d0d442f
--- /dev/null
+++ b/works/life/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;
+}