this shows wrong output
Painter problem
hello @naazsayma123
a) use long long to avoid overflow
b) u have not intialised s correctly. s should be initilaised with max value in array and because array is not sorted it can be at any position of the array.
it still not working
a) dont sort the array because painter can only paint continuous blocks
b) u missed to take mod of output (in question it is mentioned)
c) s= max_value_in_array * t and e=sum*t
check ur updated code here ->
https://ide.codingblocks.com/s/244788
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.