結果
| 問題 | No.3629 Maximize Subsequense Mex |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-08-14 22:24:14 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 669 bytes |
| 記録 | |
| コンパイル時間 | 1,906 ms |
| コンパイル使用メモリ | 336,896 KB |
| 実行使用メモリ | 9,432 KB |
| 最終ジャッジ日時 | 2026-08-14 22:24:20 |
| 合計ジャッジ時間 | 5,272 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 27 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int T;
cin >> T;
while(T--){
string s, ans, ord = "1234567890";
cin >> s;
for(int i = 0; i < (int)s.size(); i++){
for(int j = 0; j < ord.size(); j++){
if(ord[j] == s[i]){
swap(ord[j], ord.back());
break;
}
}
if(i == 0 && ord[i] == '0'){
rotate(ord.begin(), ord.begin() + 1, ord.begin() + 9);
}
ans += ord;
}
ans.pop_back();
cout << ans << '\n';
}
}