please clarify the JULY CHALLENGE problem 02 , test case number 2.
Well , this was a disaster , first I have to assume that some element from B can remain in B . Thanks to this thread . Second , I have to assume that we can use same element of b multiple times . Since it is once in a blue moon mistake by tester and author so no offence to codechef .
So it seems they added new test cases:-
08/07/2016, 1234 hrs IST: Test data of problem CHEFTET was weak. We have put all the submissions for rejudge. Please resubmit your solution if you are affected by it. We really regret the inconvenience.
Thankfully my solution wasnāt affected.
@admin So, what is it finally, do we have to use all the elements of b? And can we use the same element of b multiple times?
Now anybody tell me that can B contain some elements at the end ?
My solution assumes we have to use all elements of b and passes.
The problem statement should be updated
There is too much confusion about whether B can retain some elements or if the same element can be used multiple times. Else it is not clear.
So, can we use elements of b multiple times?
thanks rajan for informationā¦
but why not codechef clear this according to question B will fall on A in this scenerio one element of B can fall on unique element of
A so that element of B canāt be reusedā¦
such type of information less question kills time this is really irritatingā¦
So , is your roommatesās solution still accepted ?
no ā¦ not yet
no u need to use each element only onceā¦some subtasks failed because of that
no all B elements must fallā¦ that is why i got wrong too
In the problem statement of CHEFTET its written that:-
āarray B is falling on array A, such that number Bi is directly above the number Ai initially.ā
āIf element Bi falls on Ai, Ai gets increased by Bi.ā
So that means Bi must fall on Ai then only Ai increases and if Bi falls on any of Ai-1 or Ai+1 then it doesnt increases as per problem statement but in test case no 2 last both 10ās are falling on same number 1.
What does that means will anyone tell me.??
by telling the complexity, you kinda revealed the entire algorithm
if(sum % n == 0 && (sum/n == a[0] || sum/n == a[0] + b[0] || sum/n == a[0] + b[1] || sum/n == a[0] + b[0] +b[1])) printf("%lld\n",sum/n);
else printf("-1\n");
^these were those 2 lines, which got 100.
https://www.codechef.com/viewsolution/10754867
This was the 2 lines of code of my roommate giving 100