高中物理题:汽车以恒定功率启动。
https://www.zybang.com/question/3a5bdab5c8422ba094cba86fb5dcdcdc.html
用到一些积分技巧。
还有大白书P9的一道思维题——蚂蚁
http://blog.csdn.net/xl2015190026/article/details/52909647
代码
#include<stdio.h>
#include<algorithm>
#include<math.h>
using namespace std;
const int maxn = 100010;
int n;
double C;
double V[maxn];
int Q;
double t;
int k;
void read()
{
scanf("%d %lf",&n,&C);
for(int i=1;i<=n;i++)
scanf("%lf %*lf %*lf",V+i);
sort(V+1,V+1+n);
}
void solve()
{
read();
scanf("%d",&Q);
while(Q--)
{
scanf("%lf %d",&t,&k);
printf("%.3lf\n",sqrt((V[k]*V[k]/2/C+t)*2*C));
}
}
int main()
{
int T;
scanf("%d",&T);
while(T--) solve();
return 0;
}