제출 #132286

#제출 시각아이디문제언어결과실행 시간메모리
132286reda선물상자 (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 ; long long delivery( long long n , long long k , long long l , long long pos[]) { if(k==1){ vector<long long > arr(n); for(long long i=0;i<n;i++) { arr[i]=MIN(-pos[i]+l , pos[i] ); } int 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; }

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

boxes.cpp: In function 'long long int delivery(long long int, long long int, long long int, long long int*)':
boxes.cpp:19:48: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
         c+=*min_element(arr.begin(),arr.end())*2;
                                                ^
/tmp/ccnUWZbP.o: In function `main':
grader.c:(.text.startup+0x22f): undefined reference to `delivery(int, int, int, int*)'
collect2: error: ld returned 1 exit status