Submission #1047967

#TimeUsernameProblemLanguageResultExecution timeMemory
1047967TrentWiring (IOI17_wiring)C++17
13 / 100
19 ms3932 KiB
#include "wiring.h" #include "bits/stdc++.h"; using namespace std; #define forR(i, x) for(int i = 0; i < (x); ++i) #define REP(i, a, b) for(int i = (a); i < (b); ++i) #define all(x) x.begin(), x.end() typedef long long ll; typedef vector<int> vi; typedef vector<vi> vvi; long long min_total_length(std::vector<int> r, std::vector<int> b) { sort(all(r)); sort(all(b)); ll tot = 0; for(int i : r) tot += r.back() - i; for(int i : b) tot += i - b.front(); tot += (ll) max(r.size(), b.size()) * (b.front() - r.back()); return tot; }

Compilation message (stderr)

wiring.cpp:2:25: warning: extra tokens at end of #include directive
    2 | #include "bits/stdc++.h";
      |                         ^
#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...