Submission #644378

#TimeUsernameProblemLanguageResultExecution timeMemory
644378KarukGlobal Warming (CEOI18_glo)C++14
0 / 100
104 ms18708 KiB
#include<bits/stdc++.h> using namespace std; long long max(long long &a,long long &b) {return a>b?a:b;} int main() { long long n,x;cin>>n>>x; long long a[n]; long long pos[n]; vector<long long>lis(n,1e18); vector<vector<long long> >history(n,{(long long)(1e18)}); long long ans=0; for(int i=0;i<n;i++) { long long y;cin>>y; long long pos=lower_bound(lis.begin(),lis.end(),y)-lis.begin(); history[pos].push_back(y); lis[pos]=y; ans=max(ans,pos); } cout<<ans<<endl; vector<long long>revlis(n,1e18); return 0; }

Compilation message (stderr)

glo.cpp: In function 'int main()':
glo.cpp:6:15: warning: unused variable 'a' [-Wunused-variable]
    6 |     long long a[n];
      |               ^
glo.cpp:7:15: warning: unused variable 'pos' [-Wunused-variable]
    7 |     long long pos[n];
      |               ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...