Submission #383118

# Submission time Handle Problem Language Result Execution time Memory
383118 2021-03-28T20:43:15 Z Benmath Rice Hub (IOI11_ricehub) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
int besthub(int r,long long int l,long long int x[],long long int b){   int maxi=1;
 for(int i=0;i<r;i++){
      long long int sum2=0;
      for(int j=i-1;j>=0;j--){
         sum2=sum2+x[i]-x[j];
         long long int sum3=0;
         for(int k=i;k<r;k++){
            sum3=sum3+x[k]-x[i];
            long long int sum=sum2+sum3;
            if(sum<=b){
               int x1=k-j+1;
               if(x1>maxi){
                  maxi=x1;
               }
            }
         }
      }
      
}
return maxi;
}
int main(){
   int r;
   cin>>r;
   long long int l,b;
   cin>>l>>b;
   long long int x[r];
   for(int i=0;i<r;i++){
      cin>>x[i];
   }
   cout<<besthub(r,l,x,b);
}

Compilation message

/tmp/cclbY8jo.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccicS4tm.o:ricehub.cpp:(.text.startup+0x0): first defined here
/tmp/cclbY8jo.o: In function `main':
grader.cpp:(.text.startup+0xae): undefined reference to `besthub(int, int, int*, long long)'
collect2: error: ld returned 1 exit status