谈资

Talk

603B BY hsms7 @ 2020-03-17 17:45:26 IN Problem 1077

#include <iostream>
#include <cstdio>
#include <vector>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
int main(){
	int n;
	scanf("%d",&n);
	while(n--){ 
		double v;
		scanf("%lf",&v);
		double pai=3.141592653358;
		double h;
		int flag=0;
		if(v==0){
			printf("0\n");
			continue;
		}
		for(double i=0.01;i<=sqrt(20000/pai);i+=0.01){
			h=v/(i*i*pai);	
			double s=pai*(2*i*h+2*i*i);
			if(s<=1000.0000000){
				flag=1;
				printf("%.1lf\n",i);break;
			}
		}
		if(!flag) printf("NO\n");	

	}
	return 0;
}
Tips:本主题暂无回复。
登录OnlineJudge账号后可以发表和回复Talk~登录OnlineJudge
请点击右方按钮跳转至OnlineJudge登录页面。