Submission #227730

#TimeUsernameProblemLanguageResultExecution timeMemory
227730AaronNaiduWiring (IOI17_wiring)C++14
0 / 100
34 ms2944 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll min_total_length(vector<int> r, vector<int> b) { ll toRet = 0; if (r.size() >= b.size()) { for (int i = 0; i < b.size(); i++) { toRet += b[i] - r[i]; } for (int i = b.size(); i < r.size(); i++) { toRet += b[0] - r[i]; } return toRet; } for (int i = 0; i < r.size(); i++) { toRet += b[i] - r[i]; } for (int i = r.size(); i < b.size(); i++) { toRet += b[i] - r[r.size() - 1]; } }

Compilation message (stderr)

wiring.cpp: In function 'll min_total_length(std::vector<int>, std::vector<int>)':
wiring.cpp:9:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (int i = 0; i < b.size(); i++)
                         ~~^~~~~~~~~~
wiring.cpp:13:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (int i = b.size(); i < r.size(); i++)
                                ~~^~~~~~~~~~
wiring.cpp:19:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i = 0; i < r.size(); i++)
                     ~~^~~~~~~~~~
wiring.cpp:23:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i = r.size(); i < b.size(); i++)
                            ~~^~~~~~~~~~
wiring.cpp:28:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
#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...