HDU 5066 Harry And Physical Teacher(物理 动量守恒 动能守恒)——BestCoder Round #14

Harry And Physical Teacher

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)


Problem Description
As we all know, Harry Porter learns magic at Hogwarts School. However, learning magical knowledge alone is insufficient to become a great magician. Sometimes, Harry also has to gain knowledge from other certain subjects, such as language, mathematics, English, and even algorithm. 
Today, Harry's physical teacher set him a difficult problem: if a small ball moving with a speed  V0  made a completely elastic collision with a car moving towards the same direction with a speed  V(V<V0) , and the car far outweighs the ball, what was the speed of the small ball after the collision?
This problem was so difficult that Harry hasn't figure out how to solve it. Therefore, he asks you for help. Could you do him this favor?
 

Input
They are several test cases, you should process to the end of file.
There are two integers  V  and  V0  for each test case. All the integers are 32-bit signed non-negative integers.
 

Output
For each test case, just output one line that contains an integer indicate the speed of the small ball after the collision.
 

Sample Input
  
  
0 10
 

Sample Output
  
  
-10
 

Source
 
/****************************************************/

出题人的解题思路:

这是去年一个学妹问我的物理题。我是这样考虑的:题目告诉我们,小球和车发生的是完全弹性碰撞,那么动能是守恒的,而碰撞过程中,动量也守恒。联立动能守恒,动量守恒方程。然后还有一个很特殊的条件,车的质量远大于小球,那么结合下实际情况,一个质量很小的物体撞质量很大的物体,大的物体的速度是不会发生变化的。有了这个条件,就可以求解了。推导过程如下: 用VV表示碰撞前车的速度,V'V表示碰撞后车的速度;用V_0V0表示碰撞前球的速度,用V_0'V0表示碰撞后球的速度;用MM表示车的质量,用mm表示球的质量。(M >> mM>>m)

题意:一个小球以V0的速度与一个速度为V的同方向的小车发生完全弹性碰撞,问碰撞后小球的速度是多少

解题思路:因为小球与小车发生的是完全弹性碰撞,故他们组成的系统动能守恒、动量也守恒。因此可得


转化一下上述方程组即可得到


移项后可得


将此式子代入②式中,可得


因为M>>m,即M远大于m,那么上式还可以转化为


#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<queue>
#include<stack>
#include<math.h>
#include<vector>
#include<map>
#include<set>
#include<stdlib.h>
#include<cmath>
#include<string>
#include<algorithm>
#include<iostream>
#define exp 1e-10
using namespace std;
const int N = 105;
const int inf = 2147483647;
const int mod = 2009;
int main()
{
    int v,v0;
    while(~scanf("%d%d",&v,&v0))
        printf("%d\n",2*v-v0);
    return 0;
}
菜鸟成长记


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值