Submission #1045705

#TimeUsernameProblemLanguageResultExecution timeMemory
1045705LittleOrangeWiring (IOI17_wiring)C++17
0 / 100
0 ms348 KiB
#include "wiring.h" #include<bits/stdc++.h> using namespace std; using ll = long long; long long min_total_length(std::vector<int> r, std::vector<int> b) { ll n = r.size(),m = b.size(); ll c = min(c,m); ll ret = 0; for(ll i = 0;i<c;i++){ ret += b[i]-r[i+n-c]; } if (n>m){ for(ll i = 0;i<n-m;i++){ ret += b[0] - r[i]; } } if(m>n){ for(ll i = n;i<m;i++){ ret += b[i] - r.back(); } } return ret; }

Compilation message (stderr)

wiring.cpp: In function 'long long int min_total_length(std::vector<int>, std::vector<int>)':
wiring.cpp:7:5: warning: 'c' is used uninitialized in this function [-Wuninitialized]
    7 |  ll c = min(c,m);
      |     ^
#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...