Can you pls check the code,not able to figure out the problem
hello @dipeshpandey2001
a) u have ignored t
b) use long long to avoid overflow
c) since array is not sorted u need to explicitly find the max and then assign it to s
d) dont sort the array , becuase painter can paint only contiuos blocks and sorting will change the order
e) u have ignored mod
when u r returning ans%10000003 in plae of that
return (ans*t)%1000003
most of the variables that u are using are not declared , some of the variables are not initilaised and at some places u are missingn semi colon
pls go through the compilation errors and fix them one by one then only u will learn debugging
okay,…
corrected most of them but i dont know what is left,can you pls check. https://ide.codingblocks.com/s/486771
@dipeshpandey2001
check niw
also replace all int with long long.
sometimes cb compiler dont highlights bug so its better to use ur local compiler for debugging that will save time
okay; thanks,…
checked everything, and changed everything to long long,output is coming but it is passing any of the test cases https://ide.codingblocks.com/s/486803
check now
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.