제출 #107487

#제출 시각아이디문제언어결과실행 시간메모리
107487pedro_sponchiado선물상자 (IOI15_boxes)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #include "boxes.h" using namespace std; const int maxn=10000010; long long int l[maxn], r[maxn]; long long int delivery(n, cap, tam, pos){ for(int i=1; i<=n; i++){ l[i]=2*pos[i-1]; if(i>=cap+1) l[i]+=l[i-cap]; } for(int i=1; i<=n; i++){ r[i]=2*(tam-pos[n-i]); if(i>=cap+1) r[i]+=r[i-cap]; } long long int resp=1123456789123456789; for(int i=0; i<=n; i++){ resp=min(resp, l[i]+r[n-i]); if(n-cap-i>=0) resp=min(resp, l[i]+r[n-cap-i]+tam); } return resp; }

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

boxes.cpp:7:24: error: 'long long int delivery' redeclared as different kind of symbol
 long long int delivery(n, cap, tam, pos){
                        ^
In file included from boxes.cpp:2:0:
boxes.h:4:11: note: previous declaration 'long long int delivery(int, int, int, int*)'
 long long delivery(int N, int K, int L, int p[]);
           ^~~~~~~~
boxes.cpp:7:24: error: 'n' was not declared in this scope
 long long int delivery(n, cap, tam, pos){
                        ^
boxes.cpp:7:27: error: 'cap' was not declared in this scope
 long long int delivery(n, cap, tam, pos){
                           ^~~
boxes.cpp:7:27: note: suggested alternative: 'bcmp'
 long long int delivery(n, cap, tam, pos){
                           ^~~
                           bcmp
boxes.cpp:7:32: error: 'tam' was not declared in this scope
 long long int delivery(n, cap, tam, pos){
                                ^~~
boxes.cpp:7:32: note: suggested alternative: 'tm'
 long long int delivery(n, cap, tam, pos){
                                ^~~
                                tm
boxes.cpp:7:37: error: 'pos' was not declared in this scope
 long long int delivery(n, cap, tam, pos){
                                     ^~~
boxes.cpp:7:37: note: suggested alternative: 'pow'
 long long int delivery(n, cap, tam, pos){
                                     ^~~
                                     pow