Submission #1036394

#TimeUsernameProblemLanguageResultExecution timeMemory
1036394DeathIsAweWiring (IOI17_wiring)C++14
0 / 100
0 ms348 KiB
#include "wiring.h" #include <bits/stdc++.h> using namespace std; long long min_total_length(vector<int> r, vector<int> b) { int ans = 0, temp; if (b.size() > r.size()) { for (int i=0;i<b.size();i++) { temp = min(i, (int)r.size() - 1); ans += b[i] - r[temp]; } } else { for (int i=0;i<r.size();i++) { temp = min(i, (int)b.size() - 1); ans += r[i] - b[temp]; } } return ans; }

Compilation message (stderr)

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