結果

問題 No.256 桁の数字を入れ替え (2)
ユーザー KuraKura
提出日時 2019-07-19 15:22:47
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 12 ms / 2,000 ms
コード長 252 bytes
コンパイル時間 1,038 ms
コンパイル使用メモリ 148,872 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-26 21:17:31
合計ジャッジ時間 1,520 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 12 ms
4,376 KB
testcase_03 AC 12 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;cin>>s;
  int l=s.length();
  vector<int> a(l);
  for(int i=0;i<l;i++){
    a[i]=s[i]-'0';
  }
  sort(a.begin(),a.end());
  for(int i=l-1;i>=0;i--){
    cout<<a[i];
  }
  cout<<endl;
}
0