## 10071 - Back to High School Physics

Moderator: Board moderators

Dominik Michniewski
Guru
Posts: 834
Joined: Wed May 29, 2002 4:11 pm
Location: Wroclaw, Poland
Contact:
use

Code: Select all

``printf("%.0lf ... ``

Code: Select all

``printf("%Lf .... ``
it should help ....
sanat
New poster
Posts: 1
Joined: Thu Jul 25, 2002 2:19 pm
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?

~Sanat
Eric3k
New poster
Posts: 29
Joined: Mon Apr 29, 2002 5:22 pm
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
Dominik Michniewski
Guru
Posts: 834
Joined: Wed May 29, 2002 4:11 pm
Location: Wroclaw, Poland
Contact:
Think about what query states ?? (Hint: how is formula of velocity in this kind of movement ?)

Best regards
Dominik
hujialie
New poster
Posts: 43
Joined: Thu Apr 17, 2003 10:24 am
Location: Shanghai,China
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.
shahriar_manzoor
Posts: 399
Joined: Sat Jan 12, 2002 2:00 am

### Unhappy problemsetter

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.
shamim
A great helper
Posts: 498
Joined: Mon Dec 30, 2002 10:10 am
Location: Bozeman, Montana, USA
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.
Experienced poster
Posts: 131
Joined: Thu Apr 17, 2003 8:39 am
Location: Baku, Azerbaijan
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!
_____________
NO sigNature
UFP2161
A great helper
Posts: 277
Joined: Mon Jul 21, 2003 7:49 pm
Contact:
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 =)
amd-RS
New poster
Posts: 27
Joined: Thu Sep 05, 2002 7:37 am

### 10071

Hello,

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

Thanks, Aur
Jewel of DIU
New poster
Posts: 32
Joined: Thu Jul 31, 2003 6:21 am
Contact:
[c] Just print s*v*t*2 after take input. Directly print this,no pre calculate need[/c]
Hate WA
Visit phpBB!
keceman
New poster
Posts: 7
Joined: Wed Mar 03, 2004 6:51 am

### 10071 wa???1?

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...
yatsen
Learning poster
Posts: 68
Joined: Fri Nov 23, 2001 2:00 am
Location: taiwan
There are more than one test data.
So you should have a loop in your program.
keceman
New poster
Posts: 7
Joined: Wed Mar 03, 2004 6:51 am
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...
yatsen
Learning poster
Posts: 68
Joined: Fri Nov 23, 2001 2:00 am
Location: taiwan
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]