結果

問題 No.256 桁の数字を入れ替え (2)
ユーザー saytakaPCsaytakaPC
提出日時 2015-07-31 23:28:03
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 13 ms / 2,000 ms
コード長 489 bytes
コンパイル時間 584 ms
コンパイル使用メモリ 71,700 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-24 23:05:14
合計ジャッジ時間 1,127 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <map>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,b) FOR(i,0,b)
#define PB push_back
#define MP make_pair
int main(){
  string n;
  cin>>n;
  vector<int> ans;
  for(int i=0;i<n.size();i++){
    ans.PB(n[i]-'0');
  }
  sort(ans.begin(),ans.end(),greater<int>());
  for(int i=0;i<ans.size();i++){
    cout<<ans[i];
  }cout<<endl;
}
0