d078. P-6-15. 一覽衆山小 - TCFSH CIRC Judge

本文最後更新於:2024年1月12日 下午

d078. P-6-15. 一覽衆山小 - TCFSH CIRC Judge

AP325-d078.cpp

// Author : ysh
// 04/29/2022 Fri 10:15:44.92
#include<bits/stdc++.h>
using namespace std;
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n;cin>>n;
    vector<int>f(n);
    for(int &i : f) {
        cin>>i;
    }
    vector<int>v;
    for(int i : f) {
        auto found = lower_bound(v.begin(),v.end(),i);
        if(found == v.end()) v.push_back(i);
        else *found = i;
    }
    cout<<v.size();
    return 0;
}

d078. P-6-15. 一覽衆山小 - TCFSH CIRC Judge
http://mysh212.github.io/algosolution/AP325-d078.cpp/
作者
ysh
發布於
2022年4月29日
更新於
2024年1月12日
許可協議