제출 #783291

#제출 시각아이디문제언어결과실행 시간메모리
783291Gabriel2222Boxes with souvenirs (IOI15_boxes)C++14
컴파일 에러
0 ms0 KiB
#include "boxes.h" #include "bits/stdc++.h" using namespace std; long long delivery(int N, int K, int L, int p[]) { long long respuesta = 0; long long _ndice = 0; long long mitad = L / 2; if(K == 1){ while(_ndice < N){ //cout<<p[_ndice]<<"\n"; if(p[_ndice] > mitad) respuesta += (L - p[_ndice]) * 2; else respuesta += p[_ndice] * 2; _ndice++; } } else { if(p[N - 1] > mitad) respuesta = L; else respuesta = p[N - 1] * 2; long long otro; if(p[0] > mitad) otro = (L - p[o]) * 2; else otro = L; respuesta = min(otro, respuesta); } return respuesta; }

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

boxes.cpp: In function 'long long int delivery(int, int, int, int*)':
boxes.cpp:19:40: error: 'o' was not declared in this scope
   19 |         if(p[0] > mitad) otro = (L - p[o]) * 2;
      |                                        ^