I think you used the algorithm I suggested ^_^
I just posted to say this: let be bincoeff(n,k) the binomial coefficient of n elements of class k, we have:
bincoeff(n,0) = 1
bincoeff(n,n) = 1
otherwise:
bincoeff(n,k) = bincoeff(n-1,k-1) + bincoeff(n-1,k)
Don't use factorials, just use DP ...
Search found 27 matches
- Fri Mar 04, 2005 11:26 pm
- Forum: Algorithms
- Topic: USACO help again
- Replies: 5
- Views: 2590
- Fri Mar 04, 2005 11:15 pm
- Forum: Algorithms
- Topic: Help with this problem
- Replies: 2
- Views: 1483
- Fri Mar 04, 2005 11:07 pm
- Forum: Algorithms
- Topic: something strange with 8 queen problem
- Replies: 4
- Views: 2098
This kind of errors are born when you forget to reset some variable. I didn't read the code (I'm tired now ^_^) but try to check for it.
But excuse me, can't you write plainer code? I think it's not a good habit to merge two loop in one. *Almost* all the problems I did were straightforward to write ...
But excuse me, can't you write plainer code? I think it's not a good habit to merge two loop in one. *Almost* all the problems I did were straightforward to write ...
- Tue Sep 28, 2004 11:57 pm
- Forum: Algorithms
- Topic: Index Trees
- Replies: 2
- Views: 1702
- Mon Aug 30, 2004 12:07 am
- Forum: Algorithms
- Topic: For someone who solved Character Recognition (USACO 5.5)
- Replies: 1
- Views: 1389
For someone who solved Character Recognition (USACO 5.5)
I'd like to know if some poster has solved this problem - it's a IOI 1997 problem, but the USACO contains an harder version in Section 5.5.
I can't find the error in my program. It produces the following output for test case 9:
rincewind could scream for help in thirty four la?guages
where ...
I can't find the error in my program. It produces the following output for test case 9:
rincewind could scream for help in thirty four la?guages
where ...
- Tue Aug 10, 2004 12:48 am
- Forum: Algorithms
- Topic: Cycles on graphs
- Replies: 2
- Views: 1494
- Mon Aug 09, 2004 9:44 pm
- Forum: Algorithms
- Topic: Cycles on graphs
- Replies: 2
- Views: 1494
Cycles on graphs
I propose you a problem about cycles on graphs.
Given an undirected unweighted graph and two nodes A and B, I've got to find a path from A to B and then a path from B to A. I can't visit a node more than once (with the exception of node A, that must be visited at the beginning and at the end). I ...
Given an undirected unweighted graph and two nodes A and B, I've got to find a path from A to B and then a path from B to A. I can't visit a node more than once (with the exception of node A, that must be visited at the beginning and at the end). I ...
- Wed Aug 04, 2004 1:36 am
- Forum: Algorithms
- Topic: A Question about graphs
- Replies: 3
- Views: 2255
- Wed Aug 04, 2004 1:27 am
- Forum: Algorithms
- Topic: A Question about graphs
- Replies: 3
- Views: 2255
- Fri Jul 30, 2004 10:00 pm
- Forum: Algorithms
- Topic: prime numbers
- Replies: 2
- Views: 1649
- Fri Jul 30, 2004 12:23 am
- Forum: Algorithms
- Topic: Segmentation Fault
- Replies: 6
- Views: 2340
- Wed Jul 28, 2004 1:49 pm
- Forum: Algorithms
- Topic: Cowcycles... A VERY hard problem!
- Replies: 4
- Views: 2924
- Sun Jul 25, 2004 10:59 am
- Forum: Algorithms
- Topic: Cowcycles... A VERY hard problem!
- Replies: 4
- Views: 2924
Cowcycles... A VERY hard problem!
Can someone help me about this problem? I found it at the USACO website in section 4.3. Don't be afraid from the lenght of the statement of the problem, the second half is a little bit of explanation.
Thanks a lot.
**********
Cowcycles
Originally by Don Gillies
[International readers should ...
Thanks a lot.
**********
Cowcycles
Originally by Don Gillies
[International readers should ...
- Sun Jun 27, 2004 9:05 pm
- Forum: Other words
- Topic: Newcomer problems
- Replies: 15
- Views: 17421
Re: Newcomer problems
I heard about adhoc problems,, but how do i know when a problem belong to this category ??
All programming contests problems can be reduced to a few types of problems, mainly:
Dynamic Programming
Greedy
Complete Search
Flood Fill
Shortest Path
Recursive Search Techniques
Minimum Spanning ...
All programming contests problems can be reduced to a few types of problems, mainly:
Dynamic Programming
Greedy
Complete Search
Flood Fill
Shortest Path
Recursive Search Techniques
Minimum Spanning ...
- Sun Jun 27, 2004 8:59 pm
- Forum: Other words
- Topic: how to handle large numbers
- Replies: 2
- Views: 1513