Submission #00098


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include<bits/stdc++.h>
#define rep(i,a,n) for(long long i=a;i<n;i++)
#define repp(i,a,n) for(long long i=a;i>=n;i--)
#define rep2(i,a,n,b) for(long long i=a;i<n;i+=b)
#define repp2(i,a,n,b) for(long long i=a;i>=n;i-=b)
#define so(z) sort(z.begin(),z.end())
#define sor(z) sort(z.rbegin(),z.rend())
#define re(z) reverse(z.begin(),z.end())
#define su(a) substr(a) //ans.substr(開始位置) ←最後まで
#define sub(a,b) substr(a,b) //ans.substr(開始位置,取り出す長さ)
#define yess cout<<"YES"<<"\n"
#define noo cout<<"NO"<<"\n"
#define yes cout<<"Yes"<<"\n"
#define no cout<<"No"<<"\n"
#define fi first
#define se second
#define fr() front()
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define nn "\n"
#define ll long long
#define ull unsigned long long
#define mod 1000000007
#define IM INT_MAX
#define LM LONG_LONG_MAX
#define gcd(x,y) __gcd(x,y) //最大公約数
#define lcm(x,y) x/(__gcd(x,y))*y //最小公倍数
#define prev(a) prev_permutation(a.begin(),a.end()) //辞書前
#define next(a) next_permutation(a.begin(),a.end()) //辞書後
#define get(s) getline(cin,s) // 空白の空いたstringの入力
#define fixed(a) fixed<<setprecision(a) //小数点何桁か指定
#define ro(a) round(a) //四捨五入
#define ce(a) ceil(a) //切り上げ
#define up(a,v) upper_bound(a.begin(),a.end(),v) //指定された要素より大きい値が現れる最初のイテレータ
#define lo(a,v) lower_bound(a.begin(),a.end(),v) //指定された要素以上の値が現れる最初のイテレータ
#define bi(a,v) binary_bound(a.begin(),a.end(),v) //指定された要素が配列内にあるか
#define pp priority_queue<pair<long long,long long>, vector<pair<long long,long long>>, greater<pair<long long,long long>> > // priority_queue 昇順
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
string s;
while(1){
cin>>s;
if(s=="#") break;
so(s);
//cout<<s<<nn;
ll n=s.size();
rep(i,0,n){
if('a'<=s[i]&&s[i]<='z') cout<<s[i];
}
rep(i,0,n){
if('A'<=s[i]&&s[i]<='Z') cout<<s[i];
}
rep(i,0,n){
if('0'<=s[i]&&s[i]<='9') cout<<s[i];
}
cout<<nn;
}
return(0);
}

ステータス

項目 データ
問題 0005 - クレヨンの並べ替え
ユーザー名 r2201
投稿日時 2024-03-29 12:14:22
言語 C++17
状態 Accepted
得点 20
ソースコード長 2354 Byte
最大実行時間 31 ms
最大メモリ使用量 812 KB

セット

セット 得点 Cases
1 ALL 20 / 20 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
A1 AC 29 ms 476 KB
1
A2 AC 19 ms 548 KB
1
A3 AC 31 ms 616 KB
1
A4 AC 23 ms 812 KB
1