Painter problem , giving wrong output


Your code is almost correct you have miss one case i.e
if(arr[i]>test) return false;/// this is you are missing

i have done it and also comment on thing read it if get any error

@Saurabh2 its still giving wrong answer in all test cases

have to read my instruction and do some changes or just copy paste

cout<<(ans*t) % 10000003<<endl;
also correct it now it is not multiplied with t we done it above (inside fuction).
also comment out the code

ohhh i see , thank you