結果

問題 No.2092 Conjugation
ユーザー penguin8331penguin8331
提出日時 2022-10-21 13:48:34
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 868 bytes
コンパイル時間 1,587 ms
コンパイル使用メモリ 171,728 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-09-13 15:16:07
合計ジャッジ時間 5,752 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
#if 1 && defined(LOCAL)
#include <debug.hpp>
#else
#define debug(...)
#define line
#endif
using namespace std;
using ll = long long;
using ld = long double;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
template<typename T> inline bool chmax(T &a, T b) { return ((a < b) ? (a = b, true) : (false)); }
template<typename T> inline bool chmin(T &a, T b) { return ((a > b) ? (a = b, true) : (false)); }

int main(){
    int N;
    cin>>N;
    vector<int>A(100000,0);
    int max=0;
    for(int i=0;i<N;i++){
        int a;
        cin>>a;
        if(chmax(max,a))A.resize(a,0);
        a--;
        A[a]++;
    }
    int now=0;
    stack<int>sta;
    for(int i=A.size()-1;i>=0;i--){
        now+=A[i];
        sta.push(now);
    }
    while(!sta.empty()){
        cout<<sta.top()<<endl;
        sta.pop();
    }
}
0