제출 #130585

#제출 시각아이디문제언어결과실행 시간메모리
130585reda전선 연결 (IOI17_wiring)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #include "wiring.h" #define ll long long using namespace std ; ll min_total_length(int r[], int b[]) { ll sr = sizeof(r) / sizeof(int); ll sb = sizeof(b) / sizeof(int); ll c=0; for(int i=0;i<min(sr,sb);i++) { c+=abs(r[i%sr]-b[i%sb]); } if(sb<sr){ for(int i = sb ;i<sr;i++ ) c+=abs(r[sr-1]-b[i]); } else for(int i = sr ;i<sb;i++ ) c+=abs(b[sb-1]-r[i]); return c; }

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

wiring.cpp: In function 'long long int min_total_length(int*, int*)':
wiring.cpp:8:22: warning: 'sizeof' on array function parameter 'r' will return size of 'int*' [-Wsizeof-array-argument]
     ll  sr = sizeof(r) / sizeof(int);
                      ^
wiring.cpp:6:27: note: declared here
 ll min_total_length(int r[], int b[])
                           ^
wiring.cpp:9:22: warning: 'sizeof' on array function parameter 'b' will return size of 'int*' [-Wsizeof-array-argument]
     ll sb  = sizeof(b) / sizeof(int);
                      ^
wiring.cpp:6:36: note: declared here
 ll min_total_length(int r[], int b[])
                                    ^
/tmp/cckRP5bs.o: In function `main':
grader.cpp:(.text.startup+0x23b): undefined reference to `min_total_length(std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status