제출 #224620

#제출 시각아이디문제언어결과실행 시간메모리
224620DanerZeinRice Hub (IOI11_ricehub)C++14
컴파일 에러
0 ms0 KiB
#include "ricehub.h" #include <bits/stdc++.h> using namespace std; int besthub(int R,int L,int X[], long long B){ long long ma=-1; for(int i=0;i<R;i++){ for(int j=i;j<R;j++){ vector<int>rp; for(int k=i;k<=j;k++){ rp.push_back(X[k]); } int mi=(i+j)/2; mi=X[mi]; bool sw=0; long long b=B; for(int k=0;k<rp.size();k++){ if(b<=0){ sw=1; break; } b-=abs(X[mi]-rp[k]); //c++; } if(sw==1){ long long tam=rp.size(); ma=max(ma,tamxo); } } } return ma; }

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

ricehub.cpp: In function 'int besthub(int, int, int*, long long int)':
ricehub.cpp:16:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for(int k=0;k<rp.size();k++){
                   ~^~~~~~~~~~
ricehub.cpp:26:12: error: 'tamxo' was not declared in this scope
  ma=max(ma,tamxo);
            ^~~~~
ricehub.cpp:26:12: note: suggested alternative: 'tam'
  ma=max(ma,tamxo);
            ^~~~~
            tam
ricehub.cpp:25:12: warning: unused variable 'tam' [-Wunused-variable]
  long long tam=rp.size();
            ^~~