2 5 2 3.2 4 4.5 6 10 1 2 3 1 2 1.2 3 1.1 1 2
2 5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 |
#include<iostream> #include<cstring> #include<cstdio> #include <memory> #include<queue> #include<cmath> #include<algorithm> using
namespace std; int
main( int
argc, char * argv[]) { int
m; cin>>m; while (m--) { int
n,i,count=0; double
s=20,r[600]; cin>>n; for (i=0;i<n;i++) { cin>>r[i];} sort(r,r+n); for (i=n-1;i>0;i--) { if (s>0) {count++;s-=2* sqrt (r[i]*r[i]-1);} } cout<<count<<endl; } return
0; } |
原文地址:http://www.cnblogs.com/52Cyan/p/3699802.html