Submission #405782

#TimeUsernameProblemLanguageResultExecution timeMemory
405782peuchWiring (IOI17_wiring)C++17
13 / 100
31 ms3788 KiB
#include "wiring.h" #include<bits/stdc++.h> using namespace std; long long min_total_length(std::vector<int> r, std::vector<int> b) { long long ans = 0; int it1 = -1; int it2 = b.size(); while(it1 != r.size() - 1 || it2 != 0){ if(it1 != r.size() - 1) it1++; if(it2 != 0) it2--; ans += b[it2] - r[it1]; // printf("Adding: %d - %d\n", b[it2], r[it1]); } return ans; }

Compilation message (stderr)

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