Submission #00120
ソースコード
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 | #include<bits/stdc++.h> #define np(v) next_permutation(v.begin(),v.end()) //次の順列 #define gcd(a,b) __gcd(a,b) //最大公約数 #define lcm(a,b) a/(gcd(a,b))*b //最小公倍数 #define lb(v,a) lower_bound(v.begin(),v.end(),a) //以上の最初 #define ub(v,a) upper_bound(v.begin(),v.end(),a) //越えの最初 #define bs(v,a) binary_search(v.begin(),v.end(),a) //値があるか #define fixed(a) fixed<<setprecision(a) //小数点以下第 a + 1 を四捨五入 using namespace std; using ll = long long ; using ull = unsigned long long ; using P = pair<ll, int >; using pq = priority_queue<P,vector<P>,greater<P>>; const int inf = 1 << 30; const ll ll_inf = 1LL << 62; struct edge { int c,to; }; int main(){ ios::sync_with_stdio( false ); cin.tie(0); srand ((unsigned int ) time (NULL)); string S; while (cin>>S){ map< char , int > m; if (S == "#" ) break ; for ( char i:S){ m[i]++; } for ( char c = 'a' ;c <= 'z' ;c++){ for ( int i = 0;i < m[c];i++){ cout<<c; } } for ( char c = 'A' ;c <= 'Z' ;c++){ for ( int i = 0;i < m[c];i++){ cout<<c; } } for ( char c = '0' ;c <= '9' ;c++){ for ( int i = 0;i < m[c];i++){ cout<<c; } } cout<< "\n" ; } } |
ステータス
項目 | データ |
---|---|
問題 | 0005 - クレヨンの並べ替え |
ユーザー名 | r2213 |
投稿日時 | 2024-03-29 12:20:22 |
言語 | C++17 |
状態 | Accepted |
得点 | 20 |
ソースコード長 | 1414 Byte |
最大実行時間 | 26 ms |
最大メモリ使用量 | 688 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 20 / 20 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
A1 | AC | 26 ms | 604 KB |
1
|
A2 | AC | 18 ms | 676 KB |
1
|
A3 | AC | 21 ms | 620 KB |
1
|
A4 | AC | 17 ms | 688 KB |
1
|