제출 #104688

#제출 시각아이디문제언어결과실행 시간메모리
104688promota전선 연결 (IOI17_wiring)C++14
컴파일 에러
0 ms0 KiB
long long int min_total_length(int r[],int b[]){ long long int minLen=0; int n= sizeof(r)/sizeof(*r); int m=sizeof(b)/sizeof(*b); for(int j=0;j<n-1;j++){ minLen += b[0]-r[j]; } for(int i=1;i<m;i++){ minLen += b[i]-r[n-1]; } return minLen; }

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

wiring.cpp: In function 'long long int min_total_length(int*, int*)':
wiring.cpp:3:20: warning: 'sizeof' on array function parameter 'r' will return size of 'int*' [-Wsizeof-array-argument]
     int n= sizeof(r)/sizeof(*r);
                    ^
wiring.cpp:1:38: note: declared here
 long long int min_total_length(int r[],int b[]){
                                      ^
wiring.cpp:4:19: warning: 'sizeof' on array function parameter 'b' will return size of 'int*' [-Wsizeof-array-argument]
     int m=sizeof(b)/sizeof(*b);
                   ^
wiring.cpp:1:46: note: declared here
 long long int min_total_length(int r[],int b[]){
                                              ^
/tmp/ccLn0one.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