Submission #551657

# Submission time Handle Problem Language Result Execution time Memory
551657 2022-04-21T09:22:56 Z ala2 Rice Hub (IOI11_ricehub) C++14
0 / 100
207 ms 588 KB
#include "ricehub.h"
#include <iostream>
using namespace std;
int n,d;
int a[1000100];
int f(int i,int j)
{
    int x=(i+j)/2;
    x=a[x];
    int g=0;
    for(int o=i;o<=j;o++)
        g+=abs(a[o]-x);
   return g;
}
int besthub(int R, int L, int X[], long long B)
{
    n=R;
    d=L;
    for(int i=0;i<n;i++)
        a[i]=X[i];
    int mx=1;
    for(int i=0;i<n;i++)
    {
        for(int j=i+1;j<n;j++)
        {
            if(f(i,j)<=B);
            mx=max(mx,j-i+1);
        }
    }
    //cout<<mx<<endl;
    return mx;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 207 ms 588 KB Output isn't correct
2 Halted 0 ms 0 KB -