Submission #640163

#TimeUsernameProblemLanguageResultExecution timeMemory
640163trunghieuWiring (IOI17_wiring)C++14
Compilation error
0 ms0 KiB
#include "wiring.h" #include "grader.cpp"; typedef long long ll; const int N = 205; const ll oo = 1e18; bool mark[N]; long long min_total_length(std::vector<int> r, std::vector<int> b) { int n = r.size(); int m = b.size(); if (n < m) { swap(n, m); swap(r, b); } ll rs = 0; for (int i = 0; i < m; ++i) { ll Min = oo; int pos = -1; for (int j = 0; j < n; ++j) if (!mark[j]) { if (abs(r[j] - b[i]) < Min) { Min = abs(r[j] - b[i]); pos = j; } } mark[pos] = 1; rs += Min; } for (int i = 0; i < n; ++i) if (!mark[i]) { ll Min = oo; for (int j = 0; j < m; ++j) Min = min(Min, (ll)abs(r[i] - b[j])); rs += Min; } return rs; }

Compilation message (stderr)

wiring.cpp:2:22: warning: extra tokens at end of #include directive
    2 | #include "grader.cpp";
      |                      ^
/usr/bin/ld: /tmp/ccClzP5T.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cccpipkW.o:wiring.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status