Title: Give K: the strength coefficient of the rope, L: Rope length, S: Bridge height, W: Bond quality, G take 9.81. Rope elasticity = shape variable * stiffness coefficient. If the landing speed of more than 10 fell to die, less than 0 floating in the air.
Topic Idea: According to energy conservation know: the kinetic energy of the ground = gravitational potential energy reduction-the rope stretch work. If l>s, the rope does not work.
#include <cstdio>#include<stdio.h>#include<cstdlib>#include<cmath>#include<iostream>#include<algorithm>#include<cstring>#include<vector>#include<queue>#defineINF 0x3f3f3f3f#defineMAX 1000005using namespacestd;intMain () {Doublek,l,s,w,we,g=9.81, V;//We are floor-standing kinetic energy while(SCANF ("%LF%LF%LF%LF", &k,&l,&s,&w), k+l+s+W) {if(L > s)//if the rope is greater than the height of the bridge, the elasticity of the rope does not work, and the kinetic increment equals the gravitational potential energy reduction.{v=SQRT (2*g*s); } Else//Otherwise, the kinetic energy of the landing is equal to the reduction of gravitational potential energy-the rope is elastic. Average elasticity of rope = average shape variable *k{We=w*g*s-((s-l)/2.0) * (s-l) *K; if(We <0)//If the ground kinetic energy is less than 0, it must be 0 before landing, and floating in midair.{printf ("Stuck in the air.\n"); Continue; } v=sqrt ((we*2)/W); } if(V >Ten) printf ("killed by the impact.\n"); Elseprintf ("James Bond survives.\n"); } return 0;}
View Code
HDU 1155 Bungee Jumping physical