답안 #132289

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
132289 2019-07-18T16:20:57 Z reda 선물상자 (IOI15_boxes) C++14
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#include"boxes.h"
using namespace std ;
long long  delivery( int   n , int     k ,  int  l , vector<int> pos)
{
    if(k==1){
   
    vector<long long > arr(n);
    for(int  i=0;i<n;i++)
    {
        arr[i]=MIN(-pos[i]+l , pos[i]  );

    }
    long long  c=0;
    while (*min_element(arr.begin(),arr.end())!= (long long)1e18)
    {
    	//cout<<*min_element(pos.begin(),pos.end())<<endl;
        c+=*min_element(arr.begin(),arr.end())*2;
        *min_element(arr.begin(),arr.end())=(long long )1e18;
    }
    return c;
    }
    return 0;
}

Compilation message

/tmp/cc5smrtg.o: In function `main':
grader.c:(.text.startup+0x22f): undefined reference to `delivery(int, int, int, int*)'
collect2: error: ld returned 1 exit status