August lunchtime GAME ON A STRIP

hello , i have implement this code
for GAME ON A STRIP, but it is giving SIGSEGV error for this input

1
4
1 1 1 1 https://www.codechef.com/viewsolution/37377032

please anyone help

I think since your map will be empty for given TC

auto it=mp.end(); 
it--;
auto it1=it;
it1--;

This will give SIGSEV

2 Likes

Can anyone supply some edge test cases for this question, am getting AC in the 4th test case and WA in the 2nd and 3rd, thanks in advance!

1
11
1 0 0 0 0 0 1 0 0 0 1

Thank you so much

great dude , it worked ,thanks a lot

i am facing same https://www.codechef.com/viewsolution/37381755