Submission #197471

#TimeUsernameProblemLanguageResultExecution timeMemory
197471AaronNaidu선물상자 (IOI15_boxes)C++14
0 / 100
2097 ms376 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) l/2) {
            return 2 * (n - positions[0]);
        }
        if(positions[n-1] < (double) l/2) {
            return 2 * positions[n-1];
        }
        return l;
    }
    
    int delivered = 0;
    int frontIndex = 0;
    
    while (delivered < n)
    {
        int carrying = k;
        int current = 0;
        while (carrying and current)
        {
            /* code */
        }
        
    }
    return n;
}

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;
         ^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...