|
0
thnx I did the same saw tle thought It was invalid solution |
|
0
Hey I wrote this code for problem C the strategy that I implemented was For every time unit if number of students is greater then the number of boxes then the difference of student and boxes will forward to the next box and the remaining will take care of the boxes. So on each step student will start from the beginning on each block a[i]/m student will stay whichever is minimum and rest will go to the next stop. until all the boxes are picked. Got wrong answer on test case 4 can anyone please tell me what is wrong with this strategy. |
|
0
Even After reading the solution I thought of implementing a solution for problem C Could not find why it is wrong. TLE ok it can come as the answer is m*n may be The strategy I have implemented is All the students attack the problem from the front. For each block ai student remain and the rest go forward and go to the next state. If a[i]>students arrived at the spot then all the student stay and remove until a[i]<less then the students the student start to pass to the next tasks. I got wrong answer on 4th test case but could not figure out why any help would be appreciable |
|
0
Ya I did the same But it will not contain all the case example aaaaaabbbbbb aab abb If you go by your approach then the answer would be B: 3 & C: 0 then C: 3 & B:0 which will both give you 3 as final answer whereas the final answer would be 4 B:2 C:2 So you have to take cases like this in consideration |