题意:小车和球发生完全弹性碰撞,车的质量远大于球,求碰撞后球的速度
链接:http://acm.hdu.edu.cn/showproblem.php?pid=5066
思路:物理题,建立动能守恒方程,推导公式后求得V' = 2V - V0
注意点:无。
以下为AC代码:
Run ID | Submit Time | Judge Status | Pro.ID | Exe.Time | Exe.Memory | Code Len. | Language | Author |
11909577 | 2014-10-19 12:12:27 | Accepted | 5066 | 0MS | 336K | 534 B | G++ | luminous |
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <vector>
#include <deque>
#include <list>
#include <cctype>
#include <algorithm>
#include <climits>
#include <queue>
#include <stack>
#include <cmath>
#include <set>
#include <iomanip>
#include <cstdlib>
#include <ctime>
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
int main()
{
int m, n;
while ( cin >> m >> n )
{
cout << m - ( n - m ) << endl;
}
return 0;
}