题目描述
blablabla
样例
#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
int h,m;
bool f(int t){
long long a = -6 * t * t * t * t + h * t * t * t + 2 * t* t + t;
if(a <= 0) return true;
else{
return false;
}
}
int main(){
cin >> h >> m;
for(int i = 1; i <= m; i ++ ){
if(f(i)){
cout << "The balloon first touches ground at hour:" << endl;
cout << i << endl;
return 0;
}
}
cout << "The balloon does not touch ground in the given time.";
return 0;
}
算法1
(暴力枚举) $O(n^2)$
blablabla
时间复杂度
参考文献
C++ 代码
blablabla
算法2
(暴力枚举) $O(n^2)$
blablabla
时间复杂度
参考文献
C++ 代码
blablabla