結果

問題 No.2092 Conjugation
ユーザー hoktohokto
提出日時 2022-10-07 21:27:42
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 18 ms / 2,000 ms
コード長 1,669 bytes
コンパイル時間 1,989 ms
コンパイル使用メモリ 200,928 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-03 00:07:10
合計ジャッジ時間 3,460 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define Rep(i,h,t) for(int i=(int)h;i<(int)t;i++)
#define Rrep(i,n) for(int i=(int)n;i>=0;i--)
#define RRep(i,h,t) for(int i=(int)h;i>=(int)t;i--)
#define UNIQ(v) v.erase(unique(v.begin(),v.end()),v.end());
#define pb push_back
#define Fi first
#define Se second

template<typename T>
bool chmax(T& vmax,const T& v)
{
    if(vmax<v)
    {
        vmax=v;
        return true;
    }
    return false;
}

template<typename T>
bool chmin(T& vmin,const T& v)
{
    if(vmin>v)
    {
        vmin=v;
        return true;
    }
    return false;
}

using namespace std;

using ll=long long;
using lb=long double;
using veci=vector<int>;
using vec2i=vector<vector<int>>;
using vecll=vector<ll>;
using vec2ll=vector<vector<ll>>;
using p2i=pair<int,int>;
using p2ll=pair<ll,ll>;
using m2i=map<int,int>;
using m2ll=map<ll,ll>;
using msi=map<string,int>;


ll gcd(ll a,ll b)
{
    if(b==0)
    {
        return a;
    }
    return gcd(b,a%b);
}

ll lcm(ll a,ll b)
{
    return ll(a/gcd(a,b))*b;
}

void yn_out(bool b,string yes_out="Yes",string no_out="No")
{
    cout<<(b ? yes_out : no_out)<<endl;
}

ll ceilll(ll a,ll b)
{
    return (a+b-1)/b;
}

const int MOD=1e9+7;
//const int MOD=998244353;
const int dirx[4]={1,0,-1,0};
const int diry[4]={0,1,0,-1};


int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    //cout<<fixed<<setprecision(9);
    int N;
    cin>>N;
    int A;
    cin>>A;
    veci ans(A+1,0);
    rep(i,N-1){
        int a;
        cin>>a;
        ans[a]--;
    }
    int sum=N;
    rep(i,A){
        sum+=ans[i];
        cout<<sum<<" ";
    }
    cout<<endl;
    return 0;
}
0