Submission #00215
ソースコード
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 | #include <bits/stdc++.h> using namespace std; #define st string #define ll long long #define ull unsigned long long #define all(x) sort(x.begin(),x.end()) #define pq priority_queue<long long> #define endl "\n" #define gcd(x,y) __gcd(x,y) //最大公約数 #define lcm(x,y) x/(__gcd(x,y))*y //最小公倍数 const long long INF = 1LL << 60; template < typename T> inline bool chmax(T &a, T b) { return ((a < b) ? (a = b, true ) : ( false )); } template < typename T> inline bool chmin(T &a, T b) { return ((a > b) ? (a = b, true ) : ( false )); } int main() { st str; st suji, komoji, omoji; while (1){ str = {}; suji = komoji = omoji = {}; cin >> str; if (str == "#" ){ break ; } for ( int i = 0;i < str.size();i++){ if ( 'a' <= str[i] && str[i] <= 'z' ){ komoji += str[i]; } else if ( 'A' <= str[i] && str[i] <= 'Z' ){ omoji += str[i]; } else { suji += str[i]; } } all(komoji); all(omoji); all(suji); cout << komoji + omoji + suji << endl; } } |
ステータス
項目 | データ |
---|---|
問題 | 0005 - クレヨンの並べ替え |
ユーザー名 | ei2217 |
投稿日時 | 2024-03-29 13:39:08 |
言語 | C++17 |
状態 | Accepted |
得点 | 20 |
ソースコード長 | 1195 Byte |
最大実行時間 | 26 ms |
最大メモリ使用量 | 536 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 20 / 20 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
A1 | AC | 19 ms | 476 KB |
1
|
A2 | AC | 16 ms | 440 KB |
1
|
A3 | AC | 26 ms | 536 KB |
1
|
A4 | AC | 21 ms | 492 KB |
1
|