Submission #467669

# Submission time Handle Problem Language Result Execution time Memory
467669 2021-08-24T00:40:23 Z jam_xd_ Rice Hub (IOI11_ricehub) C++17
42 / 100
1000 ms 648 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++){

        deque<long long>diferencias(R);
		for(int j=0;j<R;j++)diferencias[j] = abs(X[i]-X[j]);
		
		sort(diferencias.begin(), diferencias.end());
		for(int k=0;k<diferencias.size();k++){
			if(suma_d + diferencias[k] <= B){
				suma_d += diferencias[k];
				campos++;
			}else break;
		}

		int maximo = max(jamon, campos);
		jamon = maximo;
		suma_d=0;
		campos=0;
	}
  return jamon;
}

Compilation message

ricehub.cpp: In function 'int besthub(int, int, int*, long long int)':
ricehub.cpp:19:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::deque<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |   for(int k=0;k<diferencias.size();k++){
      |               ~^~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 296 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 0 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 0 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 1 ms 204 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Correct 1 ms 204 KB Output is correct
21 Correct 6 ms 204 KB Output is correct
22 Correct 8 ms 304 KB Output is correct
23 Correct 10 ms 204 KB Output is correct
24 Correct 10 ms 300 KB Output is correct
25 Correct 9 ms 204 KB Output is correct
26 Correct 9 ms 300 KB Output is correct
27 Correct 9 ms 204 KB Output is correct
28 Correct 9 ms 300 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 2 ms 204 KB Output is correct
3 Correct 40 ms 292 KB Output is correct
4 Correct 33 ms 312 KB Output is correct
5 Correct 6 ms 204 KB Output is correct
6 Correct 6 ms 204 KB Output is correct
7 Correct 25 ms 204 KB Output is correct
8 Correct 27 ms 204 KB Output is correct
9 Correct 9 ms 204 KB Output is correct
10 Correct 9 ms 204 KB Output is correct
11 Correct 24 ms 204 KB Output is correct
12 Correct 24 ms 312 KB Output is correct
13 Correct 41 ms 204 KB Output is correct
14 Correct 40 ms 204 KB Output is correct
15 Correct 9 ms 308 KB Output is correct
16 Correct 11 ms 300 KB Output is correct
17 Correct 25 ms 204 KB Output is correct
18 Correct 24 ms 308 KB Output is correct
19 Correct 41 ms 292 KB Output is correct
20 Correct 39 ms 204 KB Output is correct
21 Correct 721 ms 336 KB Output is correct
22 Correct 727 ms 340 KB Output is correct
23 Execution timed out 1092 ms 332 KB Time limit exceeded
24 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1093 ms 648 KB Time limit exceeded
2 Halted 0 ms 0 KB -