Submission #419146

#TimeUsernameProblemLanguageResultExecution timeMemory
419146LouayFarahBoxes with souvenirs (IOI15_boxes)C++14
Compilation error
0 ms0 KiB
#include "bits/stdc++.h" #include "boxes.h" using namespace std; int delivery(int n, int k, int l, int positions[]) { if(k==1) { int res = 0; for(int i = 0; i<n; i++) { if(positions[i]>l/2) { res+=2*(l-positions[i]); } else { res+=2*(positions[i]); } } return res; } else if(k==n) { } else { } }

Compilation message (stderr)

boxes.cpp:5:5: error: ambiguating new declaration of 'int delivery(int, int, int, int*)'
    5 | int delivery(int n, int k, int l, int positions[])
      |     ^~~~~~~~
In file included from boxes.cpp:2:
boxes.h:4:11: note: old declaration 'long long int delivery(int, int, int, int*)'
    4 | long long delivery(int N, int K, int L, int p[]);
      |           ^~~~~~~~
boxes.cpp: In function 'int delivery(int, int, int, int*)':
boxes.cpp:31:1: warning: control reaches end of non-void function [-Wreturn-type]
   31 | }
      | ^