## Search found 34 matches

Tue Mar 23, 2004 10:52 am
Forum: Algorithms
Topic: Distance between two convex poligons - help me
Replies: 1
Views: 1023

### Distance between two convex poligons - help me

There are 2 convex poligons (coord. are integer numbers) and I need to calculate the minimum distance between them. Who can give me some ideas????
Mon Jul 07, 2003 7:56 am
Forum: Volume 100 (10000-10099)
Topic: 10049 - Self-describing Sequence
Replies: 33
Views: 12877

### 10049 - Self-describing Sequence

Who can give me some ideas to solve this problem... I foud some information about this sequance of numbers that are called "Golomb's sequence". I know that the formulas for this sequance: "a(n) is nearest integer to (and asymptotic to) tau^(2-tau)*n^(tau-1), where tau is the golden number (1+sqrt(5)...
Sat Jun 28, 2003 7:01 pm
Forum: Volume 100 (10000-10099)
Topic: 10016 - Flip-Flop the Squarelotron
Replies: 5
Views: 2976
Maybe you already solved the problem... I solved the problem some time agoand I didn't find any special cases...
Fri Apr 04, 2003 6:34 pm
Forum: Volume 5 (500-599)
Topic: 545 - Heads
Replies: 67
Views: 43551
I can't find log2() function in Borland C++ that I use. Ok no problem because I'll download gcc and I'll try again. Pls. tell me what about the input. Which of them are correct ?!

Thanx anyway
Fri Apr 04, 2003 12:28 pm
Forum: Volume 5 (500-599)
Topic: 545 - Heads
Replies: 67
Views: 43551
Ok, but how must look this input? 2 5 6 and output 2^-5 = 3.125E-2 2^-6 = 1.563E-2 or input: 2 5 6 5 6 1 and output 2^-5 = 3.125E-2 2^-6 = 1.563E-2 2^-5 = 3.125E-2 2^-6 = 1.563E-2 2^-1 = 5.000E-1 In fact I tried both but the same result WA...
Thu Apr 03, 2003 2:59 pm
Forum: Volume 5 (500-599)
Topic: 545 - Heads
Replies: 67
Views: 43551

### 545 WA - 474 AC Who can help me???

Pls. tell me what's wrong with my code. I get WA but for 474 problem I got AC I modified the code so it round the result now, that means that for n=6 I obtain 1.563E-2, and for n=7 => 7.813E-3... [cpp] #include <stdio.h> #include <math.h> main() { long n; double u,a,l2; long b; l2=log10((double)2); ...
Wed Mar 26, 2003 1:31 pm
Forum: Volume 5 (500-599)
Topic: 531 - Compromise
Replies: 73
Views: 25160
Can you give me more input (and of course output) sample for this problem? I tried an DP algorithm but I received WA. I think that it's something tricky. How long must be the arrays because maybe this is an other problem... Is is ok with: type vect=array[1.100] of string; var x,y,z:vect; j,i,n,m...
Fri Feb 28, 2003 7:47 am
Forum: Volume 4 (400-499)
Topic: 414 - Machined Surfaces
Replies: 49
Views: 8783
Can you tell me what's wrong with my code. I verified with all this input and it works... The idea is that I calculate the sum of all spaces (sum) and the minimum number of the spaces in a line (min). The oputput is then sum-n*min... Is it ok??? [pascal] program p414; var s:string; sum:longint; n,mi...
Tue Jan 28, 2003 8:35 am
Forum: Volume 100 (10000-10099)
Topic: 10025 - The ? 1 ? 2 ? ... ? n = k problem
Replies: 42
Views: 11568
so S1=n(n+1)/2 D1=S1-S S2=(n+1)(n+2)/2 D2=S2-S S3=(n+2)(n+3)/2 D3=S3-S => d1/2 < N+1 d2/2 < (2N+1)/2 < N+1 d3/2 < (3N+3)/2 <=2N+3=(N+1)+(N+2 ) a) if D1 is even => exist k between 0 and N so that D1/2 =k (we saw that D1/2 < N/2) => S1-S=2k S1-2k=S 1+2+...+(k-1)+k+(k+1)+...+N-2k=S 1+2+...+(k-1)-k+(k+1...
Tue Jan 21, 2003 9:00 am
Forum: Volume 100 (10000-10099)
Topic: 10025 - The ? 1 ? 2 ? ... ? n = k problem
Replies: 42
Views: 11568
I can't see all bugs from your code... One that I found it is that the numbers must be "long" not "int" (n<=1000000000). I check your program with values -30..30 and 1000000000 and give the same result as my program wich was accepted...

I use the same ideea...

Carmen
Tue Jan 21, 2003 8:58 am
Forum: Volume 100 (10000-10099)
Topic: 10025 - The ? 1 ? 2 ? ... ? n = k problem
Replies: 42
Views: 11568
I can't see all bugs from your code... One that I found it is that the numbers must be "long" not "int" (n<=1000000000). I check your program with values -30..30 and 1000000000 and give the same result as my program wich was accepted...

Carmen
Tue Jan 21, 2003 8:05 am
Forum: Volume 100 (10000-10099)
Topic: 10025 - The ? 1 ? 2 ? ... ? n = k problem
Replies: 42
Views: 11568
I deleted the code, I think you can understend why... but I'll try to explain my algorithm... 1. You find the smallest n in that way that 1+2+...+n >= s (where s is the input) For this you have to solve the equation in n: n^2 + n 0 2s = 0 => n= ceil( (sqrt(1+8s) -1)/2 ) 2. Now your solution is n or ...
Thu Jan 16, 2003 2:11 pm
Forum: Volume 100 (10000-10099)
Topic: 10025 - The ? 1 ? 2 ? ... ? n = k problem
Replies: 42
Views: 11568
That was so useful hint for me. Thanks a lot because I was sure that the algorithm it's Ok but . . .

I was accepted now
Thu Jan 16, 2003 11:36 am
Forum: Volume 100 (10000-10099)
Topic: 10025 - The ? 1 ? 2 ? ... ? n = k problem
Replies: 42
Views: 11568
I solved the problem and it works for all inputs that I can find (in board or in the problem...) but I still receive WA. Can you tell what can be wrong?

[c]
deleted
[/c]
Wed Jan 15, 2003 7:01 pm
Forum: Volume 100 (10000-10099)
Topic: 10025 - The ? 1 ? 2 ? ... ? n = k problem
Replies: 42
Views: 11568
I solved the problem and it works for all inputs that I can find (here or in the problem...) but I still receive WA. Can you tell what can be wrong?

Carmen