1 条题解
-
0
1.如果绳长l >= 桥高s,那么重力势能全部转化为动能wgh = 1/2wv^2,
求出到达地面的速度v,如果v > 10,则 Killed by the impact.
否则能存活James Bond survives.
2.如果绳长l < s,则找绳的最大形变量,当绳到达最大长度l2时,重力势能全部转化为弹性势能wgh = 1/2kl1^2,
绳子的最大长度l2=本身长度l+形变量l1,如果绳的最大长度l2<s,则人在半空中Stuck in the air.
否则重力势能转化为动能和弹性势能(此时绳的形变量 = (s - l))wgh = 1/2k(s - l)^2 + 1/2wv^2,
求出到地面的速度v,如果v>10,则Killed by the impact.
否则能存活James Bond survives.
#include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> #define g 9.81 using namespace std; int main() { double k, l, s, w; while(scanf("%lf%lf%lf%lf", &k, &l, &s, &w), k + l + s + w) { if(l >= s) { double v = sqrt(2 * g * s); if(v > 10) printf("Killed by the impact.\n"); else printf("James Bond survives.\n"); continue; } else { double l1 = sqrt(1.0 * 2 * w * g * s / k); if(l + l1 < s) printf("Stuck in the air.\n"); else { double v = sqrt(1.0 * (2 * w * g * s - k * (s - l) * (s - l)) / w); if(v > 10) printf("Killed by the impact.\n"); else printf("James Bond survives.\n"); } } } return 0; }
- 1
信息
- ID
- 1464
- 时间
- 1000ms
- 内存
- 64MiB
- 难度
- (无)
- 标签
- 递交数
- 0
- 已通过
- 0
- 上传者