제출 #224672

#제출 시각아이디문제언어결과실행 시간메모리
224672Amy313쌀 창고 (IOI11_ricehub)C++14
42 / 100
1094 ms640 KiB
#include "ricehub.h" #include<bits/stdc++.h> using namespace std; int besthub(int R, int L, int X[], long long B) {vector<int>V; int maxi= 0, c, a; long long cp = B; for(int i=1; i<=L; i++) { c = 0; cp = B; V.clear(); for(int j=0; j<R; j++) { a = abs(i-X[j]); V.push_back(a); } sort(V.begin(), V.end()); for(int j=0; j<V.size(); j++) { if(V[j]<=cp) { cp-=V[j]; 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:19:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int j=0; j<V.size(); j++)
                ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...