結果
問題 |
No.8116 TCP ソート
|
ユーザー |
![]() |
提出日時 | 2025-04-03 06:38:38 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 395 bytes |
コンパイル時間 | 1,447 ms |
コンパイル使用メモリ | 114,340 KB |
実行使用メモリ | 7,720 KB |
最終ジャッジ日時 | 2025-04-03 06:38:41 |
合計ジャッジ時間 | 2,650 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 WA * 16 |
ソースコード
#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"; for(char c='A';c<='Z';++c) { if(t.contains(c))continue; ord[c] = idx++; } sort(s.begin(),s.end(),[&](char a,char b){ return ord[a] < ord[b]; }); cout << s << endl; }