Submission #122532

#TimeUsernameProblemLanguageResultExecution timeMemory
122532baqargamWiring (IOI17_wiring)C++14
13 / 100
40 ms3832 KiB
#include<bits/stdc++.h> #include "wiring.h" using namespace std; long long min_total_length(vector<int> r, vector<int> b) { sort(r.begin(),r.end()); sort(b.begin(),b.end()); int n=r.size(); int m=b.size(); long long res=(long long)(b[0]-r[n-1])*max(n,m); for(int i=0;i<n;i++) res+=r[n-1]-r[i]; for(int i=0;i<m;i++) res+=b[i]-b[0]; return res; }

Compilation message (stderr)

wiring.cpp: In function 'long long int min_total_length(std::vector<int>, std::vector<int>)':
wiring.cpp:14:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
     for(int i=0;i<m;i++)
     ^~~
wiring.cpp:16:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
  return res;
  ^~~~~~
#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...