Submission #227729

#TimeUsernameProblemLanguageResultExecution timeMemory
227729AaronNaiduWiring (IOI17_wiring)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll min_totalLength(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_totalLength(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]
 }
 ^
/tmp/cc6QeFFV.o: In function `main':
grader.cpp:(.text.startup+0x23b): undefined reference to `min_total_length(std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status