I am doing this question from codeforces…
https://codeforces.com/problemset/problem/1394/A
I have tried to solve it…But couldn’t solve it.
I am not able to understand the editorial.
Please share some idea… How to solve this question…
Thanks…
Not able to solve
Hello @ashishnnnnn have you understood the question or not ?
or do you want me to explain the question as well?
hey @ashishnnnnn this is the editorial code only :
try to think they are separating if the funfactor is greater then it wil be kept in different array and if no then in other.
When k==0 means if there is fun factor grater then m then the only possibility is to take the sum of the whole array.
otherwise we have to find what it is written in tutorial.
Hey…
Good morning…
How greedily they are placing.
Like here in editorial it is written…(x-1)+(d+1)+1 not able to understand …
Can you explain a bit…
Hii…
Can you explain what this guy is doing…
https://codeforces.com/problemset/submission/1395/95706381
I am trying to understand this …Please explain it…
hey @ashishnnnnn i think i am unable to explain this:
you can raise the doubt again.
some questions have a particular trick only to do.
presently i am not getting words to explain.
you can raise the doubt again some other TA may respond you.
Happy Learning!!
I know it is hard to explain…
But can you try …just the main trick…like here they are calculating the prefix sum and all that.
I am trying to solve this from yesterday…but couldn’t get the logic.
Please try if possible.
Thanks
see i dont also know the logic about how they got to think about that logic.
but kuch aise socho ki jab hum number of days cover kar liye tab hum n-i+d/d+1 days ka dekhne ke liye compare karenge.
ki greedily agar fun factor “ge” vale index se nikalne par aarha h to store kro update kro vrna isko bhi un days ki tarah treat kro jisse answer nahi ban rha maximum.
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.