diff options
| author | omagdy7 <omar.professional8777@gmail.com> | 2022-11-05 01:41:11 +0200 |
|---|---|---|
| committer | omagdy7 <omar.professional8777@gmail.com> | 2022-11-05 01:41:11 +0200 |
| commit | 7f856c7ff080b8d455b9ed16c2e57dd862c3879d (patch) | |
| tree | c2baf90f98c91567358003d6b97a4afed7fa9b42 /strangeAddition | |
| parent | c52b36c6a37fdb1d1de146d3939cb42e2c691f44 (diff) | |
| download | competitive-programming-7f856c7ff080b8d455b9ed16c2e57dd862c3879d.tar.xz competitive-programming-7f856c7ff080b8d455b9ed16c2e57dd862c3879d.zip | |
moved some file
Diffstat (limited to 'strangeAddition')
| -rwxr-xr-x | strangeAddition/main | bin | 46808 -> 0 bytes | |||
| -rw-r--r-- | strangeAddition/main.cpp | 51 | ||||
| -rw-r--r-- | strangeAddition/main_input0.txt | 2 | ||||
| -rw-r--r-- | strangeAddition/main_input1.txt | 2 | ||||
| -rw-r--r-- | strangeAddition/main_output0.txt | 2 | ||||
| -rw-r--r-- | strangeAddition/main_output1.txt | 2 |
6 files changed, 0 insertions, 59 deletions
diff --git a/strangeAddition/main b/strangeAddition/main Binary files differdeleted file mode 100755 index 32d1277..0000000 --- a/strangeAddition/main +++ /dev/null diff --git a/strangeAddition/main.cpp b/strangeAddition/main.cpp deleted file mode 100644 index 4e1e203..0000000 --- a/strangeAddition/main.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include <algorithm> -#include<bits/stdc++.h> - -using namespace std; - -int main () { - ios_base::sync_with_stdio(false); - cin.tie(NULL); - int n; - cin >> n; - int zeros = 0; - vector<int> ind; - vector<int> v(n); - for(int i = 0; i < n; i++) { - cin >> v[i]; - int y = v[i]; - if(v[i] == 0) { - zeros++; - ind.push_back(i); - } - while(y >= 1) { - int d = y % 10; - y /= 10; - if(d == 0) { - zeros++; - ind.push_back(i); - break; - } - } - } - int diff = 1; - zeros = zeros * 2; - cout << min(zeros, n) << endl; - vector<int> ans; - for(int i = 0; i < n; i++) { - if(count(ind.begin(), ind.end(), i)) { - ans.push_back(v[i]); - } - } - for(int i = 0; i < n; i++){ - if(!count(ind.begin(), ind.end(), i) && diff) { - ans.push_back(v[i]); - diff--; - } - } - sort(ans.begin(), ans.end()); - for(auto x : ans) { - cout << x << " "; - } - cout << endl; -} diff --git a/strangeAddition/main_input0.txt b/strangeAddition/main_input0.txt deleted file mode 100644 index 27669ab..0000000 --- a/strangeAddition/main_input0.txt +++ /dev/null @@ -1,2 +0,0 @@ -4 -100 10 1 0 diff --git a/strangeAddition/main_input1.txt b/strangeAddition/main_input1.txt deleted file mode 100644 index bd4305b..0000000 --- a/strangeAddition/main_input1.txt +++ /dev/null @@ -1,2 +0,0 @@ -3 -2 70 3 diff --git a/strangeAddition/main_output0.txt b/strangeAddition/main_output0.txt deleted file mode 100644 index e9a3643..0000000 --- a/strangeAddition/main_output0.txt +++ /dev/null @@ -1,2 +0,0 @@ -4 -0 1 10 100 diff --git a/strangeAddition/main_output1.txt b/strangeAddition/main_output1.txt deleted file mode 100644 index 0cd8cd5..0000000 --- a/strangeAddition/main_output1.txt +++ /dev/null @@ -1,2 +0,0 @@ -2 -2 70 |
