diff options
| author | Omar Magdy <omar.professional8777@gmail.com> | 2022-06-25 18:32:00 +0200 |
|---|---|---|
| committer | Omar Magdy <omar.professional8777@gmail.com> | 2022-06-25 18:32:00 +0200 |
| commit | 7c3f32fab3b1a9d628d6856e7a923eb3c3b1ce5f (patch) | |
| tree | 484c58be6bc4ceadf35010ed8b81854994903503 /BeautifulYear | |
| parent | a0a07a438b6804fdca0e18b2d626ceedb982611c (diff) | |
| download | competitive-programming-7c3f32fab3b1a9d628d6856e7a923eb3c3b1ce5f.tar.xz competitive-programming-7c3f32fab3b1a9d628d6856e7a923eb3c3b1ce5f.zip | |
Solved a couple of problems from codechef and codeforces
Diffstat (limited to 'BeautifulYear')
| -rw-r--r-- | BeautifulYear/inp | 0 | ||||
| -rwxr-xr-x | BeautifulYear/main | bin | 0 -> 45240 bytes | |||
| -rw-r--r-- | BeautifulYear/main.cpp | 21 | ||||
| -rw-r--r-- | BeautifulYear/main_input0.txt | 1 | ||||
| -rw-r--r-- | BeautifulYear/main_input1.txt | 1 | ||||
| -rw-r--r-- | BeautifulYear/main_output0.txt | 1 | ||||
| -rw-r--r-- | BeautifulYear/main_output1.txt | 1 |
7 files changed, 25 insertions, 0 deletions
diff --git a/BeautifulYear/inp b/BeautifulYear/inp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/BeautifulYear/inp diff --git a/BeautifulYear/main b/BeautifulYear/main Binary files differnew file mode 100755 index 0000000..ac627ae --- /dev/null +++ b/BeautifulYear/main diff --git a/BeautifulYear/main.cpp b/BeautifulYear/main.cpp new file mode 100644 index 0000000..31fa32d --- /dev/null +++ b/BeautifulYear/main.cpp @@ -0,0 +1,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; + } + } +} diff --git a/BeautifulYear/main_input0.txt b/BeautifulYear/main_input0.txt new file mode 100644 index 0000000..ef0a2ad --- /dev/null +++ b/BeautifulYear/main_input0.txt @@ -0,0 +1 @@ +1987 diff --git a/BeautifulYear/main_input1.txt b/BeautifulYear/main_input1.txt new file mode 100644 index 0000000..e355f6d --- /dev/null +++ b/BeautifulYear/main_input1.txt @@ -0,0 +1 @@ +2013 diff --git a/BeautifulYear/main_output0.txt b/BeautifulYear/main_output0.txt new file mode 100644 index 0000000..e355f6d --- /dev/null +++ b/BeautifulYear/main_output0.txt @@ -0,0 +1 @@ +2013 diff --git a/BeautifulYear/main_output1.txt b/BeautifulYear/main_output1.txt new file mode 100644 index 0000000..9ebee8e --- /dev/null +++ b/BeautifulYear/main_output1.txt @@ -0,0 +1 @@ +2014 |
