10509 - R U Kidding Mr. Feynman?

All about problems in Volume 105. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

User avatar
Rocky
Experienced poster
Posts: 124
Joined: Thu Oct 14, 2004 9:05 am
Contact:

WHATS WRONG 10509???

Post by Rocky » Sun Jan 16, 2005 12:03 pm

MY OUTPUT FOR THE CORRESPONDING INPUT 1.0000 IS :->

INPUT:
1.0000

OUTPUT:
1.0000

WHAT IS THE RIGHT?????

THANK'S
ROCKY.

Zuberul
New poster
Posts: 28
Joined: Sun Oct 24, 2004 9:46 pm
Location: dhaka
Contact:

Post by Zuberul » Sun Jan 16, 2005 7:42 pm

yes thats right
now... i cant tell much.because its a straight forward problem.
check you are giving correct output for maximum inputs.

hope it helps.

User avatar
Rocky
Experienced poster
Posts: 124
Joined: Thu Oct 14, 2004 9:05 am
Contact:

Post by Rocky » Fri Jan 21, 2005 9:40 am

YEH....!
I GOT ACC NOW.ACTUALLY IT CAUSE FOR SIMPLE PRECISSION ERROR
WHICH I CAN NOT NOTICE BEFORE.

THANK'S

ROCKY

User avatar
tuman
New poster
Posts: 24
Joined: Sat Oct 22, 2005 7:30 pm
Location: CUET
Contact:

10509-WA

Post by tuman » Sat Oct 22, 2005 8:08 pm

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 :oops: .Plz help me.Here is the code. :oops:
..........
.........

// Code deleted after AC :lol:
Last edited by tuman on Sat Oct 29, 2005 3:00 pm, edited 1 time in total.
We the dreamer of the dreamy dream...

User avatar
tuman
New poster
Posts: 24
Joined: Sat Oct 22, 2005 7:30 pm
Location: CUET
Contact:

Post by tuman » Mon Oct 24, 2005 12:03 am

:lol: Finally i hv made it accepted.
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...

SARKAR
New poster
Posts: 21
Joined: Tue May 22, 2007 4:18 pm

Post by SARKAR » Fri Jun 15, 2007 8:06 am


I USED BINARY SEARCH AND LOOKUP TABLE AND GOT ACCEPTED IN .252 SEC.
:lol: [/quote]

User avatar
theharshest
New poster
Posts: 20
Joined: Thu Jan 17, 2008 10:47 pm
Location: India

WA

Post by theharshest » Fri Feb 22, 2008 6:29 pm

I am getting WA for following code---
:(

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"

User avatar
vahid sanei
Learning poster
Posts: 84
Joined: Fri Jan 09, 2009 4:37 pm
Location: IRAN

Re: 10509 - R U Kidding Mr. Feynman?

Post by vahid sanei » Mon Mar 02, 2009 7:23 pm

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:
Impossible says I`m possible

yeah
New poster
Posts: 1
Joined: Fri Jun 12, 2009 3:24 pm

Re: 10509 - R U Kidding Mr. Feynman?

Post by yeah » Sat Jun 13, 2009 7:48 pm

I have read all the posts but still getting Presentation error :(
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: )
I would really appreciate any kind of help :)

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;
}

seraph
New poster
Posts: 9
Joined: Tue Dec 15, 2009 4:18 pm

Re: 10509 - R U Kidding Mr. Feynman?

Post by seraph » Sat Jun 26, 2010 6:43 am

actually, you just missing enter after you print the output
try this for the output :

Code: Select all

printf("%.4lf\n",res);
and you will get AC :lol: :lol:

Igor9669
Learning poster
Posts: 85
Joined: Sun Jun 08, 2008 12:58 pm

Re: 10509 - R U Kidding Mr. Feynman?

Post by Igor9669 » Sat Nov 13, 2010 8:22 am

all of you try this test:

Code: Select all

1000000.0
0
And you will see where is you mistake!

ducviet321
New poster
Posts: 1
Joined: Mon Sep 15, 2014 8:05 am

Re: 10509 - R U Kidding Mr. Feynman?

Post by ducviet321 » Mon Sep 15, 2014 8:09 am

This is stupid, again!

instead of

Code: Select all

printf("%.4I64d\n", a + b);
should be

Code: Select all

output = a + b;
printf("%.4lf\n", output);
and got AC....

Post Reply

Return to “Volume 105 (10500-10599)”