Submission #232378

# Submission time Handle Problem Language Result Execution time Memory
232378 2020-05-16T21:41:34 Z jam_xd_ Rice Hub (IOI11_ricehub) C++17
Compilation error
0 ms 0 KB
#include "ricehub.h"
#include <bits/stdc++.h>

using namespace std; //si solo era esto me muero >:v.

int besthub(int R, int L, int X[], long long B)
{

	vector<long long>diferencias;
	int suma_d=0, campos=0;
	int jamon=0;//auxiliar

	for(int i=1;i<=L;i++){
		for(int j=0;j<X.size();j++){
			int dif=0;
			//dif = i-X[j];
			 // if(dif <= 0)dif = dif * -1;
          
			dif = abs(i-X[j]);
			diferencias.push_back(dif);
		}

			

			for(int k=0;k<X.size();k++){
				if(suma_d + V[j] <= B){
					suma_d = suma_d + V[j];
					campos++;
				}else{
					continue;
				}
			}
				int maximo = max(jamon, campos);
				jamon = maximo;
				//comparar anterior y el de ahora 
				//y me quedo con el mayor.
			
	}




  return jamon;
}

Compilation message

ricehub.cpp: In function 'int besthub(int, int, int*, long long int)':
ricehub.cpp:14:19: error: request for member 'size' in 'X', which is of non-class type 'int*'
   for(int j=0;j<X.size();j++){
                   ^~~~
ricehub.cpp:25:20: error: request for member 'size' in 'X', which is of non-class type 'int*'
    for(int k=0;k<X.size();k++){
                    ^~~~
ricehub.cpp:26:17: error: 'V' was not declared in this scope
     if(suma_d + V[j] <= B){
                 ^
ricehub.cpp:26:19: error: 'j' was not declared in this scope
     if(suma_d + V[j] <= B){
                   ^