結果
| 問題 | No.256 桁の数字を入れ替え (2) |
| コンテスト | |
| ユーザー |
nopperi
|
| 提出日時 | 2015-09-10 08:39:32 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 465 bytes |
| コンパイル時間 | 374 ms |
| コンパイル使用メモリ | 55,128 KB |
| 実行使用メモリ | 10,624 KB |
| 最終ジャッジ日時 | 2024-07-19 05:11:51 |
| 合計ジャッジ時間 | 3,859 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 TLE * 1 -- * 1 |
ソースコード
#include <iostream>
using namespace std;
int main(void) {
string num;
cin >> num;
for (int i = 0; i < num.length(); i++) {
int max = i;
for (int j = num.length()-1; j > i; j--) {
if (num[max] < num[j]) {
max = j;
}
}
if (max != i) {
char tmp = num[i];
num[i] = num[max];
num[max] = tmp;
}
}
cout << num << endl;
return 0;
}
nopperi