Search found 67 matches

by dumb dan
Fri Oct 01, 2004 7:52 pm
Forum: Volume 7 (700-799)
Topic: 750 - 8 Queens Chess Problem
Replies: 78
Views: 26475

note that it is a multiple input problem... input: 4 1 2 6 7 7 8 8 8 output: SOLN COLUMN # 1 2 3 4 5 6 7 8 1 3 1 7 5 8 2 4 6 2 4 1 5 8 2 7 3 6 3 4 1 5 8 6 3 7 2 4 5 1 4 6 8 2 7 3 5 5 1 8 4 2 7 3 6 6 5 1 8 6 3 7 2 4 7 6 1 5 2 8 3 7 4 8 7 1 3 8 6 4 2 5 SOLN COLUMN # 1 2 3 4 5 6 7 8 1 1 7 5 8 2 4 6 3 2...
by dumb dan
Fri Oct 01, 2004 3:37 pm
Forum: Volume 102 (10200-10299)
Topic: 10229 - Modular Fibonacci
Replies: 53
Views: 17043

Your output is not quite correct for all inputs.
Try for example:

Input:

19000 19
123456 19

Correct output:

227947
64256
by dumb dan
Thu Sep 30, 2004 1:07 pm
Forum: Volume 102 (10200-10299)
Topic: 10217 - A Dinner with Schwarzenegger!!!
Replies: 28
Views: 9220

While little joey is correct I'd just like to correct a little typo of his. It's supposed to be:

p(x+1) = p(x) * (N/x - 1) * (x+1)/N

Also, one can note that you get the generalized formula:

p(x) = (N-1)! / (N-x)! * (x/(N^x))

And good luck catching up to Per and Adrian,
you will need it :wink:
by dumb dan
Fri Oct 10, 2003 6:48 am
Forum: Volume 102 (10200-10299)
Topic: 10217 - A Dinner with Schwarzenegger!!!
Replies: 28
Views: 9220

To clarify the problem: Exactly one person in the ticket queue will win. A person will win if no person in front of him has won AND his/her birthday is the same as ANY one of the people in front of him. So if there are N days in the year the first person will have a probability p(1)=1/N to win, seco...
by dumb dan
Wed Oct 08, 2003 6:19 pm
Forum: Volume 102 (10200-10299)
Topic: 10217 - A Dinner with Schwarzenegger!!!
Replies: 28
Views: 9220

I may be dumb, but I have 2 major problems with the problem statement: 1) The theoretical value should be 0.5 more than the values given by the problemsetter in the sample output (this is also the reason why you have to use floor(x)+1 instead of round(x)) 2) It doesn't say in the problem what to do ...
by dumb dan
Tue Oct 07, 2003 1:40 pm
Forum: Volume 3 (300-399)
Topic: 313 - Intervals
Replies: 10
Views: 4790

According to arnsfelt's sample input -617.975 should be rounded down to
-617.98 and not rounded up like my program did for a while. Maybe that helps someone.
by dumb dan
Tue Aug 05, 2003 1:10 am
Forum: Volume 6 (600-699)
Topic: 686 - Goldbach's Conjecture (II)
Replies: 41
Views: 18738

re: 686 W.A

> while(primestack[n]<in&&n!=num-1)
> n++;

There is your problem.
You later assume that primestack[n]>=in
and forget the case where you break the
loop because n==num-1

Go to advanced search