結果

問題 No.256 桁の数字を入れ替え (2)
ユーザー d_seid_sei
提出日時 2019-10-22 23:05:40
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 12 ms / 2,000 ms
コード長 902 bytes
コンパイル時間 943 ms
コンパイル使用メモリ 102,572 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-18 09:38:45
合計ジャッジ時間 1,441 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
using namespace std;
#define lint long long int
/*
vector<char>al(26);
al = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
vector<char>AL(26);
AL = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
*/

int main() {
	string N;
	cin >> N;
	int Z = N.size();
	vector<int>vec(Z);
	for (int ia = 0; ia < Z; ia++) {
		vec.at(ia) = N.at(ia)-'0';
	}
	sort(vec.rbegin(), vec.rend());
	for (int ib = 0; ib < Z; ib++) {
		cout << vec.at(ib);
	}
	cout << endl;
}

0