【CUGBACM15级BC第14场 A】Harry And Physical Teacher
来源:互联网 发布:单片机报警器汇编程序 编辑:程序博客网 时间:2024/06/06 00:00
Harry And Physical Teacher
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 861 Accepted Submission(s): 443
Total Submission(s): 861 Accepted Submission(s): 443
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 speedV0 made a completely elastic collision with a car moving towards the same direction with a speedV(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?
Today, Harry's physical teacher set him a difficult problem: if a small ball moving with a speed
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 integersV and V0 for each test case. All the integers are 32-bit signed non-negative integers.
There are two 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
高中物理不解释
/* ***********************************************┆ ┏┓ ┏┓ ┆┆┏┛┻━━━┛┻┓ ┆┆┃ ┃ ┆┆┃ ━ ┃ ┆┆┃ ┳┛ ┗┳ ┃ ┆┆┃ ┃ ┆┆┃ ┻ ┃ ┆┆┗━┓ 马 ┏━┛ ┆┆ ┃ 勒 ┃ ┆ ┆ ┃ 戈 ┗━━━┓ ┆┆ ┃ 壁 ┣┓┆┆ ┃ 的草泥马 ┏┛┆┆ ┗┓┓┏━┳┓┏┛ ┆┆ ┃┫┫ ┃┫┫ ┆┆ ┗┻┛ ┗┻┛ ┆************************************************ */#include <iostream>#include <set>#include <map>#include <stack>#include <cmath>#include <queue>#include <cstdio>#include <bitset>#include <string>#include <vector>#include <iomanip>#include <cstring>#include <algorithm>#include <functional>#define PI acos(-1)#define eps 1e-8#define inf 0x3f3f3f3f#define debug(x) cout<<"---"<<x<<"---"<<endltypedef long long ll;using namespace std;ll v1 , v2;int main ( ){ while (~scanf("%I64d%I64d", &v1, &v2)) { printf ( "%I64d\n" , 2 * v1 - v2 ); }}/************************************************┆ ┏┓ ┏┓ ┆┆┏┛┻━━━┛┻┓ ┆┆┃ ┃ ┆┆┃ ━ ┃ ┆┆┃ ┳┛ ┗┳ ┃ ┆┆┃ ┃ ┆┆┃ ┻ ┃ ┆┆┗━┓ ┏━┛ ┆┆ ┃ ┃ ┆ ┆ ┃ ┗━━━┓ ┆┆ ┃ AC代马 ┣┓┆┆ ┃ ┏┛┆┆ ┗┓┓┏━┳┓┏┛ ┆┆ ┃┫┫ ┃┫┫ ┆┆ ┗┻┛ ┗┻┛ ┆************************************************ */
阅读全文
0 0
- 【CUGBACM15级BC第14场 A】Harry And Physical Teacher
- 【CUGBACM15级BC第25场 A】hdu 5154 Harry and Magical Computer
- 【CUGBACM15级BC第14场 B】Harry And Dig Machine
- 【CUGBACM15级BC第25场 B】hdu 5155 Harry And Magic Box
- BestCoder Round #14 A题 Harry And Physical Teacher
- 【CUGBACM15级BC第11场 A】hdu 5054 Alice and Bob
- 【CUGBACM15级BC第19场 A】hdu 5108 Alexandra and Prime Numbers
- 【CUGBACM15级BC第22场 A】hdu 5142 NPY and FFT
- 【CUGBACM15级BC第27场 A】hdu 5162 Jump and Jump...
- 【CUGBACM15级BC第7场 A】hdu 4985 Little Pony and Permutation
- 【CUGBACM15级BC第15场 A】hdu 5083 Love
- 【CUGBACM15级BC第17场 A】hdu 5100 Chessboard
- 【CUGBACM15级BC第23场 A】hdu 5146 Sequence
- 【CUGBACM15级BC第8场 A】hdu 4989 Summary
- 【CUGBACM15级BC第31场 A】hdu 5178 pairs
- 【CUGBACM15级BC第1场 A】hdu 4857 逃生
- HDU5066-Harry And Physical Teacher
- Bestcoder Round 14# 1001 Harry And Physical Teacher
- 字符串练习——删除子串的n中方法
- python学习(基础补充)--字典、条件语句、循环
- .NET快速信息化系统开发框架 V3.2->WinForm版本新增新的角色授权管理界面效率更高、更规范
- 2017百度之星资格赛:1004. 度度熊的午饭时光(01背包+记录路径)
- 名称查找,确定作用域,覆盖
- 【CUGBACM15级BC第14场 A】Harry And Physical Teacher
- 修改文件时间
- # NIO 实例demo-Client
- 启动dubbo报错解决:java.lang.RuntimeException: java.io.IOException: invalid constant type: 15
- HDU6069-Counting Divisors 约数个数定理+素数分解
- 二元多项式(简单链表操作,注释很好理解)
- 常见的多媒体知识解析
- 字符串练习——用不同的方法实现字符串平移问题
- 欢迎使用CSDN-markdown编辑器