首页 > 代码库 > HDU - 5066 Harry And Physical Teacher ( 物理-动量守恒+能量守恒 )

HDU - 5066 Harry And Physical Teacher ( 物理-动量守恒+能量守恒 )

 

HDU - 5066 Harry And Physical Teacher

 

昨天BC的第一题,当时WA一发,一开始直接觉得是碰撞后直接反弹。

直接上官方题解

我觉得还是应该叫做能量守恒 和 动量守恒

#include <cstdio>#include <cstring>#include <iostream>#include <algorithm>#include <set>#include <stack>#include <list>#include <vector>#include <map>#include <ctime>#include <cmath>using namespace std;typedef __int64 LL;#define CLR( a, b )     memset( a, b, sizeof(a) );void Orz(){    LL v1,v2;    while( ~scanf( "%I64d %I64d", &v1, &v2) )    {        printf( "%I64d\n", 2*v1 - v2 );    }}int main(){    Orz();    return 0;}
代码君

 

HDU - 5066 Harry And Physical Teacher ( 物理-动量守恒+能量守恒 )