Submission #402878

#TimeUsernameProblemLanguageResultExecution timeMemory
402878EJOI2019AndrewBoxes with souvenirs (IOI15_boxes)C++14
Compilation error
0 ms0 KiB
#include "boxes.h" long long delivery(int N, int K, int L, int p[]) { if(k==1) { long long int ans = 0; for(int i = 0; i < n; ++i) ans+=min(arr[i],l-arr[i])*2; return ans; } }

Compilation message (stderr)

boxes.cpp: In function 'long long int delivery(int, int, int, int*)':
boxes.cpp:4:6: error: 'k' was not declared in this scope
    4 |   if(k==1)
      |      ^
boxes.cpp:7:28: error: 'n' was not declared in this scope
    7 |         for(int i = 0; i < n; ++i)
      |                            ^
boxes.cpp:8:22: error: 'arr' was not declared in this scope
    8 |             ans+=min(arr[i],l-arr[i])*2;
      |                      ^~~
boxes.cpp:8:29: error: 'l' was not declared in this scope
    8 |             ans+=min(arr[i],l-arr[i])*2;
      |                             ^
boxes.cpp:8:18: error: 'min' was not declared in this scope
    8 |             ans+=min(arr[i],l-arr[i])*2;
      |                  ^~~
boxes.cpp:3:24: warning: unused parameter 'N' [-Wunused-parameter]
    3 | long long delivery(int N, int K, int L, int p[]) {
      |                    ~~~~^
boxes.cpp:3:31: warning: unused parameter 'K' [-Wunused-parameter]
    3 | long long delivery(int N, int K, int L, int p[]) {
      |                           ~~~~^
boxes.cpp:3:38: warning: unused parameter 'L' [-Wunused-parameter]
    3 | long long delivery(int N, int K, int L, int p[]) {
      |                                  ~~~~^
boxes.cpp:3:45: warning: unused parameter 'p' [-Wunused-parameter]
    3 | long long delivery(int N, int K, int L, int p[]) {
      |                                         ~~~~^~~
boxes.cpp:12:1: warning: control reaches end of non-void function [-Wreturn-type]
   12 | }
      | ^