## Search found 8 matches

Thu Dec 04, 2003 8:06 pm
Forum: Volume 2 (200-299)
Topic: 278 - Chess
Replies: 22
Views: 2784
I used this algorithm. But still WA. I think the Knigths causing me the problem. Can anyone help me with some input.

Thanks for the reply
Tue Dec 02, 2003 6:45 am
Forum: Volume 2 (200-299)
Topic: 278 - Chess
Replies: 22
Views: 2784

### 278 - Chess

Can anyone give me some critical input. I am trying this quite a some time. I am getting WA.

Sat May 03, 2003 10:12 am
Forum: Volume 5 (500-599)
Topic: 557 - Burger
Replies: 12
Views: 6431
I use the pre calculate proecess and find the res using this.
But i got TLE. Help me

Code: Select all

``````long double do_it(long n)
{
n-=2;
long double rs=1,r1;
long p=n/2;

for(;p>0;)
{
r1=p*4;
r1=n/r1;
rs*=r1;
n--;p--;
}
rs=1-rs;
return rs;
}
``````
Sat Dec 28, 2002 6:21 am
Forum: Algorithms
Topic: Prime Factors !!!!!!
Replies: 12
Views: 5862
There is a method to find the prime factors and the power risen by them to produce any number n. Just see that. m=summation of(floor(n/(p^i))) where p is a prime and i is 1,2... until n/(p^i) become 0. By this way u can find m such that p^m is a factor of n and m is the highest power raised by p whi...
Sun Dec 15, 2002 8:26 am
Forum: Volume 103 (10300-10399)
Topic: 10354 - Avoiding Your Boss
Replies: 47
Views: 21936
Don't Worry Rony Try to catch me, 1. First run a all pair shortest paths. 2. Then find the nodes which are in the shortest path of boss (source to dest) 3. The run a single source shortest path of the employee excluding the nodes of the boss's shortest path. 4. If exist then print the cost 5. If not...
Tue Nov 26, 2002 7:43 am
Forum: Volume 103 (10300-10399)
Topic: 10397 - Connect the Campus
Replies: 75
Views: 26627
Thanks, I have fixed my problem
Tue Oct 29, 2002 9:26 am
Forum: Volume 3 (300-399)
Topic: 332 - Rational Numbers from Repeating Fractions
Replies: 83
Views: 21168
Sorry, the number of the problem 332
Sat Oct 26, 2002 9:20 am
Forum: Volume 3 (300-399)
Topic: 332 - Rational Numbers from Repeating Fractions
Replies: 83
Views: 21168

### Fix my problem

Can anyone tell me where is my fault: :cry: #include <stdio.h> #include <math.h> double gcd(double m,double n) { double r=fmod(m,n); while(r) { m=n; n=r; r=fmod(m,n); } return n; } void main(void) { double cse=1,x,nn,dd,j,k,div,pp,d,f; unsigned long long dummy; double dum; while(2==scanf("%lf%lf",&j...