結果
| 問題 | No.39 桁の数字を入れ替え |
| コンテスト | |
| ユーザー |
gon_027
|
| 提出日時 | 2020-02-11 00:52:30 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 5,000 ms |
| + 288µs | |
| コード長 | 603 bytes |
| 記録 | |
| コンパイル時間 | 391 ms |
| コンパイル使用メモリ | 99,040 KB |
| 実行使用メモリ | 9,768 KB |
| 最終ジャッジ日時 | 2026-09-07 06:26:43 |
| 合計ジャッジ時間 | 1,680 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 |
ソースコード
#include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <cstdio>
#include <algorithm>
#include <map>
#include <queue>
#include <cstdlib>
#include <cstdio>
using namespace std;
#define rep(i, n) for(int (i) = (0); (i) < (n); (i++))
using ll = long long;
int main() {
string n;
cin >> n;
ll ans = stoll(n);
string s = n;
for(int i = 0; i < s.size(); ++i){
for(int j = i; j < s.size(); ++j){
swap(s[i], s[j]);
ll tmp = stoll(s);
ans = max(ans, tmp);
s = n;
}
}
cout << ans << endl;
}
gon_027