10509 - R U Kidding Mr. Feynman?
Moderator: Board moderators
WHATS WRONG 10509???
MY OUTPUT FOR THE CORRESPONDING INPUT 1.0000 IS :->
INPUT:
1.0000
OUTPUT:
1.0000
WHAT IS THE RIGHT?????
THANK'S
ROCKY.
INPUT:
1.0000
OUTPUT:
1.0000
WHAT IS THE RIGHT?????
THANK'S
ROCKY.
10509-WA
please help me.I dont know why i m getting wrong answer.I thougt a lot a nd could not find anything wrong.please write what's wrong with it.I m very depressed
.Plz help me.Here is the code.
..........
.........
// Code deleted after AC![:lol:](./images/smilies/icon_lol.gif)
![:oops:](./images/smilies/icon_redface.gif)
![:oops:](./images/smilies/icon_redface.gif)
..........
.........
// Code deleted after AC
![:lol:](./images/smilies/icon_lol.gif)
Last edited by tuman on Sat Oct 29, 2005 3:00 pm, edited 1 time in total.
We the dreamer of the dreamy dream...
![:lol:](./images/smilies/icon_lol.gif)
Anyway no help is necessary.Actually it contains bloody precision error.
i misplaced 0.000000001 at the end.But it should be added where its needed to be added.
Its all about rejecting precision error,before adding 0.0000000001
i got wrong answer and then after adding this i get ac.precision error
of this problem is unjustificable ,unless we do it. Tuman
We the dreamer of the dreamy dream...
-
- New poster
- Posts: 20
- Joined: Thu Jan 17, 2008 10:47 pm
- Location: India
WA
I am getting WA for following code---
![:(](./images/smilies/icon_frown.gif)
please help ....
![:(](./images/smilies/icon_frown.gif)
Code: Select all
#include<iostream>
using namespace std;
int main()
{
float n,a,b;
int i;
cin>>n;
while(n!=0)
{
for(i=1;i<=100;i++)
{
if(i*i*i > n)
break;
}
a=i-1;
b=(a+ (n-a*a*a)/(2*a*a + a*a));
printf("%.4f\n",b);
cin>>n;
}
}
please help ....
"if u r goin thru hell, keep goin"
-
- Learning poster
- Posts: 84
- Joined: Fri Jan 09, 2009 4:37 pm
- Location: IRAN
Re: 10509 - R U Kidding Mr. Feynman?
To theharshest
i think you should use EPS
...
i got acc in 0.130 and i use pow() , how can i calculate n^(1/3) in faster method ?
thanks in advance![:wink:](./images/smilies/icon_wink.gif)
i think you should use EPS
...
i got acc in 0.130 and i use pow() , how can i calculate n^(1/3) in faster method ?
thanks in advance
![:wink:](./images/smilies/icon_wink.gif)
Impossible says I`m possible
Re: 10509 - R U Kidding Mr. Feynman?
I have read all the posts but still getting Presentation error ![:(](./images/smilies/icon_frown.gif)
I have submitted more than times with different sorts of precision and various new lines formats (no newline->PE,one new line after each output->PE,one new line after each output except the last one->PE
)
I would really appreciate any kind of help
![:(](./images/smilies/icon_frown.gif)
I have submitted more than times with different sorts of precision and various new lines formats (no newline->PE,one new line after each output->PE,one new line after each output except the last one->PE
![:evil:](./images/smilies/icon_evil.gif)
I would really appreciate any kind of help
![:)](./images/smilies/icon_smile.gif)
Code: Select all
#include<iostream>
#include <iomanip>
using namespace std;
int main()
{
int a,i;
double n;
double dx,res;
while(cin>>n && n!=0)
{
for(i=1;i<=100;i++)
{
if(i*i*i > n)
break;
}
a=i-1;
dx = (n-a*a*a)/(3*a*a);
res = ((double)a +dx+0.000000001);
cout << setprecision(4) << setiosflags(ios::fixed)<<res<<endl;
}
return 0;
}
Re: 10509 - R U Kidding Mr. Feynman?
actually, you just missing enter after you print the output
try this for the output :
and you will get AC
![:lol:](./images/smilies/icon_lol.gif)
try this for the output :
Code: Select all
printf("%.4lf\n",res);
![:lol:](./images/smilies/icon_lol.gif)
![:lol:](./images/smilies/icon_lol.gif)
Re: 10509 - R U Kidding Mr. Feynman?
all of you try this test:
And you will see where is you mistake!
Code: Select all
1000000.0
0
-
- New poster
- Posts: 1
- Joined: Mon Sep 15, 2014 8:05 am
Re: 10509 - R U Kidding Mr. Feynman?
This is stupid, again!
instead of
should be
and got AC....
instead of
Code: Select all
printf("%.4I64d\n", a + b);
Code: Select all
output = a + b;
printf("%.4lf\n", output);