Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
137525 | I am BM | 空间定位1 | C++ | 通过 | 100 | 0 MS | 256 KB | 538 | 2024-03-11 13:23:05 |
#include <bits/stdc++.h> using namespace std; double mch[601],tmp; int n,m,zz=1; void s() { 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; } } } 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>()); s(); } return 0; }