結果
問題 |
No.39 桁の数字を入れ替え
|
ユーザー |
![]() |
提出日時 | 2019-07-13 09:50:15 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 437 bytes |
コンパイル時間 | 564 ms |
コンパイル使用メモリ | 60,304 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-21 13:41:50 |
合計ジャッジ時間 | 1,269 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 WA * 8 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> #include <string> using namespace std; typedef long long ll; #define rep(i,n) for (int i = 0; i < (n); ++i) int main(){ string N; cin >> N; char max_num = '0'; int max_ix = 0; for(int i=0;i<N.length();i++){ if(max_num <= N[i]){ max_num = N[i]; max_ix = i; } } swap(N[0],N[max_ix]); cout << N << endl; }