Submission #104688

#TimeUsernameProblemLanguageResultExecution timeMemory
104688promotaWiring (IOI17_wiring)C++14
Compilation error
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; }

Compilation message (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