Submission #1068378

#TimeUsernameProblemLanguageResultExecution timeMemory
1068378edogawa_somethingWiring (IOI17_wiring)C++17
0 / 100
1 ms348 KiB
#include "wiring.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll,ll> pii; typedef vector<ll> vii; #define F first #define S second #define all(v) v.begin(),v.end() #define pb push_back long long min_total_length(std::vector<int> r, std::vector<int> b) { long long ans; for(auto it:r) { ans-=it; } for(auto it:b) ans+=it; if(b.size()>r.size()) ans-=r.back()*(b.size()-r.size()); else ans+=b.front()*(r.size()-b.size()); return ans; }

Compilation message (stderr)

wiring.cpp: In function 'long long int min_total_length(std::vector<int>, std::vector<int>)':
wiring.cpp:17:6: warning: 'ans' may be used uninitialized in this function [-Wmaybe-uninitialized]
   17 |   ans+=it;
      |   ~~~^~~~
#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...