이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#pragma GCC target ("avx2")
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#include<bits/stdc++.h>
#include<math.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef pair<ll, ll> pl;
#define K first
#define V second
#define G(x) ll x; cin >> x;
#define GD(x) ld x; cin >> x;
#define GS(s) string s; cin >> s;
#define EX(x) { cout << x << '\n'; exit(0); }
#define A(a) (a).begin(), (a).end()
#define F(i, l, r) for (ll i = (l); i < r; ++i)
#define NN
constexpr ll MOD = 1e9;
int main(){
//    freopen("a.in", "r", stdin);
//    freopen("a.out", "w", stdout);
    ios_base::sync_with_stdio(false); cin.tie(0);
    cout << fixed << setprecision(20);
    set<ll> already;
    set<ll> candidates;
    G(n) 
    ll s = 0;
    while (n--) {
        G(b) ll a = (b + s)%MOD;
        // cout << "NSERTING " << a << endl;
        while (candidates.size() and *candidates.rbegin() > a) candidates.erase(*candidates.rbegin()); // if anything before me is greater than A, it's no longer a sepeartor
        if (already.empty() || *already.rbegin() < a) candidates.insert(a); // everything is less than me
        already.insert(a);
        s = candidates.size();
        cout << s << " "; cout << '\n';
    }
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... |