結果
問題 | No.256 桁の数字を入れ替え (2) |
ユーザー | aaa |
提出日時 | 2018-11-07 09:19:45 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 8 ms / 2,000 ms |
コード長 | 659 bytes |
コンパイル時間 | 695 ms |
コンパイル使用メモリ | 97,540 KB |
実行使用メモリ | 6,940 KB |
最終ジャッジ日時 | 2024-04-30 22:21:57 |
合計ジャッジ時間 | 1,338 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
6,812 KB |
testcase_01 | AC | 2 ms
6,940 KB |
testcase_02 | AC | 8 ms
6,940 KB |
testcase_03 | AC | 8 ms
6,940 KB |
ソースコード
#include <stdio.h> #include <algorithm> #include <iostream> #include <string> #include <vector> #include <functional> #include <map> #include <iomanip> #include <math.h> #include <stack> #include <queue> #include <bitset> #include <cstdlib> #include <tuple> #include <cctype> #include <ctype.h> #include <set> #include <sstream> using namespace std; int main(){ int i, j; string s; vector<int>list(10, 0); cin >> s; for (i = 0; i < s.length(); i++) { list[s[i] - 48]++; } for (i = 9; i >= 0; i--) { if (list[i] >= 1) { for (j = 0; j < list[i]; j++) { cout << i; } } } cout << endl; getchar(); getchar(); return 0; }