Search found 8 matches

by Fernandez Jose
Sat Jun 28, 2003 12:33 am
Forum: Volume 102 (10200-10299)
Topic: 10299 - Relatives
Replies: 57
Views: 20706

Thanks, I found the bug.

Now, I need to speed up my algorithm, I got TLE :x
by Fernandez Jose
Thu Jun 26, 2003 7:00 pm
Forum: Volume 102 (10200-10299)
Topic: 10299 - Relatives
Replies: 57
Views: 20706

Thanks for your answer. Sorry :oops: I got mixed up with the inputs. I add two more for cheking a possible overflow, they are:

INPUT:
1000000000
10000000001

OUTPUT:
400000000
1600000000
by Fernandez Jose
Thu Jun 26, 2003 1:28 pm
Forum: Volume 102 (10200-10299)
Topic: 10299 - Relatives
Replies: 57
Views: 20706

Can samebody check this cases please?

I'm getting WA over and over again. So I would like that sameone check this cases to see were my code is wrong.

INPUT

1
2
3
4
5
6
7
8
9
10
123456789
987654321
1000000000
7
12
1000000
123124
123312
4444
1111
12123123
999999999
223092870
0

OUTPUT
0
1
2
2
4
2
6
4
6
4
82260072
619703040 ...
by Fernandez Jose
Thu Jun 26, 2003 2:11 am
Forum: Algorithms
Topic: Find second min number .
Replies: 10
Views: 5299

Re: Find second min number .

[quote="peterlin"]I know we can find min number in n-1
but how can we find the second min number in n + lg(n) -2

It is a question in Introduce to Algorithm (9.1-1)

Did anyone have idea of this ?

Best wishes,
Peter[/quote]

Depending on the nature of the numbers, the problem can be solved with a ...
by Fernandez Jose
Wed Sep 25, 2002 1:22 pm
Forum: Pascal
Topic: why so much mem?
Replies: 3
Views: 4835

Probably you'r right. But as anyhow I realize that the same algorithm in C++ is much faster than in Pascal. The problem 264 (Count on Cantor) in Pascal uses 324kb of memory and 0.130 s. of CPU time, while in C++ the figures are 64kb for memory and 0.010 s. of time.
All that despite I don't know C or ...
by Fernandez Jose
Wed Sep 25, 2002 9:35 am
Forum: Pascal
Topic: why so much mem?
Replies: 3
Views: 4835

why so much mem?

how it's possible that this code spend 320kb of memory?
program factor;
const
F7=string('5040');
F8=string('40320');
F9=string('362880');
F10=string('3628800');
F11=string('39916800');
F12=string('479001600');
F13=string('6227020800');
sOver=('Overflow!');
sUndr=('Underflow!');

var
dato ...
by Fernandez Jose
Wed Sep 25, 2002 3:49 am
Forum: Volume 103 (10300-10399)
Topic: 10323 - Factorial! You Must be Kidding!!!
Replies: 106
Views: 47436

well now i'm discovering a new impresive mathematics.

As it was said you can handle this problem in this way: f(n)=nf(n-1)=> f(n-1)=f(n)/n, lets see.
So to handle f(-1) we do f(0)=0f(-1),(this will always be cero, if f(-1)#oo).
As is defined f(0)=1
then f(-1)=1/0=+oo
this solution must verify de ...
by Fernandez Jose
Mon Sep 23, 2002 9:10 pm
Forum: Volume 8 (800-899)
Topic: 831 - Document Validator
Replies: 4
Views: 3601

831 - Document Validator

I've made an automata and, on my pc, solves any input. So I guess what is making the program to get WA over and over is the character set. Is it diferent in Linux and DOS?

Many thanks.
jos

Go to advanced search