結果
問題 | No.1628 Sorting Integers (MAX of M) |
ユーザー | kaede2020 |
提出日時 | 2021-07-30 21:11:52 |
言語 | C++14 (gcc 13.2.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,495 bytes |
コンパイル時間 | 3,705 ms |
コンパイル使用メモリ | 227,140 KB |
実行使用メモリ | 4,352 KB |
最終ジャッジ日時 | 2023-10-14 02:37:08 |
合計ジャッジ時間 | 4,466 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge12 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,352 KB |
testcase_01 | AC | 1 ms
4,352 KB |
testcase_02 | AC | 1 ms
4,352 KB |
testcase_03 | AC | 1 ms
4,348 KB |
testcase_04 | AC | 1 ms
4,352 KB |
testcase_05 | AC | 2 ms
4,348 KB |
testcase_06 | AC | 2 ms
4,352 KB |
testcase_07 | AC | 1 ms
4,348 KB |
testcase_08 | AC | 1 ms
4,352 KB |
testcase_09 | AC | 2 ms
4,352 KB |
ソースコード
#include <bits/stdc++.h> using namespace std; #include <atcoder/all> using namespace atcoder; //using mint = modint1000000007; using mint = modint998244353; //std::chrono::time_point<std::chrono::steady_clock> start; template <typename T> bool chmax(T &u, const T z) { if (u < z) {u = z; return true;} else return false; } template <typename T> bool chmin(T &u, const T z) { if (u > z) {u = z; return true;} else return false; } #define ll long long #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) typedef pair<ll, int> P; ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; } ll lcm(ll a, ll b){return a * b / gcd(a, b);} template<class T, class U> //contain(string s,string v) sにvが含まれるかを判定 bool contain(const std::basic_string<T>& s, const U& v) { return s.find(v) != std::basic_string<T>::npos; } const int mod=1000000007; struct combination { vector<mint> fact, ifact; combination(int n):fact(n+1),ifact(n+1) { assert(n < mod); fact[0] = 1; for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i; ifact[n] = fact[n].inv(); for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i; } mint operator()(int n, int k) { if (k < 0 || k > n) return 0; return fact[n]*ifact[k]*ifact[n-k]; } }; int kazu[10]; int main(){ int n; cin>>n; rep(i,9){ int x; cin>>x; kazu[i]=x; } for(int i=9;i>=0;i--){ //cout<<kazu[i]; if(kazu[i]>0){ rep(j,kazu[i]){ cout<<i+1; } } } cout<<endl; return 0; }