제출 #1155180

#제출 시각아이디문제언어결과실행 시간메모리
1155180aarb_.tomatexdBoxes with souvenirs (IOI15_boxes)C++20
컴파일 에러
0 ms0 KiB
#include "boxes.h" #include <bits/stdc++.h> using namespace std; #define ll long long ll delivery(int N, int K, int L, int positions[]) { ll time = 0; // Ordenamos las posiciones de los equipos vector<int> pos(N); for (int i = 0; i < N; i++) { pos[i] = positions[i]; } sort(pos.begin(), pos.end()); // Vamos recorriendo en grupos de tamaño máximo K for (int i = N - 1; i >= 0; i -= K) { time += 2 * min(pos[i], l-pos[i]); // Ida y vuelta al punto más lejano en este viaje } return time; }

컴파일 시 표준 에러 (stderr) 메시지

boxes.cpp: In function 'long long int delivery(int, int, int, int*)':
boxes.cpp:18:33: error: 'l' was not declared in this scope
   18 |         time += 2 * min(pos[i], l-pos[i]); // Ida y vuelta al punto más lejano en este viaje
      |                                 ^