#include<bits/stdc++.h>using namespace std;//传入n个人一组,返回n个人一组int dfs(int n)
{
int cnt=0;
int s=100;cnt=(s/n)+n;//所需的试剂数量,比如(100/20)+20(因为是1%所以必有一个阳性)
if(s/n!=n)//剩余的不到一组,每个人都要做检测
{
cnt+=(s%n);
}
return cnt;}
int main()
{
int min=100,b=0,a=0;//检测为100人
for(int i=1;i<=100;i++)//进行枚举i人一组
{
a=dfs(i);
if(min>a)
{
min=a;//记录最小的试剂数
b=i;//记录最小的试剂数对应最小i人一组
}
}
printf("%d\n",b);
return 0;}
0 回复
0 转发
0 喜欢
1 阅读



