From 7c3f32fab3b1a9d628d6856e7a923eb3c3b1ce5f Mon Sep 17 00:00:00 2001 From: Omar Magdy Date: Sat, 25 Jun 2022 18:32:00 +0200 Subject: Solved a couple of problems from codechef and codeforces --- BeautifulYear/inp | 0 BeautifulYear/main | Bin 0 -> 45240 bytes BeautifulYear/main.cpp | 21 +++++++++++++++++++++ BeautifulYear/main_input0.txt | 1 + BeautifulYear/main_input1.txt | 1 + BeautifulYear/main_output0.txt | 1 + BeautifulYear/main_output1.txt | 1 + 7 files changed, 25 insertions(+) create mode 100644 BeautifulYear/inp create mode 100755 BeautifulYear/main create mode 100644 BeautifulYear/main.cpp create mode 100644 BeautifulYear/main_input0.txt create mode 100644 BeautifulYear/main_input1.txt create mode 100644 BeautifulYear/main_output0.txt create mode 100644 BeautifulYear/main_output1.txt (limited to 'BeautifulYear') diff --git a/BeautifulYear/inp b/BeautifulYear/inp new file mode 100644 index 0000000..e69de29 diff --git a/BeautifulYear/main b/BeautifulYear/main new file mode 100755 index 0000000..ac627ae Binary files /dev/null and b/BeautifulYear/main differ 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 + +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 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 -- cgit v1.2.3