Submission #227731

#TimeUsernameProblemLanguageResultExecution timeMemory
227731AaronNaiduWiring (IOI17_wiring)C++14
13 / 100
42 ms3836 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]; } return toRet; }

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++)
                            ~~^~~~~~~~~~
#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...