Submission #822956

#TimeUsernameProblemLanguageResultExecution timeMemory
822956ShithilaWiring (IOI17_wiring)C++14
13 / 100
22 ms1864 KiB
#include "wiring.h" #include<bits/stdc++.h> using namespace std; long long min_total_length(std::vector<int> r, std::vector<int> b) { int rlen=r.size(); int blen=b.size(); long long x=0; int y=0; if(rlen<blen) { for(int i=0;i<blen;i++) { x+=b[i]-r[rlen-1]; } for(int i=0;i<rlen-1;i++) { x+=r[rlen-1]-r[i]; } } else { for(int i=0;i<rlen;i++) { x+=b[0]-r[i]; } for(int i=1;i<blen;i++) { x+=b[i]-b[0]; } } return x; }

Compilation message (stderr)

wiring.cpp: In function 'long long int min_total_length(std::vector<int>, std::vector<int>)':
wiring.cpp:8:6: warning: unused variable 'y' [-Wunused-variable]
    8 |  int y=0;
      |      ^
#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...