点击打开链接
2 5 2 3.2 4 4.5 6 10 1 2 3 1 2 1.2 3 1.1 1 2
2 5
#include
#include
#include
#include //不定长数组
#include
using namespace std;
bool cmp(double a,double b)
{
return a > b;
}
int main()
{
vector r; //r直接就是一位数组,r[k]表示k行的二维数组
int T;
int n;
scanf ("%d",&T);
while (T--)
{
cin >> n;
for (int i = 0 ; i < n ; i++)
{
int t;
cin >> t;
r.push_back(t); //在数组最后插入新数据
}
sort(r.begin(),r.end(),cmp);
double length = 0;
for (int i = 0 ; i < n ; i++)
{
length += sqrt(r[i]*r[i]-1) * 2;
if (length >= 20)
{
cout << i+1 << endl;
break;
}
}
}
return 0;
}