結果

問題 No.2092 Conjugation
ユーザー shkiiii_shkiiii_
提出日時 2022-10-07 21:25:13
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 35 ms / 2,000 ms
コード長 667 bytes
コンパイル時間 1,483 ms
コンパイル使用メモリ 165,456 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-02 23:48:54
合計ジャッジ時間 3,014 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 8 ms
4,376 KB
testcase_08 AC 24 ms
4,380 KB
testcase_09 AC 14 ms
4,376 KB
testcase_10 AC 16 ms
4,376 KB
testcase_11 AC 17 ms
4,380 KB
testcase_12 AC 14 ms
4,380 KB
testcase_13 AC 10 ms
4,380 KB
testcase_14 AC 10 ms
4,376 KB
testcase_15 AC 14 ms
4,376 KB
testcase_16 AC 29 ms
4,376 KB
testcase_17 AC 35 ms
4,380 KB
testcase_18 AC 32 ms
4,380 KB
testcase_19 AC 12 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
// #include<atcoder/all>
// #include<boost/multiprecision/cpp_int.hpp>

using namespace std;
// using namespace atcoder;
// using bint = boost::multiprecision::cpp_int;
using ll = long long;
using ull = unsigned long long;
using P = pair<int,int>;
#define rep(i,n) for(ll i = 0;i < (ll)n;i++)
#define ALL(x) (x).begin(),(x).end()
#define MOD 1000000007
// #define MOD 998244353


int main(){
  
  int n;
  cin >> n;
  vector<int> v(n);
  rep(i,n)cin >> v[i];
  vector<int> res(v[0],0);
  rep(i,n){
    res[v[i]-1]++;
  }
  for(int i = v[0]-1;i > 0;i--)res[i-1] += res[i];
  rep(i,v[0])cout << res[i] << " \n"[i+1 == v[0]];
  
  

  return 0;
}
0