7802022-01-11 10:38:48kidesoSzámjegy keveréscpp11Wrong answer 2/402ms2024 KiB
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

int main()
{
	string s;
	cin >> s;
	vector <char> c;
	for (auto e : s)
		c.push_back(e);


	sort(c.begin(), c.end());

	int i = 0;
	while (i < c.size() && c[i] == '0') ++i;

	if (c.front()!='0')
		for (auto e : c) cout << e;
	else
	{
		int j = i;
		cout << c[j];
		++j;
		//while (j < c.size() && c[j] == c[i]) { cout << c[j]; ++j; }
		--i;
		while (i>=0) { cout << c[i]; --i; }
		while (j < c.size()) { cout << c[j]; ++j; }
	}

	return 0;
}
SubtaskSumTestVerdictTimeMemory
base2/40
1Accepted0/02ms1736 KiB
2Accepted0/01ms1776 KiB
3Wrong answer0/01ms1840 KiB
4Accepted2/21ms1848 KiB
5Wrong answer0/21ms1856 KiB
6Wrong answer0/21ms1852 KiB
7Wrong answer0/21ms1860 KiB
8Wrong answer0/21ms1868 KiB
9Wrong answer0/21ms1864 KiB
10Wrong answer0/21ms1876 KiB
11Wrong answer0/41ms1876 KiB
12Wrong answer0/41ms1880 KiB
13Wrong answer0/22ms1928 KiB
14Wrong answer0/22ms1944 KiB
15Wrong answer0/22ms1956 KiB
16Wrong answer0/22ms1968 KiB
17Wrong answer0/22ms1988 KiB
18Wrong answer0/22ms1996 KiB
19Wrong answer0/32ms2004 KiB
20Wrong answer0/32ms2024 KiB