Submission #467664

# Submission time Handle Problem Language Result Execution time Memory
467664 2021-08-24T00:25:40 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)
{
	
	int suma_d=0, campos=0;
	int jamon=0;//auxiliar
 
	for(int i=0;i<R;i++){
        set<int>diferencias;
		for(int j=0;j<R;j++){
			int dif=0;
			dif = abs(X[i]-X[j]);
			diferencias.insert(dif);
		}
	
        set<int>::iterator it;
		for(it = diferencias.begin(); it != diferencias.end(); it++){
			if(suma_d + it* <= B){
				suma_d = suma_d + it*;
				campos++;
			}else break;
		}
		int maximo = max(jamon, campos);
		jamon = maximo;
		suma_d=0;
		campos=0;
		//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:23:20: error: expected primary-expression before '<=' token
   23 |    if(suma_d + it* <= B){
      |                    ^~
ricehub.cpp:24:26: error: expected primary-expression before ';' token
   24 |     suma_d = suma_d + it*;
      |                          ^