Submission #136651

#TimeUsernameProblemLanguageResultExecution timeMemory
136651StevenHWiring (IOI17_wiring)C++14
13 / 100
37 ms1912 KiB
#include "wiring.h" #include <iostream> using namespace std; long long min_total_length(std::vector<int> r, std::vector<int> b) { long long ans=0; for(int i=0;i<r.size();i++) { ans+=b[0]-r[i]; } for(int i=0;i<b.size();i++) { ans+=b[i]-r[r.size()-1]; } int res=min(r.size(),b.size()); for(int i=0;i<res;i++) { ans-=b[0]-r[r.size()-1]; } return ans; }

Compilation message (stderr)

wiring.cpp: In function 'long long int min_total_length(std::vector<int>, std::vector<int>)':
wiring.cpp:8:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<r.size();i++)
                 ~^~~~~~~~~
wiring.cpp:12:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<b.size();i++)
                 ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...