Search found 22 matches

by leocm
Wed Jun 27, 2007 8:04 am
Forum: Volume 100 (10000-10099)
Topic: 10054 - The Necklace
Replies: 62
Views: 31280

I want some case tests.

For all the tests here and in other topics of this problem, my code get the correct answer.

Thank you!
by leocm
Sun Mar 04, 2007 7:20 pm
Forum: Volume 111 (11100-11199)
Topic: 11190 - Series of Powers
Replies: 18
Views: 11276

The problem is greater than I thought!
So, I really have no idea how to do this?

Can you help me mf?
TY.
by leocm
Sun Mar 04, 2007 6:40 pm
Forum: Volume 111 (11100-11199)
Topic: 11190 - Series of Powers
Replies: 18
Views: 11276

What is WRONG? #include <stdio.h> #include <math.h> int main() { long long int cases = 1, i, l, h, k, exponent; double mantissa, result; while ( scanf ("%lld %lld %lld", &l, &h, &k ) == 3 && ( l != -1 || h != -1 || k != -1 ) ) { mantissa = 0.0; for ( i = l; i <= h; i++ ) mantissa += pow( (double) i,...
by leocm
Sun Mar 04, 2007 8:36 am
Forum: Volume 111 (11100-11199)
Topic: 11190 - Series of Powers
Replies: 18
Views: 11276

11190 - Series of Powers

This problem will be here soon, so, how can I output in C a number in this format: 0.ddddddedddddddddd examples: 0.149143e0000000011 0.406971e0000000118 I need this to make the Problem E - Series of Powers - of the running contest. At the moment of my question: http://online-judge.uva.es/contest/dat...
by leocm
Sun Mar 04, 2007 8:34 am
Forum: Volume 111 (11100-11199)
Topic: 11190 - Series of Powers
Replies: 18
Views: 11276

Formatted output (printf)

How can I output in C a number in this format:

0.ddddddedddddddddd

examples:
0.149143e0000000011
0.406971e0000000118

I need this to make the Problem E - Series of Powers - of the running contest.

At the moment of my question: http://online-judge.uva.es/contest/data ... set/e.html
by leocm
Thu Dec 21, 2006 3:09 am
Forum: Volume 7 (700-799)
Topic: 706 - LCD Display
Replies: 221
Views: 35089

winkle, the mistake is that you forgot to do (length = len) when (n == 0).
Then, you may pass the wrong value of length to draw_digits.
by leocm
Wed Dec 20, 2006 5:47 pm
Forum: Volume 101 (10100-10199)
Topic: 10137 - The Trip
Replies: 159
Views: 45486

TY mf, but I've resolve this problem and i'm still get WA. And I don't know why!! Please, anyone can help me? #include <stdio.h> #define MAX(A, B) ( (A) > (B) ? (A) : (B) ) int main() { int i, estudantes, media, troca, trocaMenor, trocaMaior, vetor[1005]; double total, valor, aux, mediaAux; while ( ...
by leocm
Tue Dec 19, 2006 9:26 pm
Forum: Volume 101 (10100-10199)
Topic: 10137 - The Trip
Replies: 159
Views: 45486

I really don't understand this output. My output gives: 10.00 11.99 1.10 2407.10 5.00 0.00 0.01 3991.11 0.01 2.25 4.73 0.02 Only the 4th case is different, but I think that mine is correct! Why is the answer 2407.09? My algorithm calculated that the amount beetween median and the lower prices is 240...
by leocm
Mon Aug 14, 2006 8:52 pm
Forum: Volume 110 (11000-11099)
Topic: 11064 - Number Theory
Replies: 25
Views: 16165

Thank you by the answers!
by leocm
Mon Aug 14, 2006 7:04 am
Forum: Volume 110 (11000-11099)
Topic: 11064 - Number Theory
Replies: 25
Views: 16165

How to do prime factorization efficiently? Well, I don't know, I just go through primes in order, nothing fancy, and it usually works fine. Yes, I understand your point, but the question is: Do you have a list of the primes to do this? Until which number? If not, how can you "go through primes in o...
by leocm
Mon Aug 14, 2006 5:50 am
Forum: Volume 110 (11000-11099)
Topic: 11064 - Number Theory
Replies: 25
Views: 16165

I'm not understanding how to compute this problem.

Could anybody feel a general explanation of what should be done?

I know the Euler's totient function, but I don't have idea of how implements it in an efficient way.

Thank you.
by leocm
Sun Aug 13, 2006 5:57 am
Forum: Volume 110 (11000-11099)
Topic: 11058 - Encoding
Replies: 28
Views: 15296

The correct output:

Code: Select all

Case #1: The encoding string is aabbaa.

Your code outputs one 'a' less.
Martin, my output for this case it's the same that yours, "aabbaa".
Test again and look... What is wrong?
Anyone knows?

Thank you!
by leocm
Fri Aug 11, 2006 7:17 pm
Forum: Volume 110 (11000-11099)
Topic: 11058 - Encoding
Replies: 28
Views: 15296

I really don't know where is the mistake... Could anyone explain me?

Code: Select all

T every body!
by leocm
Tue Aug 08, 2006 8:26 pm
Forum: Volume 110 (11000-11099)
Topic: 11056 - Formula 1
Replies: 34
Views: 16555

Thank you Martin!! Now AC! The mistake was only one wrong comparison...
by leocm
Tue Aug 08, 2006 12:39 am
Forum: Volume 110 (11000-11099)
Topic: 11056 - Formula 1
Replies: 34
Views: 16555

Why WA? The output is perfect with the input we have here...

Code: Select all

Accepted!

Go to advanced search