結果
問題 |
No.39 桁の数字を入れ替え
|
ユーザー |
|
提出日時 | 2018-04-30 20:09:38 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 373 bytes |
コンパイル時間 | 658 ms |
コンパイル使用メモリ | 66,848 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-27 23:57:07 |
合計ジャッジ時間 | 1,353 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 18 WA * 1 |
ソースコード
#include<iostream> using namespace std; int main(){ string s; cin >> s; int len = s.length(); int m = -1; for(int i = 0; i < len; i++){ for(int j = 0; j < len; j++){ if(i == j) continue; string t = s; swap(t[i], t[j]); m = max(stoi(t), m); } } cout << m << endl; return 0; }