제출 #1060883

#제출 시각아이디문제언어결과실행 시간메모리
1060883vjudge1전선 연결 (IOI17_wiring)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long ll min_total_length(int r[],int b[]){ ll ans=0; ll n=sizeof(r)/sizeof(r[0]); ll m=sizeof(b)/sizeof(b[0]); for(int i=0;i<n;i++) ans+=r[n-1]-r[i]; for(int i=0;i<m;i++) ans+=b[i]-r[n-1]; ans+=max(0LL,n-m)*(b[0]-r[n-1]); return ans; } // int main(){ // }

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

wiring.cpp: In function 'long long int min_total_length(int*, int*)':
wiring.cpp:8:14: warning: 'sizeof' on array function parameter 'r' will return size of 'int*' [-Wsizeof-array-argument]
    8 |  ll n=sizeof(r)/sizeof(r[0]);
      |             ~^~
wiring.cpp:6:25: note: declared here
    6 | ll min_total_length(int r[],int b[]){
      |                     ~~~~^~~
wiring.cpp:9:14: warning: 'sizeof' on array function parameter 'b' will return size of 'int*' [-Wsizeof-array-argument]
    9 |  ll m=sizeof(b)/sizeof(b[0]);
      |             ~^~
wiring.cpp:6:33: note: declared here
    6 | ll min_total_length(int r[],int b[]){
      |                             ~~~~^~~
/usr/bin/ld: /tmp/ccOlVbZE.o: in function `main':
grader.cpp:(.text.startup+0x23a): 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