aboutsummaryrefslogtreecommitdiff
path: root/codeforces/BeautifulYear/main.cpp
blob: 31fa32d8098f1c8bb9feb52661247d3e7c762433 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include<bits/stdc++.h>

using namespace std;

int main () {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
  int in;
  cin >> in;
  for(int i = in + 1; i <= 9500; i++) {
    string s = to_string(i);
    set<int> st;
    for(auto ch : s) {
      st.insert(ch - '0');
    }
    if(st.size() == 4) {
      cout << i << endl;
      break;
    } 
  }
}