Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #define _USE_MATH_DEFINES
- #include<stdio.h>
- #include<iostream>
- #include<vector>
- #include<cmath>
- #include<algorithm>
- #include<map>
- #include<set>
- #include<sstream>
- #include<cstring>
- #include<numeric>
- #include<limits.h>
- using namespace std;
- const int N = 5e5;
- char a[N];
- set<int> to, from;
- int main() {
- freopen("out.txt", "w", stdout);
- freopen("Text.txt", "r", stdin);
- scanf("%s", a);
- for (int i = 0; i <= 9999; i++) {
- to.insert(i);
- }
- int len = strlen(a);
- for (int i = 0; i < len; i++) {
- for (int ln = 0; ln < 4; ln++) {
- int cur = 0;
- for (int j = i; j <= i + ln; j++) {
- cur *= 10;
- cur += a[j] - '0';
- }
- from.insert(cur);
- }
- }
- for (auto c : to) {
- if (from.count(c) == 0) {
- printf("%d\n", c);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement