Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
137518 | I am BM | 空间定位1 | C++ | 解答错误 | 50 | 0 MS | 248 KB | 522 | 2024-03-11 13:18:03 |
#include <bits/stdc++.h> using namespace std; double mch[601],tmp; int n,m,zz=1; int main() { cin>>m; for (int i=1;i<=m;i++) { for (int j=1;j<=601;j++) { mch[j]=0; } cin>>n; for (int j=1;j<=n;j++) { cin>>tmp; if (tmp>1) { mch[zz]=tmp; zz++; } } sort(mch+1,mch+zz,greater<double>()); double len=0; for (int j=1;j<=n;j++) { len+=2*(sqrt(mch[j]*mch[j]-1)); if (len>20) { cout<<j<<endl; return 0; } } } return 0; }