Separate the chocolate
Separate the chocolate
sameerpm + 1 comment In example, all 4 are U (not even one is TT or D)...Then how in o/p you are showing T D and U
sharukrules + 0 comments I think they are showing who got which part of the piece. Its all U, But D denotes Derpina got the U chocolate.
josef_klotzner + 1 comment The sample test case is wrong for my understanding:
1 1 1
T
Answer as of test case: 1
Problem description states, to split chocolate in exactly TWO pieces. To give Tom just 1 piece (all) and Derpina nothing is no split at all. (nothing is not a piece)
Correct answer for my understanding: 0
Because it can't be split into "exactly TWO pieces"
What do You think?
gondo + 0 comments Exactly my first thought
gugigor + 0 comments the statement probably should've said that you can't leave any piece of chocolate unattended, since the wording was a bit vague on whether you had to use all of it or not
mikhail_lokhanov + 0 comments Solved locall, but cannot upload code: Sorry, we can't accept your submission. Your submission size should not exceed 50 KB. Reduced it to 45K by removing all comments (used to be 110K)... still cannot uoload... Grrr
mrussotto + 0 comments Did it via DP, but there wasn't enough memory to do a full DP; could only memoize SOME steps. You know you're hacking when your code starts with
typedef unsigned int ulong;
aka_julie + 1 comment It should be Derp and Derpina smh
lokeshlkr + 1 comment Then all the chocolates would have been marked D and our program would get confused which D was for which Derp and which was for Derpina. XD
16chen_george + 0 comments dude...stop trying m8. Not even funny bruh
Vaishnavi_Mande + 1 comment Is it that you cannot have a 2X2 piece? Or any piece you cut shouldn't contain a piece that has a square? For example - test case - 3 3 4 UDD UUT UTT
So, is dividing the piece like DDD TTT TTT
valid?
gondo + 0 comments the statemant is:
in any piece
, therefore no, your example is not valid
adrient + 1 comment My C# algorithm times out for the three last cases. Is there a way to avoid checking the global connectivity of both T (through T and U) and D (through D and U) each time I assign a U to either T or D?
sufertashu + 0 comments Same problem.
wariotx + 2 comments If m=2, n=5:
TTDDD
TTDDDis it valid or not?
giaym + 0 comments you cant have 4 in a block so I guess no
nkongchatri + 0 comments Must have i/p k to determine how the diffence between two pieces is allow and initial labed chocolate like
TTUUD UUUDU
if you i/p has k=2 then some of the posible divition will be
TTTDD TTDDD
TTTTD DDDDD
TTTTD TTDDD
TTDDD TTDDD // yours
Sort 17 Discussions, By:
Please Login in order to post a comment