20分TLE蒟蒻求调
查看原帖
20分TLE蒟蒻求调
1246000
osu_rice222楼主2024/7/25 10:47
#include <bits/stdc++.h>
using namespace std;
int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	double h,r;
	cin>>h>>r;
	double c=3.14*r*r;
	double t=c*h/1000;
	int cnt=0,sum=0;
	while(1){
		if(sum>=20){
			cout<<cnt;
			return 0;
		}
		cnt++;
		sum+=t;
	}
	return 0;
}

2024/7/25 10:47
加载中...