結果

問題 No.2092 Conjugation
コンテスト
ユーザー SnowBeenDiding
提出日時 2026-03-20 20:40:24
言語 C++23
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 13 ms / 2,000 ms
コード長 1,019 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 5,942 ms
コンパイル使用メモリ 420,152 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2026-03-20 20:40:35
合計ジャッジ時間 8,098 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>

#include <atcoder/all>
#define rep(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
using namespace atcoder;
using namespace std;

typedef long long ll;

template <typename T>
int smaller(vector<T> &a, T x) {
    return lower_bound(a.begin(), a.end(), x) - a.begin();
}
template <typename T>
int or_smaller(vector<T> &a, T x) {
    return upper_bound(a.begin(), a.end(), x) - a.begin();
}
template <typename T>
int bigger(vector<T> &a, T x) {
    return a.size() - or_smaller(a, x);
}
template <typename T>
int or_bigger(vector<T> &a, T x) {
    return a.size() - smaller(a, x);
}

void solve() {
    int n;
    cin >> n;
    vector<int> a(n);
    for (auto i = n - 1; i >= 0; i--) cin >> a[i];
    rep(i, 0, a[n - 1]) cout << or_bigger(a, (int)i + 1) << ' ';
    cout << endl;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(15);
    solve();
}
0