Submission #296907

#TimeUsernameProblemLanguageResultExecution timeMemory
296907ASDF123Wiring (IOI17_wiring)C++17
Compilation error
0 ms0 KiB
#include "wiring.h" #include "grader.cpp" #include <bits/stdc++.h> #define szof(s) (int)s.size() #define pii pair<int, int> #define ll long long #define fr first #define sc second using namespace std; const int N = (int)2e5 + 5; vector <int> g[N]; bool used[N]; struct Edge { int u, v, len; Edge(int u_, int v_, int len_) { u = u_, v = v_, len = len_; } Edge () { } }; bool operator < (const Edge &a, const Edge &b) { return a.len < b.len; } long long min_total_length(vector<int> r, vector<int> b) { vector <Edge> edges; for (int i = 0; i < szof(r); i++) { for (int j = 0; j < szof(b); j++) { int u = i + 1; int v = szof(r) + j + 1; edges.push_back(Edge(u, v, abs(r[i] - b[j]))); } } sort(edges.begin(), edges.end()); ll ans = 0; for (Edge el : edges) { if (!used[el.u] || !used[el.v]) { used[el.u] = used[el.v] = 1; ans += el.len; } } return ans; }

Compilation message (stderr)

/tmp/ccghCbLE.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/cckjY1p1.o:wiring.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status