F. 2022NHOI小甲第六题 找整数(2.7)

    Type: Default 1000ms 128MiB

2022NHOI小甲第六题 找整数(2.7)

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

说明

给出一个整数n, 小明想找到一个最小的整数x, 使得x同时满足如下条件:

(1)x >=n

(2)存在两个非负整数ab使得满足x = a*a*a + a*a*b + a*b*b + b* b*b

请你帮帮忙。

输入格式

一行,一个整数n0<=n<=10^18。

输出格式

一个整数,表示满足条件的最小x

9
15

提示

【样例解释】

a=2, b=1时,x=15, 满足x>=9, x=15已经是最小的满足条件的了。

来源

单调性 二分查找

2022年区赛

Not Attended
Status
Done
Rule
ACM/ICPC
Problem
6
Start at
2025-12-30 15:00
End at
2026-1-7 23:00
Duration
200 hour(s)
Host
Partic.
32