Posted:

**Thu Mar 27, 2008 8:15 pm**Try the set.

Hope it helps.

**Input:**Code: Select all

```
6
1
31727
490
407
677
29070
0
```

**Output:**Code: Select all

`2.535463`

Page **7** of **7**

Posted: **Thu Mar 27, 2008 8:15 pm**

Try the set.

**Input:**
**Output:**
Hope it helps.

Code: Select all

```
6
1
31727
490
407
677
29070
0
```

Code: Select all

`2.535463`

Posted: **Sat Aug 16, 2008 10:00 pm**

Where i the problem here

I can't fix

Plz take a look
Plz help anyone

I can't fix

Plz take a look

Code: Select all

```
Silly Mitake
Anyway AC now
```

Posted: **Sun Jan 04, 2009 10:55 pm**

cant find any mistake..

pls someone help me..

Code: Select all

```
removed after AC..
```

Posted: **Sun Jan 04, 2009 11:25 pm**

Check this line:

Good luckAnswers must be rounded to six digits after the decimal point.

Posted: **Mon Jan 05, 2009 12:47 am**

Thanks a lot..

Take care.. & God bless you..

Take care.. & God bless you..

Posted: **Mon Aug 03, 2009 1:50 pm**

I don't pass the proposed inputs in this thread but I don't know what I'm doing wrong. Here's my code:

It seems that for large inputs, something is wrong with my code and gives a wrong expected pi.

Code: Select all

```
Removed after accepted
```

Posted: **Mon Aug 03, 2009 2:51 pm**

In this line:

Use something like:

you have an integer division, which rounds the result of division down to the nearest integer.double expected_pi = sqrt(6*npairs/compta);

Use something like:

Code: Select all

```
double expected_pi = sqrt(6*npairs/(double)compta);
or:
double expected_pi = sqrt(6.0*npairs/compta);
```

Posted: **Mon Aug 03, 2009 11:21 pm**

Thanks again mf

Posted: **Thu Aug 05, 2010 8:27 pm**

#include<stdio.h>

#include<math.h>

long a[1000000];

int main(){

long n, i, j, x, p, q ;

while(scanf("%ld",&n)==1){

long num =0, sum=0;

if(n == 0)

return 0;

for(i=0; i<n; i++)

scanf("%ld",&a*);*

for(i=0; i<n; i++){

for(j=i+1; j<n; j++){

num++;

if(a* == 1 && a[j]==1){*

sum++;

continue;

}

x = a* % a[j];*

p = a[j];

while(x != 0){

if(x == 1){

sum++ ;

break ;

}

q = x ;

x = p % x ;

p = q ;

}

}

}

if(sum == 0)

printf("No estimate for this data set.\n");

else

printf("%.6f\n",sqrt((6/(float)sum)*num));

}

return 0;

}

//In every time i got wrong answer. why ??

#include<math.h>

long a[1000000];

int main(){

long n, i, j, x, p, q ;

while(scanf("%ld",&n)==1){

long num =0, sum=0;

if(n == 0)

return 0;

for(i=0; i<n; i++)

scanf("%ld",&a

for(i=0; i<n; i++){

for(j=i+1; j<n; j++){

num++;

if(a

sum++;

continue;

}

x = a

p = a[j];

while(x != 0){

if(x == 1){

sum++ ;

break ;

}

q = x ;

x = p % x ;

p = q ;

}

}

}

if(sum == 0)

printf("No estimate for this data set.\n");

else

printf("%.6f\n",sqrt((6/(float)sum)*num));

}

return 0;

}

//In every time i got wrong answer. why ??

Posted: **Wed Aug 18, 2010 8:10 am**

I found every time Wrong Answer for this problem...

Is there any spacial input output for this problem ???

If there , then any one please give me the input output.... I am so fucked up for this problem...

Help me...........!!!

Is there any spacial input output for this problem ???

If there , then any one please give me the input output.... I am so fucked up for this problem...

Help me...........!!!

Posted: **Wed May 02, 2012 7:34 pm**

please help me ....

don't know why WA!!!!!!!!!!

don't know why WA!!!!!!!!!!

Code: Select all

```
//code removed after AC
```

Posted: **Wed May 02, 2012 11:23 pm**

On my machine your code prints 0.000000 for the first sample input. Your printf is using %Lf or long double, but sqrt returns a %lf or double.

Posted: **Thu May 03, 2012 5:13 pm**

Oh got AC ........brianfry713 wrote:On my machine your code prints 0.000000 for the first sample input. Your printf is using %Lf or long double, but sqrt returns a %lf or double.

So thanks bosssssss

Posted: **Sun Mar 22, 2015 1:58 pm**

Code: Select all

```
#include<stdio.h>
#include<math.h>
int main()
{
int i,j,a[50],d,temp,N,t;
while(1)
{
d=0,t=0;
scanf("%d",&N);
if(N==0)
break;
for(i=0;i<N;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<N-1;i++)
{
for(j=i+1;j<N;j++)
{
if(a[i]<a[j])
{
temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}
}
for(i=0;i<N-1;i++)
{
for(j=i+1;j<N;j++)
{
if((a[i]%a[j]!=0))
{
if((a[i]%2!=0)||(a[j]%2!=0))
d++;
}
t++;
}
}
if(d==0)
printf("No estimate for this data set.\n");
else
printf("%.6lf\n",sqrt((6*t)/d));
}
return 0;
}
```

Posted: **Sun Mar 22, 2015 2:22 pm**

Code: Select all

```
#include<stdio.h>
#include<math.h>
int main()
{
int i,j,a[50],d,temp,N,t;
while(1)
{
d=0,t=0;
scanf("%d",&N);
if(N==0)
break;
for(i=0;i<N;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<N-1;i++)
{
for(j=i+1;j<N;j++)
{
if(a[i]<a[j])
{
temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}
}
for(i=0;i<N-1;i++)
{
for(j=i+1;j<N;j++)
{
if((a[i]%a[j]!=0))
{
if((a[i]%2!=0)||(a[j]%2!=0))
d++;
}
t++;
}
}
if(d==0)
printf("No estimate for this data set.\n");
else
printf("%.6lf\n",sqrt((6*t)/d));
}
return 0;
}
```