## Search found 108 matches

Mon Oct 13, 2003 5:35 pm
Forum: Volume 101 (10100-10199)
Topic: 10168 - Summation of Four Primes
Replies: 51
Views: 20229
Dominik, can you describe in detail how your algorithm works? I still don't understand your method... If you want to find two primes k and l such that k + l = N, then at least one of them has to be bigger than (or equal to) N, right? So if I know primes up to sqrt(N) only, what does it help me? Of c...
Mon Oct 13, 2003 5:28 pm
Forum: Other words
Topic: Why do people use topic number (only) as subject?
Replies: 3
Views: 892
I totally agree with you, it is a lot of work to find out what problem the question is about. Also, I think that people should not just post their code without a thorough explanation of what you are doing. I am willing to help anyone who has problems, but please agree to those rules. Also, some peop...
Sat Oct 11, 2003 7:41 pm
Forum: Volume 4 (400-499)
Topic: 453 - Intersecting Circles
Replies: 84
Views: 15132
two rules:

Sat Oct 11, 2003 7:39 pm
Forum: Volume 102 (10200-10299)
Topic: 10298 - Power Strings
Replies: 31
Views: 13407
nothing wrong with the problem; obviously the judge input doesn't include the test case you described.
Sat Oct 11, 2003 9:23 am
Forum: Volume 101 (10100-10199)
Topic: 10168 - Summation of Four Primes
Replies: 51
Views: 20229
you found a linear (O(n)) time for checking if a number is prime??? I would VERY much like to know it, and i think *all* mathematicians and computer scientists would be interested as well!
Thu Oct 09, 2003 5:21 pm
Forum: Volume 101 (10100-10199)
Topic: 10168 - Summation of Four Primes
Replies: 51
Views: 20229
I still don't understand. I assume your code would look something like this then (pseudocode): if( n%2 == 0 ) write "2 2"; n = n-4; if( n%2 == 1 ) write "2 3"; n = n-5; // now n is even so it can be written as the sum of two primes for( int i=2; i<n; i++ ) if( prime[i] && prime[n-i] ) write i, n+i; ...
Thu Oct 09, 2003 10:54 am
Forum: Volume 101 (10100-10199)
Topic: 10168 - Summation of Four Primes
Replies: 51
Views: 20229
hmm... i don't understand it yet. Suppose I have to write the number N=10000000 as the sum of 4 primes. Then at least one of those primes should be bigger than N/4 = 2,500,000, which is a lot bigger than sqrt(N) = 3000...
So how can it be sufficient to compute only primes up to sqrt(N) ?
Thu Oct 09, 2003 12:18 am
Forum: Volume 1 (100-199)
Topic: 102 - Ecological Bin Packing
Replies: 485
Views: 50081
it means there are only lines with 9 integers on them
Wed Oct 08, 2003 9:25 pm
Forum: Volume 101 (10100-10199)
Topic: 10168 - Summation of Four Primes
Replies: 51
Views: 20229
this problem is very easy if you know the following almost-theorem (the Goldbach Conjecture): Every even number >= 4 can be written as the sum of two primes My program ran in 1.5 seconds however; so it's pretty slow.. At the moment I'm precalculating primes up to 10000000 using the famous siff, and ...
Wed Oct 08, 2003 8:38 pm
Forum: Volume 1 (100-199)
Topic: 133 - The Dole Queue
Replies: 42
Views: 5746
Wed Oct 08, 2003 8:36 pm
Forum: Volume 1 (100-199)
Topic: 102 - Ecological Bin Packing
Replies: 485
Views: 50081
The input consists of a series of lines with each line containing 9 integers.
Wed Oct 08, 2003 2:14 pm
Forum: Volume 104 (10400-10499)
Topic: 10427 - Naughty Sleepy Boys
Replies: 35
Views: 21242
Wed Oct 08, 2003 11:14 am
Forum: Volume 1 (100-199)
Topic: 133 - The Dole Queue
Replies: 42
Views: 5746
just replace

[cpp]
fgets(line,10000,stdin);
line[strlen(line)-1]=0;
sscanf(line,"%d %d %d",&n,&k,&m);
[/cpp]

by

[cpp]
scanf( "%d %d %d\n", &n, &k, &m );
[/cpp]
Wed Oct 08, 2003 11:12 am
Forum: Volume 1 (100-199)
Topic: 113 - Power of Cryptography
Replies: 162
Views: 16241
why would you?
the formula exp( log(p)/n ) correctly calculates the nth root of p
Tue Oct 07, 2003 11:25 pm
Forum: Algorithms
Topic: One interesting geometry problem...... Help me to solve it
Replies: 13
Views: 3282
what you mean by "segments" ?