結果
| 問題 | No.39 桁の数字を入れ替え |
| コンテスト | |
| ユーザー |
togari_takamoto
|
| 提出日時 | 2016-02-26 15:25:36 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 519 bytes |
| 記録 | |
| コンパイル時間 | 1,321 ms |
| コンパイル使用メモリ | 160,988 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-02 06:52:02 |
| 合計ジャッジ時間 | 1,898 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>; using vb = vector<bool>; using vd = vector<double>; using vl = vector<ll>;
using vvi = vector<vi>; using vvb = vector<vb>; using vvd = vector<vd>; using vvl = vector<vl>;
#define REP(i,n) for(ll i=0; i<(n); ++i)
int main() {
string s; cin >> s;
ll max_v = 0;
REP(i, s.size()) REP(j, s.size()) {
swap(s[i], s[j]);
max_v = max<ll>(max_v, stoi(s));
swap(s[i], s[j]);
}
cout << max_v << endl;
return 0;
}
togari_takamoto