提出 #70957570
ソースコード 拡げる
/*
~~ Alguma parte/frase foda de um livro/mangá para dar sorte ~~
Uma vez eu gritei, gradualmente, perdi minha voz.
Uma vez eu chorei, gradualmente, perdi minhas lágrimas.
Uma vez eu sofri, gradualmente, me tornei capaz de suportar tudo.
Uma vez me alegrei, gradualmente, me tornei indiferente ao mundo.
E agora, tudo o que me resta é um rosto sem expressão,
meu olhar é tão firme quanto um monólito,
apenas a perseverança permanece no meu coração.
Este sou eu, um personagem insignificante,
Fang Yuan — A Perseverança.
*/
#if defined(LOCAL) or not defined(LUOGU)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast,unroll-loops")
#endif
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template <class T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template <typename T>
ostream& operator<<(ostream &os, const vector<T> &v) {
os << "[";
for (size_t i = 0; i < v.size(); ++i) {
os << v[i] << (i + 1 == v.size() ? "" : ", ");
}
os << "]";
return os;
}
void dbg_out() { cerr << endl; }
template <typename Head, typename... Tail>
void dbg_out(Head H, Tail... T)
{
cerr << ' ' << H;
dbg_out(T...);
}
#define dbg(...) cerr << "(" << _VA_ARGS_ << "):", dbg_out(_VA_ARGS_), cerr << endl
#define int long long
#define IOS \
ios_base::sync_with_stdio(false); \
cin.tie(0)
#define TXTIO \
freopen("entrada.in", "r", stdin);\
freopen("saida.out", "w", stdout)
#define pb push_back
#define all(v) v.begin(), v.end()
#define f first
#define s second
#define Unique(v) \
sort(all(v)); \
v.erase(unique(all(v)), v.end()); \
v.shrink_to_fit()
#define sz(v) ((int)v.size())
#define sor(x) sort(all(x))
#define ft front()
#define bk back()
#define endl "\n"
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define MIN(v) *min_element(all(v))
#define MAX(v) *max_element(all(v))
#define LB(c, x) distance((c).begin(), lower_bound(all(c), (x)))
#define UB(c, x) distance((c).begin(), upper_bound(all(c), (x)))
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<vvd> vvvd;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef long long ll;
typedef double db;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef vector<pii> vii;
typedef vector<piii> viii;
typedef tuple<int, int, int> tiii;
const int MAXN = 2e5 + 5;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fll;
const int mod = 1e9 + 7;
const int LOGN = 21;
void solve()
{
string s; cin >> s;
sor(s);
if(!s.empty() && s[0] == '0'){
int i = 0;
while(i < sz(s) && s[i] == '0') i++;
if(i < sz(s))
swap(s[0], s[i]);
}
cout << s << endl;
}
int32_t main()
{
IOS;
int tt;
tt = 1;
while (tt --> 0)
solve();
return 0;
}
提出情報
ジャッジ結果
| セット名 |
Sample |
All |
| 得点 / 配点 |
0 / 0 |
200 / 200 |
| 結果 |
|
|
| セット名 |
テストケース |
| Sample |
00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt |
| All |
00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_test_00.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt, 01_test_11.txt, 01_test_12.txt, 01_test_13.txt |
| ケース名 |
結果 |
実行時間 |
メモリ |
| 00_sample_00.txt |
AC |
1 ms |
3536 KiB |
| 00_sample_01.txt |
AC |
1 ms |
3492 KiB |
| 00_sample_02.txt |
AC |
1 ms |
3508 KiB |
| 01_test_00.txt |
AC |
1 ms |
3508 KiB |
| 01_test_01.txt |
AC |
1 ms |
3484 KiB |
| 01_test_02.txt |
AC |
1 ms |
3508 KiB |
| 01_test_03.txt |
AC |
1 ms |
3460 KiB |
| 01_test_04.txt |
AC |
1 ms |
3508 KiB |
| 01_test_05.txt |
AC |
1 ms |
3424 KiB |
| 01_test_06.txt |
AC |
1 ms |
3460 KiB |
| 01_test_07.txt |
AC |
1 ms |
3540 KiB |
| 01_test_08.txt |
AC |
1 ms |
3460 KiB |
| 01_test_09.txt |
AC |
1 ms |
3472 KiB |
| 01_test_10.txt |
AC |
1 ms |
3600 KiB |
| 01_test_11.txt |
AC |
1 ms |
3484 KiB |
| 01_test_12.txt |
AC |
1 ms |
3540 KiB |
| 01_test_13.txt |
AC |
1 ms |
3624 KiB |