結果

問題 No.2092 Conjugation
ユーザー sorag
提出日時 2022-10-08 15:01:50
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 734 bytes
コンパイル時間 930 ms
コンパイル使用メモリ 107,040 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-22 18:10:26
合計ジャッジ時間 2,773 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<math.h>
#include<set>
#include<regex>
#include<deque>
#define all(x) x.begin(),x.end()
#define gall(x) x.begin(),x.end(),greater<>()
#define pb push_back
#define ll long long 
#define P pair<ll,ll>
#define LP pair<ll,ll>
using namespace std;
 
int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    vector<int> b(a[0] + 1);
    for(int i = 0; i < n; i++) {
        b[1] += 1;
        b[a[i] + 1] -= 1;
    }
    for (int i = 1; i <= a[0]; i++) {
        b[i + 1] += b[i];
    }
    for (int i = 1; i <= a[0]; i++) cout << b[i] << " ";
    cout << endl;
    return 0;
}
0