ooppsss hehehe
Searched on google to find the link then got the wrong problem hehe.
Thanks for pointing out.


On Sat, May 11, 2013 at 11:07 PM, Carlos Guia <carlos.guia.v...@gmail.com>wrote:

> I haven't read the editorial, but the OP was talking about the div 1
> version of the problem while you seem to be taking about the div 2 one.
> Based only on the class names provided in the posts.
>
> Carlos Guia
> On May 11, 2013 9:43 PM, "Leandro Coutinho" <lescoutinh...@gmail.com>
> wrote:
>
>> Hello,
>>
>> Reading the problem (
>> http://community.topcoder.com/stat?c=problem_statement&pm=12540&rd=15498),
>> I think it's like this:
>>
>> - Maximum # deer that have two antlers: it's when whenever possible each
>> deer lost two antlers:
>> q = k / 2, r = k mod 2, max = N - q + r
>>
>> - Minimum # deer that have two antlers: it's when whenever possible each
>> deer lost just one antler:
>> x = N - K, if x >= 0, then min = x, else min = 0
>>
>> public class DeerInZooDivTwo {
>>
>>
>>     public int[] getminmax(int N, int K)
>>     {
>>         int min = N-K;
>>         if(min < 0) min = 0;
>>         return new int[]{min, N-((K/2)+(K%2))};
>>     }
>>
>>     public static void main(String[] args) {
>>         DeerInZooDivTwo d = new DeerInZooDivTwo();
>>         int[] xy = d.getminmax(3, 2);
>>         System.out.println(xy[0] + " " + xy[1]);
>>         xy = d.getminmax(3, 3);
>>         System.out.println(xy[0] + " " + xy[1]);
>>         xy = d.getminmax(10, 0);
>>         System.out.println(xy[0] + " " + xy[1]);
>>         xy = d.getminmax(654, 321);
>>         System.out.println(xy[0] + " " + xy[1]);
>>         xy = d.getminmax(100, 193);
>>         System.out.println(xy[0] + " " + xy[1]);
>>     }
>>
>> }
>>
>>
>>  On Fri, May 10, 2013 at 12:33 AM, karthikeyan balamurugan <
>> sbk...@gmail.com> wrote:
>>
>>>
>>> Guys i can't understand this problem could any tell's in easy way
>>> Problem Statement     Deer Only has recently shed his antlers. He is
>>> now ashamed and wants to make fake ones until the real ones grow back.
>>>
>>>
>>>
>>> Deer Only has found a tree with N vertices. The vertices are numbered 0
>>> through N-1. You are given two int[]s *a* and *b* that contain N-1
>>> integers each. These arrays describe the edges of the tree: for each i, the
>>> vertices *a*[i] and *b*[i] are connected by an edge.
>>>
>>>
>>>
>>> Deer Only has decided to make his new antlers out of this tree. The only
>>> operation he is able to do is to remove some edges from his tree, producing
>>> several smaller trees. Then, he wants to take two of the newly created
>>> trees and attach them to his head. The two antlers must be isomorphic,
>>> otherwise he will be unbalanced when running. (See Notes for a formal
>>> definition of tree isomorphism.)
>>>
>>>
>>>
>>> Return the maximal size of the deer's new fake antlers. The size of an
>>> antler is defined as the number of vertices in it. Note that the largest
>>> possible antlers may sometimes consist only of a single vertex (and no
>>> edges). Definition     Class:DeerInZooDivOneMethod:getmaxParameters:int[],
>>> int[] Returns:intMethod signature:int getmax(int[] a, int[] b)(be sure
>>> your method is public)
>>>  Notes -Two trees T1 = (V1, E1) and T2 = (V2, E2) are called isomorphic
>>> if there exists a bijection f from V1 to V2 with the following property:
>>> For each pair of vertices in V1 (a, b), there is an edge between a and b in
>>> T1 if and only if there is an edge between f(a) and f(b) in T2.
>>> Constraints- N will be between 2 and 51, inclusive.-*a* and *b* will
>>> contain exactly N-1 elements each. -Each element of *a* and *b* will be
>>> between 0 and N-1, inclusive.-The edges described by *a* and *b* will
>>> form a tree.  Examples0)
>>>
>>>
>>> {0, 1, 2}
>>>
>>> {1, 2, 3}
>>>
>>> Returns: 2
>>>
>>> The tree looks as follows: 0-1-2-3. Deer Only can remove the edge
>>> between the vertex 1 and the vertex 2, and he gets two new trees 0-1 and
>>> 2-3. These two trees are isomorphic, so he can use these two trees as
>>> antlers.1)
>>>
>>>
>>> {1, 8, 1, 7, 4, 2, 5, 2}
>>>
>>> {5, 3, 6, 8, 2, 6, 8, 0}
>>>
>>> Returns: 4
>>>
>>> The two new trees will contain vertices 0,2,4,6 and 5,8,7,3.2)
>>>
>>>
>>> {0}
>>>
>>> {1}
>>>
>>> Returns: 1
>>>
>>>
>>> 3)
>>>
>>>
>>> {0, 11, 10, 10, 19, 17, 6, 17, 19, 10, 10, 11, 9, 9, 14, 2, 13, 11, 6}
>>>
>>> {7, 5, 2, 12, 8, 9, 16, 8, 4, 18, 8, 13, 15, 13, 17, 16, 3, 1, 7}
>>>
>>> Returns: 8
>>>
>>>
>>> 4)
>>>
>>>
>>> {14, 13, 28, 15, 20, 4, 9, 6, 1, 23, 19, 25, 25, 8, 14, 16, 2, 8, 15, 25, 
>>> 22, 22, 28, 10, 10, 14, 24, 27, 8}
>>>
>>> {21, 5, 12, 13, 27, 1, 24, 17, 27, 17, 23, 14, 18, 26, 7, 26, 11, 0, 25, 
>>> 23, 3, 29, 22, 11, 22, 29, 15, 28, 29}
>>>
>>> Returns: 11
>>>
>>>
>>> ------------------------------
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Google Code Jam" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to google-code+unsubscr...@googlegroups.com.
>>> To post to this group, send email to google-code@googlegroups.com.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-code+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-code@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to