RUNTIME ERROR for THE LEAD GAME problem

Hello guy’s , i tried everything but still my code is getting runtime error , please help.

here is my code : 2hOEB0 - Online C++0x Compiler & Debugging Tool - Ideone.com

Hey there are two problems 1st change the dimensions of array to either 10000 or according to test cases…
2.What if one of your vectors is empty.put check conditions
Link To Your Corrected Code CodeChef: Practical coding for everyone