結果
| 問題 | No.39 桁の数字を入れ替え |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-03-27 15:02:04 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 5,000 ms |
| + 151µs | |
| コード長 | 451 bytes |
| 記録 | |
| コンパイル時間 | 804 ms |
| コンパイル使用メモリ | 164,064 KB |
| 実行使用メモリ | 9,700 KB |
| 最終ジャッジ日時 | 2026-08-31 00:29:11 |
| 合計ジャッジ時間 | 2,344 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 |
ソースコード
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main(){
string str;
cin >> str;
int maxi = stoi(str);
for(int i = 0 ; i < str.size() ; ++i){
for(int j = i+1 ; j < str.size() ; ++j){
char temp;
temp = str[j];
string t = str;
t[j] = t[i];
t[i] = temp;
maxi = max(stoi(t) , maxi);
}
}
cout << maxi << endl;
}