제출 #307659

#제출 시각아이디문제언어결과실행 시간메모리
307659amunduzbaevBoxes with souvenirs (IOI15_boxes)C++14
컴파일 에러
0 ms0 KiB
#include "boxes.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long

long long delivery(int n, int k, int m, int p[]) {
    ll ans=0;
    sort(p,p+n);
    if(k==1){
        for(int i=0;i<n;i++){
            int a=(p[i]<=l/2 ? p[i]:l-p[i]);
            ans+=2*a;
        }
    }

    return ans;
}

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

boxes.cpp: In function 'long long int delivery(int, int, int, int*)':
boxes.cpp:11:26: error: 'l' was not declared in this scope
   11 |             int a=(p[i]<=l/2 ? p[i]:l-p[i]);
      |                          ^
boxes.cpp:6:38: warning: unused parameter 'm' [-Wunused-parameter]
    6 | long long delivery(int n, int k, int m, int p[]) {
      |                                  ~~~~^