Submission #597123

#TimeUsernameProblemLanguageResultExecution timeMemory
597123Ahmadsm2005Wiring (IOI17_wiring)C++14
0 / 100
1 ms212 KiB
#include "bits/stdc++.h" //#include "grader.cpp" using namespace std; long long min_total_length(std::vector<int> r, std::vector<int> b) { if(b.size()>r.size()) swap(r,b); long long ANS=0; for(int i=0;i<r.size();i++){ ANS+=abs(b[min((int)b.size()-1,i)]-r[i]); } return ANS; }

Compilation message (stderr)

wiring.cpp: In function 'long long int min_total_length(std::vector<int>, std::vector<int>)':
wiring.cpp:8:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 | for(int i=0;i<r.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...