# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
662170 | Darren0724 | Financial Report (JOI21_financial) | C++17 | 53 ms | 8364 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) x.begin(),x.end()
const int INF=1e18;
const int mod=1e9+7;
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
int n,k;cin>>n>>k;
vector<int> v(n);
vector<int> a;
for(int i=0;i<n;i++){
cin>>v[i];
}
reverse(all(v));
for(int i=0;i<n;i++){
v[i]=-v[i];
}
for(int i=0;i<n;i++){
int p=lower_bound(all(a),v[i])-a.begin();
if(p>=a.size()){
a.push_back(v[i]);
}
else{
a[p]=v[i];
}
}
cout<<a.size()<<endl;
return 0;
}
Compilation message (stderr)
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |