結果

問題 No.256 桁の数字を入れ替え (2)
ユーザー parsee1053parsee1053
提出日時 2020-07-05 02:25:14
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 11 ms / 2,000 ms
コード長 549 bytes
コンパイル時間 578 ms
コンパイル使用メモリ 75,572 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-20 00:30:30
合計ジャッジ時間 1,095 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;

#define MOD 1000000007

int main() {
  string s;
  cin >> s;
  int n = s.size();
  vector<int> cnt(10);
  for (int i = 0; i < n; ++i) {
    cnt[s[i] - '0']++;
  }
  for (int i = 9; i >= 0; --i) {
    for (int j = 0; j < cnt[i]; ++j) {
      cout << i;
    }
  }
  cout << endl;
  return 0;
}
0