题意:小车和球发生完全弹性碰撞,车的质量远大于球,求碰撞后球的速度
链接: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;
}
最后
以上就是传统白开水最近收集整理的关于HDOJ 5066 Harry And Physical Teacher的全部内容,更多相关HDOJ内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复