Page 1 of 4

Posted: Tue Jul 23, 2002 11:03 pm
by Dominik Michniewski
use

Code: Select all

printf("%.0lf ... 
instead of

Code: Select all

printf("%Lf .... 
it should help ....

Posted: Thu Jul 25, 2002 2:57 pm
by sanat
Shohel, u r supposed to print a long int in output... as maximum output is 40000 or -40000.

why using float or double?

read the problem carefully....it's so easy...isn't it? :roll:

~Sanat

Posted: Mon Dec 09, 2002 5:42 am
by Eric3k
Could any one explain me why the the answer is 2vt? From what I can see this would only be the case if the velocity was constant, but according to the problem, it has an acceleration, so the function d=vt no longer applies.
Thanks

Posted: Mon Dec 09, 2002 8:54 am
by Dominik Michniewski
Read the question very carefully and answer surprize you :-)
Think about what query states ?? (Hint: how is formula of velocity in this kind of movement ?)

Best regards
Dominik

Posted: Sun Jun 22, 2003 4:16 pm
by hujialie
To Eric3
because :
v=v0+a*t;
d=v0*(2*t)+1/2*a*(2*t)*(2*t)=2*v0*t+2*a*t*t=2*t*(v0+a*t).
==>
d=v*2*t.

Unhappy problemsetter

Posted: Sun Jun 22, 2003 4:27 pm
by shahriar_manzoor
When I set this problem I did not consider it to become problem-solvers' sweetheart, but now I guess many have solved this problem without understanding it :( .

Ofcourse the method of hujialie is what I expected everyone to derive.

Posted: Mon Jun 23, 2003 8:16 am
by shamim
When I set this problem I did not consider it to become problem-solvers' sweetheart, but now I guess many have solved this problem without understanding it .
Yes, it is true, i know many novice problem solver who had difficulty solving
problem 100, yet they somehow noticed that the answer to this problem is 2*a*b,
where a and b are the two inputs.
They have no idea on why the formula is 2*v*t. :(

Posted: Sun Jun 29, 2003 1:13 am
by Farid Ahmadov
Hi.
I don't think that it is a high school problem.
Where do we take formula 2*v*t from?

a - acceleration; v0 - initial speed; v - current speed; t1 - time; t2 - twice of t1; d - distance at time t2;

v = v0 + a*t1;
formula for distance : d = v0*t+(a*t^2)/2;
d = v0*t2 + (a*t2^2)/2 = v0*2*t1 + (a*4*t1^2)/2 = t1*(2*v0 + 2*a*t1) = 2*t1*(v0 + a*t1) = 2*t1*(v);

That is how we get 2*v*t.
I wrote it to help those who don't know it.

Good luck!

Posted: Sat Aug 09, 2003 8:10 am
by UFP2161
Shouldn't the first line actually be:
A particle has initial velocity and CONSTANT acceleration.
Every physics problem that I've ever encountered delaing with that formula has the word constant in it. Yeah, I know I'm being anal and all, but without that one word, it shouldn't even be solvable =)

10071

Posted: Wed Sep 10, 2003 4:23 am
by amd-RS
Hello,

Is there a way to optimize this problem, it's very simple, but I get 0.094 sec.

Thanks, Aur

Posted: Mon Oct 27, 2003 6:49 pm
by Jewel of DIU
[c] Just print s*v*t*2 after take input. Directly print this,no pre calculate need[/c]

10071 wa???1?

Posted: Wed Mar 03, 2004 8:25 am
by keceman
hi... i don't know why this give me WA...


/* @JUDGE_ID: 43238WF 10071 C++ */

#include <iostream.h>

void main()
{
long v=0, t=0;
cin >> v >> t;
cout << v*t*2 << endl;
}


thx a lot...

Posted: Wed Mar 03, 2004 9:59 am
by yatsen
There are more than one test data.
So you should have a loop in your program.

Posted: Wed Mar 03, 2004 10:05 am
by keceman
hm... how do i use the loop? i've tried
while(1)
{
blablabla
}

and
while (!EOF)
{
blablabla
}

and still not work...... could u help me?? please... thx a lot...

Posted: Wed Mar 03, 2004 10:18 am
by yatsen
I use C, not C++
The following is the code
[c]
while ( scanf("%d %d",&v,&t)==2 )
{
printf("%d\n",2*v*t);
}
[/c]