Search found 10 matches

by hager
Mon Jun 23, 2003 12:16 pm
Forum: Volume 100 (10000-10099)
Topic: 10008 - What's Cryptanalysis?
Replies: 55
Views: 17067

You could check out this thread where the use of fflush() is discussed. http://acm.uva.es/board/viewtopic.php?t=2011&highlight=
It also contains a link to an online manual for the GNU C Library.

Best regards
by hager
Thu Jun 19, 2003 12:04 am
Forum: Volume 104 (10400-10499)
Topic: 10432 - Polygon Inside A Circle
Replies: 62
Views: 20002

The reason is probably due to precision errors when n is large. What happens then is that t becomes so small in comparison to ac so that subtracting t*n from ac will have no effect. Anyway, there's a simpler solution to this problem, and you have the answer (almost) somewhere in your code, but I'll ...
by hager
Wed Jun 18, 2003 10:18 am
Forum: Volume 7 (700-799)
Topic: 756 - Biorhythms
Replies: 32
Views: 9547

Your program produces wrong output for this input: [c] 1 210 44 270 348 152 37 4 148 365 290 231 89 -1 -1 -1 -1 [/c] The output should be: [c] Case 1: the next triple peak occurs in 20976 days. Case 2: the next triple peak occurs in 21141 days. Case 3: the next triple peak occurs in 21229 days. [/c]...
by hager
Tue Jun 17, 2003 1:30 pm
Forum: Volume 100 (10000-10099)
Topic: 10008 - What's Cryptanalysis?
Replies: 55
Views: 17067

I haven't tried your program, but you shouldn't use fflush() . It is not meant for consuming the newline character, but rather flushing output buffers to assure that they are written to kernel buffers. One way you could do it is: [c]gets(temp);[/c] or by looping: [c]while (getchar() != '\n') ;[/c] B...
by hager
Tue Jun 17, 2003 12:35 pm
Forum: Algorithms
Topic: Bisection Method
Replies: 30
Views: 7312

The only one I can remember at the moment is 10297(Beavergnaw), but there are surely more of them. Anyway, it's a nice problem.

Best regards
by hager
Tue Jun 17, 2003 12:20 pm
Forum: Volume 101 (10100-10199)
Topic: 10173 - Smallest Bounding Rectangle
Replies: 18
Views: 4532

I have not solved this problem, but I seem to remember that the bounding rectangle is not necessarily oriented with two vertical and two horizontal lines, i.e. it must be rotated to minimize the area when enclosing certain sets of points. Hope this helps.

Best regards
by hager
Tue Jun 17, 2003 12:11 pm
Forum: Volume 103 (10300-10399)
Topic: 10394 - Twin Primes
Replies: 101
Views: 31884

The problem is that the contents of your array table is undefined. You could initialize it with either: [c]memset(table, 1, 18409201);[/c] or by just looping over all elements and setting them to some nonzero value. Otherwise it seems to work fine. I notice that you call the isPrime in the sieve loo...
by hager
Tue Jun 17, 2003 11:49 am
Forum: Other words
Topic: Problem Difficulity Level
Replies: 4
Views: 1328

There is no direct way of telling how difficult a problem is, but what you can do is look at the submission count and the percentage of accepted submissions and you will get an idea of the difficulty level of the problem.

Best regards
by hager
Tue Jun 17, 2003 11:05 am
Forum: Volume 103 (10300-10399)
Topic: 10341 - Solve It
Replies: 64
Views: 34743

Is the given function strictly increasing/decreasing? I have never plotted it, but considering all the trigonometric functions I would say no, it is definitely not strictly increasing / decreasing. However, you can be sure that the function has at most one root in between 0 and 1 inclusive. Best re...
by hager
Tue Jun 17, 2003 10:53 am
Forum: Volume 102 (10200-10299)
Topic: 10220 - I Love Big Numbers !
Replies: 18
Views: 7503

It sounds like you're doing it right, and if you've handled the special case
of 0! correctly, there isn't much I can think of. You could post the code or send it to me and I'll be happy to check it for you.

Best regards

Go to advanced search