Submission #197466

#TimeUsernameProblemLanguageResultExecution timeMemory
197466AaronNaidu선물상자 (IOI15_boxes)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int delivery(int n, int k, int l, int positions[]) { int sum = 0; if(k == 1) { for(int i = 0; i < n; i++) { sum += min(positions[i], n - positions[i]); } return sum; } sort(positions, positions + n); if(k == n) { if(positions[0] > (double) n/2) { return 2 * (n - positions[0]); } if(positions[n-1] < (double) n/2) { return 2 * positions[n-1]; } return n; } int delivered = 0; int frontIndex = 0; while (delivered < n) { int carrying = k; int current = 0; while (carrying and current) { /* code */ } } return n; } int main() { return 0; }

Compilation message (stderr)

boxes.cpp: In function 'int delivery(int, int, int, int*)':
boxes.cpp:24:9: warning: unused variable 'frontIndex' [-Wunused-variable]
     int frontIndex = 0;
         ^~~~~~~~~~
boxes.cpp:4:32: warning: unused parameter 'l' [-Wunused-parameter]
 int delivery(int n, int k, int l, int positions[]) {
                                ^
/tmp/ccy5zCKm.o: In function `main':
grader.c:(.text.startup+0x0): multiple definition of `main'
/tmp/cconESFn.o:boxes.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status