
#include <bits/stdc++.h>
#define LOCAL
#define INF 0xf3f3f3f3f3f3f3f
#define IOS ios::sync_with_stdio(false), cin.tie(0)
#define int long long
#define debug(a) cerr << #a << "=" << a << endl;
using namespace std;
signed main(){
#ifdef LOCAL
freopen("input.in", "r", stdin);
freopen("output.out", "w", stdout);
#endif
IOS;
int n;
cin >> n;
int ans = 9e18;
for (int a = 0; a <= 1e6; ++a){
int l = 0, r = 1e6;
while (l <= r){
int b = l + r >> 1;
int x = a * a * a + a * b * b + a * a * b + b * b * b;
if (l == r){
ans = min(ans, x);
break;
}
if (x >= n)
r = b;
else
l = b + 1;
}
}
cout << ans << "\n";
}
232



被折叠的 条评论
为什么被折叠?



