結果
| 問題 | No.8116 TCP ソート | 
| コンテスト | |
| ユーザー |  ゼリトキ | 
| 提出日時 | 2025-04-01 21:27:01 | 
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 4 ms / 2,000 ms | 
| コード長 | 538 bytes | 
| コンパイル時間 | 3,413 ms | 
| コンパイル使用メモリ | 274,980 KB | 
| 実行使用メモリ | 7,328 KB | 
| 最終ジャッジ日時 | 2025-04-01 21:27:05 | 
| 合計ジャッジ時間 | 4,415 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 27 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
#define mod 998244353
int main(){
    cin.tie(0)->sync_with_stdio(0);
    cout.tie(0);
    string S;
    cin>>S;
    int C=0,P=0,T=0;
    rep(i,S.size()){
        if(S.at(i)=='C') C++;
        if(S.at(i)=='P') P++;
        if(S.at(i)=='T') T++;
    }
    if(C==0){
        rep(i,P) cout<<"P";
        rep(i,T) cout<<"T";
        return 0;
    }
    rep(i,T) cout<<"T";
    rep(i,C) cout<<"C";
    rep(i,P) cout<<"P";
}
            
            
            
        