Submission #122529

#TimeUsernameProblemLanguageResultExecution timeMemory
122529baqargamWiring (IOI17_wiring)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
#include "wiring.h"

using namespace std;

long long min_total_length(vector<long long> r, vector<long long> b) {
    sort(r.begin(),r.end());
    sort(b.begin(),b.end());
    long long n=r.size();
    long long m=b.size();
    long long res=(b[0]-r[n-1])*max(n,m);
    for(long long i=0;i<n;i++)
        res+=r[n-1]-r[i];
    for(long long 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<long long int>, std::vector<long long int>)':
wiring.cpp:14:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
     for(long long 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;
  ^~~~~~
/tmp/ccrjnLG0.o: In function `main':
grader.cpp:(.text.startup+0x23b): undefined reference to `min_total_length(std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status