Submission #104694

#TimeUsernameProblemLanguageResultExecution timeMemory
104694promotaWiring (IOI17_wiring)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> long long min_total_length(std::vector<int> r,std::vector<int> b){ long long minLen=0; if(b.size()<=r.size()){ int k=r.size()-b.size(); for(int i=0;i<b.size();i++){ minLen += arr[i]-arr[r.size()-i-1]; } for(int i=0;i<k;i++) minLen += b[0]-r[i]; } else{ int k=b.size()-r.size(); for(int i=0;i<r.size();i++){ minLen += arr[i]-arr[r.size()-i-1]; } for(int i=r.size();i<b.size();i++) minLen += b[i]-r[r.size()-1]; } return minLen; }

Compilation message (stderr)

wiring.cpp: In function 'long long int min_total_length(std::vector<int>, std::vector<int>)':
wiring.cpp:6:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for(int i=0;i<b.size();i++){
                   ~^~~~~~~~~
wiring.cpp:7:19: error: 'arr' was not declared in this scope
         minLen += arr[i]-arr[r.size()-i-1];
                   ^~~
wiring.cpp:14:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for(int i=0;i<r.size();i++){
                   ~^~~~~~~~~
wiring.cpp:15:19: error: 'arr' was not declared in this scope
         minLen += arr[i]-arr[r.size()-i-1];
                   ^~~
wiring.cpp:17:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for(int i=r.size();i<b.size();i++)
                          ~^~~~~~~~~
wiring.cpp:13:11: warning: unused variable 'k' [-Wunused-variable]
       int k=b.size()-r.size();
           ^