結果

問題 No.8116 TCP ソート
ユーザー Ponzu
提出日時 2025-04-03 06:40:01
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 372 bytes
コンパイル時間 1,304 ms
コンパイル使用メモリ 114,228 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2025-04-03 06:40:04
合計ジャッジ時間 2,524 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11 WA * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
using namespace std;

int main()
{
	string s;cin>>s;
	map<char,int> ord;
	ord['T'] = 0;ord['C'] = 1;ord['P'] = 2;
	int idx = 3;
	string t = "TCP";
	sort(s.begin(),s.end(),[&](char a,char b){
		if(!t.contains(a) || !t.contains(b)) return a < b;
		else return ord[a] < ord[b];
	});

	cout << s << endl;
}
0