結果
| 問題 | No.39 桁の数字を入れ替え |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-08-02 20:18:22 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 7 ms / 5,000 ms |
| コード長 | 371 bytes |
| 記録 | |
| コンパイル時間 | 2,015 ms |
| コンパイル使用メモリ | 194,604 KB |
| 最終ジャッジ日時 | 2025-01-07 10:35:22 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
string n;
cin >> n;
string ans = n;
int len = n.size();
for (int i = 0; i < len; i++)
for (int j = i+1; j < len; j++) {
swap(n[i], n[j]);
ans = max(ans, n);
swap(n[i], n[j]);
}
cout << ans << endl;
return 0;
}