[simon@simon-laptop][20:24:57]
[~/devel/hackerrank/otherpeoples]>./compile-latest-cpp.sh
Compiling terminator_v10-HORSES.cpp
+ g++ -std=c++14 terminator_v10-HORSES.cpp -O3 -g3 -Wall -Wextra -Wconversion -DONLINE_JUDGE -D_GLIBCXX_DEBUG -fsanitize=undefined -ftrapv -fno-sanitize-recover
terminator_v10-HORSES.cpp: In function ‘int main()’:
terminator_v10-HORSES.cpp:75:5: warning: ‘md’ may be used uninitialized in this function [-Wmaybe-uninitialized]
cout<<md;
~~~~^~~~
+ set +x
Successful
Secondly, fix it so that it works for the test input:
2
5
4 9 1 32 13
5
4 9 1 32 13
There are other problems with it, though
Edit:
Actually, just getting that testcase working might be everything, and that warning might be a red herring - the code is hard to read