結果
| 問題 | No.39 桁の数字を入れ替え |
| コンテスト | |
| ユーザー |
woodsgreen
|
| 提出日時 | 2022-01-11 15:10:02 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 366 bytes |
| 記録 | |
| コンパイル時間 | 1,278 ms |
| コンパイル使用メモリ | 209,676 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-24 23:45:36 |
| 合計ジャッジ時間 | 2,331 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 WA * 9 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
char s[10];
int len;
int main(){
cin>>s;
len=strlen(s);
for(int i=0;i<len;++i){
int p=s[i],q=i;
for(int j=i+1;j<len;++j)
if(s[j]>p){
p=s[j];
q=j;
}
if(q!=i) swap(s[i],s[q]);
}
cout<<s;
return 0;
}
woodsgreen