Submission #113203

# Submission time Handle Problem Language Result Execution time Memory
113203 2019-05-24T10:13:50 Z ecksdee Rice Hub (IOI11_ricehub) C++11
Compilation error
0 ms 0 KB
#include "ricehub.h"
#include <bits/stdc++.h>
using namespace std;

int besthub(int R, int L, int X[], int B) {
  int maxim[R];
  memset(maxim, 1, sizeof(maxim));

  for (int i = 0; i < R; i++) {
    for (int x = i; x < R; x++) {
      if ((maxim[i] + (X[x] - X[i])) < B) {
        maxim[i] ++;
      }
    }
  }

  sort(maxim, maxim+R, greater<int>());

  return maxim[0];
}

int main() {
  int R, L, B;
  int X[5];

  cin >> R >> L >> B;

  for (int i = 0; i < R; i++) {
    cin >> X[i];
  }

  cout << besthub(R, L, X, B);
}

Compilation message

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