Submission #67621

#TimeUsernameProblemLanguageResultExecution timeMemory
67621aquablitz11Wiring (IOI17_wiring)C++14
13 / 100
69 ms14288 KiB
#include <bits/stdc++.h> #include "wiring.h" using namespace std; using ll = long long; ll min_total_length(vector<int> r, vector<int> b) { ll ans = 0; for (int i = 1; i < r.size(); ++i) ans += i*1ll*(r[i]-r[i-1]); for (int i = 1; i < b.size(); ++i) ans += i*1ll*(b[b.size()-(i-1)-1]-b[b.size()-i-1]); ans += (b[0]-r[r.size()-1])*1ll*max(b.size(), r.size()); return ans; }

Compilation message (stderr)

wiring.cpp: In function 'll min_total_length(std::vector<int>, std::vector<int>)':
wiring.cpp:9:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i = 1; i < r.size(); ++i)
                     ~~^~~~~~~~~~
wiring.cpp:11:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i = 1; i < b.size(); ++i)
                     ~~^~~~~~~~~~
#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...