Submission #434572

#TimeUsernameProblemLanguageResultExecution timeMemory
434572medmdgWiring (IOI17_wiring)C++14
13 / 100
29 ms1856 KiB
#include<bits/stdc++.h> #include "wiring.h" #define ll long long using namespace std; long long min_total_length(std::vector<int> r, std::vector<int> b) { ll c=0; ll x=0,y=10000000000; for(int i=0;i<r.size();i++){ x=max(x,(ll)(r[i])); c-=r[i]; } c-=max((ll)(0),((ll)(b.size())-(ll)(r.size()))*x); for(int i=0;i<b.size();i++){ y=min(y,(ll)(b[i])); c+=b[i]; } c+=max((ll)(0),((ll)(r.size())-(ll)(b.size()))*y); return c; } /*int main(){ ll r,b; freopen("inp.txt","r",stdin); cin>>r>>b; vector<int> ra(r),ba(b); for(int i=0;i<r;i++) cin>>ra[i]; for(int i=0;i<b;i++){ cin>>ba[i]; } cout<<min_total_length(ra,ba)<<endl; }*/

Compilation message (stderr)

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