Submission

Status:

----------

Subtask/Task Score:

0/100

Score: 0

User: Hxluk.ka

Problemset: Consecutive Subsequence

Language: cpp

Time: 0.002 second

Submitted On: 2026-03-15 20:18:56

#include <iostream>
#include <vector>
using namespace std;
int main() {
    cin.tie(0)->sync_with_stdio(0);

    int x;
    vector<int> v;
    while (cin>>x) {
        int idx=lower_bound(v.begin(), v.end(), x)-v.begin();
        if (idx==v.size()) v.push_back(x); else v[idx]=x;
    }
    for (auto x:v) cout<<x<<' ';
}