제출 #224636

#제출 시각아이디문제언어결과실행 시간메모리
224636Amy313쌀 창고 (IOI11_ricehub)C++14
0 / 100
20 ms768 KiB
#include "ricehub.h"
#include<bits/stdc++.h>
int besthub(int R, int L, int X[], long long B)
{
	int r, maxi= -1, cp = B, c, a;
	for(int i=0; i<R; i++)
	{
		c = 0;
		r = i;
		cp = B;
		for(int j=0; j<R; j++)
		{
			a = abs(X[i]-X[j]);
			if(a<=cp)
			{
				cp-=a;
				c++;
			}
			else
			{
				break;
			}
		}
		if(c>maxi)
		{
			maxi = c;
		}
	}
  return maxi;
}

컴파일 시 표준 에러 (stderr) 메시지

ricehub.cpp: In function 'int besthub(int, int, int*, long long int)':
ricehub.cpp:5:6: warning: variable 'r' set but not used [-Wunused-but-set-variable]
  int r, maxi= -1, cp = B, c, a;
      ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...