提交时间:2024-03-11 13:23:05

运行 ID: 137525

#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; }