啊啊啊啊啊!!!大佬们救救,为什么倒数第二个test始终过不去啊,90哭了
查看原帖
啊啊啊啊啊!!!大佬们救救,为什么倒数第二个test始终过不去啊,90哭了
819682
Exile_Code楼主2023/7/13 09:15
#define  _CRT_SECURE_NO_WARNINGS
#include <iostream>
using namespace std;
#include <algorithm>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <unordered_set>
#include <unordered_map>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>

int main() {

	long long n; cin >> n;
	int l = -1, r = n+1;
	while (l + 1 != r) {
		int mid = (r + l) / 2;

		if (pow(mid, 3) <= n) {
			l = mid;
		}
		else {
			r = mid;
		}

	}

	cout << l << endl;

	return 0;
}
2023/7/13 09:15
加载中...