Submission #785299

#TimeUsernameProblemLanguageResultExecution timeMemory
785299devariaotaGlobal Warming (CEOI18_glo)C++17
15 / 100
2082 ms4948 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; 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[i]); } } 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(); } 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++){ // cout<<i<<" "<<j<<" "<<k<<endl; solve(i,j,k); } } } cout<<ans<<endl; }

Compilation message (stderr)

glo.cpp:33:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   33 | 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...