Submission #224724

# Submission time Handle Problem Language Result Execution time Memory
224724 2020-04-18T16:21:41 Z Cameyoshi Rice Hub (IOI11_ricehub) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>

using namespace std;
int besthub(int R,int L,int x[],long long B)

{
    int mn=2000000001;
    int sol;
    for(int i=0;i<L;i++){
        int s=0;
        int c=0;
        vector<int>V;
        for(int j=0;j<X.size();j++)V.push_back(abs(i-X[j]);
        sort(V.begin(),V.end());
        for(int j=0;j<V.size();j++){
            if(s+V[j]<=B){}
        }
    }
    return 0;
}

Compilation message

ricehub.cpp: In function 'int besthub(int, int, int*, long long int)':
ricehub.cpp:13:23: error: 'X' was not declared in this scope
         for(int j=0;j<X.size();j++)V.push_back(abs(i-X[j]);
                       ^
ricehub.cpp:15:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int j=0;j<V.size();j++){
                     ~^~~~~~~~~
ricehub.cpp:11:13: warning: unused variable 'c' [-Wunused-variable]
         int c=0;
             ^
ricehub.cpp:7:9: warning: unused variable 'mn' [-Wunused-variable]
     int mn=2000000001;
         ^~
ricehub.cpp:8:9: warning: unused variable 'sol' [-Wunused-variable]
     int sol;
         ^~~