Lord_AK's blog

By Lord_AK, history, 4 months ago, In English
#include <iostream>
#include <string>
using namespace std;
int main()
 {
     int year;
     string s;
     cin>>year;
     while(1)
     {
     year++;
     s=to_string(year);
     
            if(s[0]!=s[1]&&s[0]!=s[2]&&s[0]!=s[3]&&s[1]!=s[2]&&s[1]!=s[3]&&s[2]!=s[3])
            {
                cout<<s<<endl;
                break;
            }
     }
  return 0;
}

if you having trouble to understand this, you can also find the code here... https://attopgames.blogspot.com/2022/01/271a-beautiful-year-codeforces-solution.html

 
 
 
 
  • Vote: I like it
  • -11
  • Vote: I do not like it

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by Lord_AK (previous revision, new revision, compare).

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by Lord_AK (previous revision, new revision, compare).