Skip to content

Commit f90d5ac

Browse files
committed
Added 271A - Beautiful Year.cpp
1 parent b0227a8 commit f90d5ac

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

271A - Beautiful Year.cpp

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// ॐ नमः शिवाय
2+
#include<bits/stdc++.h>
3+
using namespace std;
4+
#define pb push_back
5+
6+
// Code Written By: Vikash Patel
7+
// Codeforces Profile: https://codeforces.com/profile/vikashpatel
8+
9+
int main()
10+
{
11+
int y;
12+
cin>>y;
13+
int n=y+1;
14+
while(true)
15+
{
16+
string s = to_string(n);
17+
set<int> st;
18+
for(auto i:s)
19+
{
20+
st.insert(i-'0');
21+
}
22+
if(st.size()==4)
23+
break;
24+
n++;
25+
}
26+
cout<<n<<endl;
27+
return 0;
28+
}

0 commit comments

Comments
 (0)