标签:style blog color io os ar sp 2014 on
思路:利用物理里面的动量守恒公式,由于保证小车质量远大于小球,所以可以把小车质量当成无穷大带进去,得到答案为2 * v0 - v;
代码:
#include <cstdio>
#include <cstring>
#include <vector>
using namespace std;
typedef long long ll;
int v, v0;
int main() {
while (~scanf("%d%d", &v, &v0)) {
printf("%d\n", -v0 + 2 * v);
}
return 0;
}HDU 5066 Harry And Physical Teacher(物理题)
标签:style blog color io os ar sp 2014 on
原文地址:http://blog.csdn.net/accelerator_/article/details/40220765