Submission #1059906

#TimeUsernameProblemLanguageResultExecution timeMemory
1059906ZicrusWiring (IOI17_wiring)C++17
13 / 100
24 ms3908 KiB
#include <bits/stdc++.h> #include "wiring.h" using namespace std; typedef long long ll; ll min_total_length(vector<int> r, vector<int> b) { ll res = 0; for (int i = 0; i < r.size(); i++) { ll ptrB = i >= b.size() ? 0 : i; res += b[ptrB] - r[i]; } for (int i = r.size(); i < b.size(); i++) { res += b[i] - r.back(); } return res; }

Compilation message (stderr)

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