Submission #414140

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

Compilation message (stderr)

wiring.cpp: In function 'long long int min_total_length(std::vector<int>, std::vector<int>)':
wiring.cpp:9:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |  for(int i = 1; i < r.size(); i++) {
      |                 ~~^~~~~~~~~~
wiring.cpp:12:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |  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...