Submission #00187


ソースコード

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>
using namespace std;
#define endl "\n"
#define rep(i, a, b) for(int i = a; i < b; i++)
#define rrep(i, a, b) for(int i = a; i >= b; i--)
#define all(x) (x).begin(),(x).end()
#define inf 1001001001
template<class T> bool chmax(T &a, const T &b) { if(a < b) {a = b; return true;} return false; }
template<class T> bool chmin(T &a, const T &b) { if(b < a) {a = b; return true;} return false; }
//================================================================================================
int main(){
string s;
cin >> s;
while(s != "#"){
vector<char> komozi, omozi, number;
for(int i = 0; i < s.size(); i++){
if('a' <= s[i] && s[i] <='z'){
komozi.push_back(s[i]);
}else if('A' <= s[i] && s[i] <= 'Z'){
omozi.push_back(s[i]);
}else if('0' <= s[i] && s[i] <= '9'){
number.push_back(s[i]);
}
}
sort(komozi.begin(),komozi.end());
sort(omozi.begin(),omozi.end());
sort(number.begin(),number.end());
for(int i = 0; i < komozi.size(); i++){
cout << komozi[i];
}
for(int i = 0; i < omozi.size(); i++){
cout << omozi[i];
}
for(int i = 0; i < number.size(); i++){
cout << number[i];
}
cout << endl;
cin >> s;
}
return(0);
}

ステータス

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

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
A1 AC 31 ms 476 KB
1
A2 AC 21 ms 568 KB
1
A3 AC 24 ms 412 KB
1
A4 AC 23 ms 500 KB
1