Submission #767328

#TimeUsernameProblemLanguageResultExecution timeMemory
767328APROHACKWiring (IOI17_wiring)C++14
13 / 100
22 ms3788 KiB
#include "wiring.h" #include <bits/stdc++.h> #define pb push_back #define ff first #define ss second #define ll long long using namespace std; long long min_total_length(std::vector<int> r, std::vector<int> b) { int ir = r.size() -1, ib = 0; ll ans = 0; while(ir >= 0 and ib < b.size()){ ans += b[ib] - r[ir]; ir--; ib++; } while(ir >= 0){ ans += b[0] - r[ir]; ir--; } while(ib < b.size()){ ans += b[ib] - r.back(); ib++; } return ans; }

Compilation message (stderr)

wiring.cpp: In function 'long long int min_total_length(std::vector<int>, std::vector<int>)':
wiring.cpp:12:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |  while(ir >= 0 and ib < b.size()){
      |                    ~~~^~~~~~~~~~
wiring.cpp:21:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |  while(ib < b.size()){
      |        ~~~^~~~~~~~~~
#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...