Submission #785264

#TimeUsernameProblemLanguageResultExecution timeMemory
785264makanhuliaGlobal Warming (CEOI18_glo)C++17
0 / 100
2081 ms4980 KiB
#include<bits/stdc++.h> #define ll long long #define fi first #define sec second #define pb push_back #define pqueue priority_queue #define int long long #define pii pair<int,int> #define supercepat ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(0); using namespace std; int tc,ans=0,n,x; int a[200005]; int b[200005]; int copa[200005]; int rec[200005]; void findlis(){ for(int i=1;i<=n;i++){ rec[i]=0; } rec[1]=1; for(int i=1;i<=n;i++){ for(int j=1;j<=i;j++){ if(copa[j]<copa[i]) rec[i]=max(rec[i],rec[j]); } rec[i]++; } ans=max(ans,rec[n]); } void solve(int x,int y,int z){ for(int i=1;i<=n;i++){ copa[i]=a[i]; if(x<=i&&i<=y) copa[i]+=z; } findlis(); for(int i=1;i<=n;i++){ copa[i]=a[i]; if(x<=i&&i<=y) copa[i]+=z; } findlis(); } main(){ supercepat; cin>>n>>x; for(int i=1;i<=n;i++) cin>>a[i]; for(int i=1;i<=n;i++){ for(int j=i;j<=n;j++){ for(int k=-x;k<=x;k++){ solve(i,j,k); } } } cout<<ans<<endl; }

Compilation message (stderr)

glo.cpp:41:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   41 | main(){
      | ^~~~
#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...