제출 #132271

#제출 시각아이디문제언어결과실행 시간메모리
132271reda선물상자 (IOI15_boxes)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #define MIN(a,b) ((a) < (b) ? (a) : (b)) #include"boxes.h" using namespace std ; int delivery ( int n , int k , int l , vector<int> pos) { if(k==1){ size_t gg = pos.size(); vector<int> arr(gg); for(int i=0;i<pos.size();i++) { arr[i]=MIN(-pos[i]+l , pos[i] ); } int c=0; while (*min_element(arr.begin(),arr.end())!= (int)1e9) { //cout<<*min_element(pos.begin(),pos.end())<<endl; c+=*min_element(arr.begin(),arr.end())*2; *min_element(arr.begin(),arr.end())=(int)1e9; } return c; } } /*int main () { cout<<delivery(3,1,8,{1,2,5}); } */

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

boxes.cpp: In function 'int delivery(int, int, int, std::vector<int>)':
boxes.cpp:10:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<pos.size();i++)
                 ~^~~~~~~~~~~
boxes.cpp:5:20: warning: unused parameter 'n' [-Wunused-parameter]
 int delivery ( int n , int  k , int  l , vector<int> pos)
                    ^
boxes.cpp:24:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
/tmp/cccbdrLT.o: In function `main':
grader.c:(.text.startup+0x22f): undefined reference to `delivery(int, int, int, int*)'
collect2: error: ld returned 1 exit status