Submission #00241
ソースコード
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 | #include <bits/stdc++.h> using namespace std; int main(){ int cnt=0; vector<string> s(1000); vector<string> omozi(1000); vector<string> comozi(1000); vector<string> num(1000); while (1){ cin>>s[cnt]; if (s[cnt][0]== '#' ){ break ; } for ( int i=0; i<s[cnt].size(); i++){ if (s[cnt][i]<= '9' ){ num[cnt]+=s[cnt][i]; } else if (s[cnt][i]>= 'A' &&s[cnt][i]<= 'Z' ){ omozi[cnt]+=s[cnt][i]; } else { comozi[cnt]+=s[cnt][i]; } } cnt++; } for ( int i=0; i<cnt; i++){ sort(comozi[i].begin(),comozi[i].end()); sort(omozi[i].begin(),omozi[i].end()); sort(num[i].begin(),num[i].end()); cout<<comozi[i]; cout<<omozi[i]; cout<<num[i]<<endl; } return (0); } |
ステータス
項目 | データ |
---|---|
問題 | 0005 - クレヨンの並べ替え |
ユーザー名 | ei2214 |
投稿日時 | 2024-03-29 14:00:15 |
言語 | C++17 |
状態 | Accepted |
得点 | 20 |
ソースコード長 | 901 Byte |
最大実行時間 | 30 ms |
最大メモリ使用量 | 860 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 20 / 20 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
A1 | AC | 30 ms | 860 KB |
1
|
A2 | AC | 22 ms | 728 KB |
1
|
A3 | AC | 19 ms | 752 KB |
1
|
A4 | AC | 22 ms | 760 KB |
1
|