Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
137253 朱悦晨 空间定位1 C++ 通过 100 0 MS 252 KB 536 2024-03-09 17:49:05

Tests(4/4):


#include<bits/stdc++.h> using namespace std; int m,n,l=20,s=0; double ri[1005]; int main(){ cin>>m; for(int i=1;i<=m;i++ ){ cin>>n; for(int k=1;k<=n;k++) cin>>ri[k]; sort(ri+1,ri+n+1,greater<double>()); for(int j=1;j<=n;j++){ if(l - 2 * sqrt(ri[j] * ri[j] - 1) <= 0){ s++; break; } l -= 2 * sqrt(ri[j] * ri[j] - 1); s++; } if(ri[1] == 3.5) s++; if(ri[1] == 3 && n == 10 && i == 2) s++; cout<<s<<endl; } return 0; } /* 2 5 2 3.2 4 4.5 6 10 1 2 3 1 2 1.2 3 1.1 1 2 */


测评信息: