Title Link:http://acm.hdu.edu.cn/showproblem.php?pid=1155
The topic is very long, but it is easy to understand, that is, people jump from the high S bridge, the hand is pulling the end of the rope long as L, if the rope too short, so people will be out in the air. Stuck in the air.
If the man landed at a speed greater than 10, he died, and the outputkilled by the impact.Otherwise, it's a live output.James Bond survives.
Simple physics Questions: If people can go to the ground then the gravitational potential energy into kinetic energy, in which there will be a rope to do negative work;
EP=MGH;
WF=K*L*L/2; where L is a shape variable; k is the stiffness coefficient of a rope;
#include <iostream>#include<algorithm>#include<stdio.h>#include<math.h>#include<string.h>#include<stdlib.h>using namespacestd;#defineG 9.81intMain () {DoubleK, L, S, W, E, V; while(SCANF ("%LF%LF%LF%LF", &k, &l, &s, &w), k+l+s+W) {e= w*g*s; if(s>l) E=e-k* (s-l) * (s-l)/2; if(e<0) {printf ("Stuck in the air.\n"); Continue; } v=SQRT (2*e/W); if(v>Ten) printf ("killed by the impact.\n"); Elseprintf ("James Bond survives.\n"); } return 0;}
View Code
Bungee Jumping---hdu1155 (physics problem)