結果
問題 |
No.8116 TCP ソート
|
ユーザー |
|
提出日時 | 2025-04-02 11:21:04 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 431 bytes |
コンパイル時間 | 3,628 ms |
コンパイル使用メモリ | 284,312 KB |
実行使用メモリ | 7,324 KB |
最終ジャッジ日時 | 2025-04-02 11:21:09 |
合計ジャッジ時間 | 4,956 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 27 |
ソースコード
#include<bits/stdc++.h> using namespace std; #define int long long signed main(){ string s;cin>>s; map<char,int>cnt; int n=s.size(); for(char w:s)cnt[w]++; string ans=""; if(cnt['C']!=0){ ans+=string(cnt['T'],'T'); ans+=string(cnt['C'],'C'); ans+=string(cnt['P'],'P'); } else{ ans+=string(cnt['P'],'P'); ans+=string(cnt['T'],'T'); } cout<<ans<<endl; }