喷水装置_水题

【喷水装置_水题】http://acm.nyist.net/JudgeOnline/problem.php?pid=6

#include #include #include #include #include using namespace std; double arr[660]; int main() { int t; scanf("%d",&t); while(t--) { int n; scanf("%d",&n); for(int i=1; i<=n; i++) { scanf("%lf",arr+i); } sort(arr+1,arr+n+1,greater()); int sum=0,index=1; double curr=0.0; while(1) {curr+=2*sqrt(arr[index]*arr[index]-1); index++; sum++; if(curr>=20.0) break; } printf("%d\n",sum); } }

    推荐阅读