Submission #551660

# Submission time Handle Problem Language Result Execution time Memory
551660 2022-04-21T09:25:48 Z ala2 Rice Hub (IOI11_ricehub) C++14
0 / 100
210 ms 444 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);
        }
    }
    int ann=mx;
    //cout<<mx<<endl;
    return ann;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 210 ms 444 KB Output isn't correct
2 Halted 0 ms 0 KB -