結果
問題 |
No.39 桁の数字を入れ替え
|
ユーザー |
|
提出日時 | 2019-08-02 20:17:37 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 367 bytes |
コンパイル時間 | 1,895 ms |
コンパイル使用メモリ | 193,484 KB |
最終ジャッジ日時 | 2025-01-07 10:35:12 |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 18 WA * 1 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { string n; cin >> n; string ans; 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; }