Submission #00205


ソースコード

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
#include <bits/stdc++.h>
#define ll long long
#define gcd(x,y) __gcd(x,y) //最大公約数
#define lcm(x,y) x/(__gcd(x,y))*y //最小公倍数
#define so(a) sort(a.begin(),a.end()) //ソート昇順
#define sog(a) sort(a.begin(),a.end(),greater<int>()) //ソート降順
using namespace std;
int main(){
string s;
cin>>s;
while(s!="#"){
int oo[26]={},ko[26]={},su[10]={};
for(int i=0;i<s.size();i++){
if('0'<=s[i]&&s[i]<='9'){
su[int(s[i]-'0')]++;
}else if('A'<=s[i]&&s[i]<='Z'){
oo[int(s[i]-'A')]++;
}else{
ko[int(s[i]-'a')]++;
}
}
for(int i=0;i<26;i++){
for(int j=0;j<ko[i];j++){
cout<<char('a'+i);
}
}
for(int i=0;i<26;i++){
for(int j=0;j<oo[i];j++){
cout<<char('A'+i);
}
}
for(int i=0;i<10;i++){
for(int j=0;j<su[i];j++){
cout<<char('0'+i);
}
}
cout<<endl;
cin>>s;
}
return(0);
}

ステータス

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

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
A1 AC 25 ms 472 KB
1
A2 AC 21 ms 568 KB
1
A3 AC 20 ms 536 KB
1
A4 AC 21 ms 632 KB
1