Submission #70620

# Submission time Handle Problem Language Result Execution time Memory
70620 2018-08-23T07:43:28 Z doowey Rice Hub (IOI11_ricehub) C++14
Compilation error
0 ms 0 KB
#include "grader.h"
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

ll ab(ll x){
  return max(x, -x);
}

int besthub(int n, int L, int X[], ll B){  
  int l = 1, r = n;
  int k;
  bool ok;
  int med;
  ll sum = 0;
  while(l < r){
    k = (l + r)/2;
    cout << k << "  ";
    ok = false;
    for(int i = 0;i <= n-k;i ++ ){
      med = (i + k - 1) / 2;
      sum = 0;
      for(int j = 0;j < k;j ++ ){
        sum += ab(X[i + j] - X[med]);
      }
      if(sum <= B)
        ok = true;
    }
    if(ok)
      l = k;
    else
      r = k - 1;
  }
  return l;
}

Compilation message

ricehub.cpp:1:10: fatal error: grader.h: No such file or directory
 #include "grader.h"
          ^~~~~~~~~~
compilation terminated.