Submission #671755

#TimeUsernameProblemLanguageResultExecution timeMemory
671755mseebacherBoxes with souvenirs (IOI15_boxes)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef long long ll; typedef vector<int> vi; ll delivery(int N, int K, int L, int pos[]){ for(int i = 0;i<N;i++){ if(pos[i] > L/2) pos[i]-= L/2; sum += pos[i]; } return sum; }

Compilation message (stderr)

boxes.cpp: In function 'll delivery(int, int, int, int*)':
boxes.cpp:11:3: error: 'sum' was not declared in this scope
   11 |   sum += pos[i];
      |   ^~~
boxes.cpp:13:9: error: 'sum' was not declared in this scope
   13 |  return sum;
      |         ^~~
boxes.cpp:8:24: warning: unused parameter 'K' [-Wunused-parameter]
    8 | ll delivery(int N, int K, int L, int pos[]){
      |                    ~~~~^