Search found 9 matches

by Scottathon
Sat Oct 20, 2007 3:59 am
Forum: Bugs and suggestions
Topic: Colours on problem lists
Replies: 0
Views: 1300

Colours on problem lists

I don't have a suggestion. I just wanted to thank you guys for the awesome feature of having solved and attempted problems coloured on the problem lists. It's really great, and I'm finding it useful already.
by Scottathon
Sat Oct 20, 2007 3:15 am
Forum: Volume 111 (11100-11199)
Topic: 11152 - Colourful Flowers
Replies: 45
Views: 22283

import java.io.*; import java.util.*; import java.text.*; class Main { public static void main (String args[]) throws IOException { Scanner in = new Scanner(System.in); DecimalFormat f = new DecimalFormat(); f.setMaximumFractionDigits(4); f.setMinimumFractionDigits(4); while (in.hasNext()) { double...
by Scottathon
Tue Sep 18, 2007 12:32 am
Forum: General
Topic: New system is coming!
Replies: 13
Views: 8387

I just wanted to say that the new site is great. I love the new Java support. I have one suggestion, though. It would be nice to be able to view which problems we have solved on our user pages, like before. Another possible feature could be displaying something to indicate which problems we have sol...
by Scottathon
Mon Nov 06, 2006 4:03 pm
Forum: Volume 100 (10000-10099)
Topic: 10007 - Count the Trees
Replies: 39
Views: 6995

BigInt arr[] = new BigInt[301]; arr[0] = new BigInt(1); for (int k=0; k<arr.length-1; k++) { int top = (((2*k)+1)*((2*k)+2)); int bottom = (k+2); arr[k+1] = arr[k].multiply(new BigInt(top)); arr[k+1] = arr[k+1].divide(new BigInt(bottom)); } I think your algorithm is correct. I dont have any java co...
by Scottathon
Sat Nov 04, 2006 9:31 pm
Forum: Volume 100 (10000-10099)
Topic: 10007 - Count the Trees
Replies: 39
Views: 6995

I'm pretty what I have is correct, because the Catalan numbers correspond to the number of unlabeled binary trees. In the case of 10007, the trees are labelled, so the formula is multiplied by n!.

(2n)!/(n+1)! is the formula, if I am not mistaken.
by Scottathon
Sat Nov 04, 2006 7:45 pm
Forum: Volume 100 (10000-10099)
Topic: 10007 - Count the Trees
Replies: 39
Views: 6995

Thanks again for the response. I'm still completely puzzled as to why I continue to get WA. Do you see anything wrong with this algorithm? (it's in java and uses a BigInt class that I found on the java forum, but I think it's fairly straight forward) BigInt arr[] = new BigInt[301]; arr[0] = new BigI...
by Scottathon
Sat Nov 04, 2006 12:06 am
Forum: Volume 100 (10000-10099)
Topic: 10007 - Count the Trees
Replies: 39
Views: 6995

here is the output of my AC program for input 300: 13737807510976206042952273897263258508116975599604959518836124365862819224972658 54247030784146639904262298233057468287928668494180243215174601311778665118426704 17171885915385919843693603797986405860478580069565298906600371579310154166721548 84642...
by Scottathon
Fri Nov 03, 2006 4:04 am
Forum: Volume 100 (10000-10099)
Topic: 10007 - Count the Trees
Replies: 39
Views: 6995

I'm having a hard time understanding why I'm getting WA. I'm computing all of the values up to 300 dynamically, sticking them into an array, and calling the appropriate values when requested. The correct value for n=300 is going to work out to 600!/301!, right? I've compared that value worked out wi...
by Scottathon
Fri Nov 03, 2006 1:28 am
Forum: Volume 100 (10000-10099)
Topic: 10007 - Count the Trees
Replies: 39
Views: 6995

Can someone post some input and output?
My program passes the sample input, but I keep getting wrong answer.

Thanks.

Go to advanced search