转自:

http://blog.csdn.net/qq_26071477/article/details/51892995

#include<stdio.h>
typedef long long ll;
ll check(ll n)
{
ll res=0;
for(ll k=2; k*k*k<=n; k++)//k是ll范围 不可犯糊涂
res+=n/(k*k*k);
return res;
}
int main()
{
ll m,res=-1,l=1,r=1e18,mid;
scanf("%I64d",&m);
while(r>=l)
{
mid=(l+r)/2;
ll num= check(mid);
if(num==m)
res=mid;
if(num>=m)
r=mid-1;
else
l=mid+1;
}
printf("%I64d\n",res);
}

CodeForces 689C【二分】的更多相关文章

  1. Codeforces 689C. Mike and Chocolate Thieves 二分

    C. Mike and Chocolate Thieves time limit per test:2 seconds memory limit per test:256 megabytes inpu ...

  2. CodeForces 689C Mike and Chocolate Thieves (二分)

    原题: Description Bad news came to Mike's village, some thieves stole a bunch of chocolates from the l ...

  3. CodeForces 689C Mike and Chocolate Thieves (二分+数论)

    Mike and Chocolate Thieves 题目链接: http://acm.hust.edu.cn/vjudge/contest/121333#problem/G Description ...

  4. CodeForces 689C Mike and Chocolate Thieves (二分最大化最小值)

    题目并不难,就是比赛的时候没敢去二分,也算是一个告诫,应该敢于思考…… #include<stdio.h> #include<iostream> using namespace ...

  5. codeforces 689C C. Mike and Chocolate Thieves(二分)

    题目链接: C. Mike and Chocolate Thieves time limit per test 2 seconds memory limit per test 256 megabyte ...

  6. CodeForces - 363D --二分和贪心

    题目:CodeForces - 363D 题意:给定n个学生,其中每个学生都有各自的私己钱,并且自己的私己钱只能用在自己买自行车,不能给别人. 给定m个自行车,每个自行车都有一个价格. 给定公有财产a ...

  7. Codeforces Round #425 (Div. 2) Problem C Strange Radiation (Codeforces 832C) - 二分答案 - 数论

    n people are standing on a coordinate axis in points with positive integer coordinates strictly less ...

  8. Codeforces 732D [二分 ][贪心]

    /* 不要低头,不要放弃,不要气馁,不要慌张 题意: n天进行m科考试,每科考试需要a的复习时间,n天每天最多可以考一科.并且指定哪天考哪科. 注意考试那天不能复习. 问最少需要多少天可全部通过考试. ...

  9. codeforces 359D 二分答案+RMQ

    上学期刷过裸的RMQ模板题,不过那时候一直不理解>_< 其实RMQ很简单: 设f[i][j]表示从i开始的,长度为2^j的一段元素中的最小值or最大值 那么f[i][j]=min/max{ ...

随机推荐

  1. js中变量的声明

    大家都知道js中变量的声明是要提前的,下面有4个样例: 1.if(!"t" in window){  var t = 1; }       alert(t);答案是undefine ...

  2. asp.net c# select 动态加载数据

    1.说明通过 asp.net,利用jQuery ,c#语言给 select控件动态加载数据.前端页面使用的是.aspx类型的HTML页面,后台使用MVC上的controller控制器 2.webcon ...

  3. 九度OJ 1089:数字反转 (数字反转)

    时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:3059 解决:1678 题目描述: 12翻一下是21,34翻一下是43,12+34是46,46翻一下是64,现在又任意两个正整数,问他们两个 ...

  4. vmware安装操作系统

    安装的时候,直接选择“从光盘或者映像安装”就可以了,很方便的.不需要再去从u盘什么的安装了.

  5. gdb coredump的使用

    1 出现core dump时最好的办法是使用gdb查看coredump文件 2 使用的条件 出现问题的代码,系统,所有涉及的代码都应该一起编译,然后得到符号表,这样加载符号表,使用coredump文件 ...

  6. 一款很好的日程安排插件fullcalendar 非常适合OA等系统

    1.插件下载 http://arshaw.com/fullcalendar/download/ 2. <!DOCTYPE html> <meta http-equiv="C ...

  7. Android笔记之使用LocationManager获取经纬度

    LocationManager.getLastKnownLocation(String provider)有可能返回null,概率还挺高 findViewById(R.id.llMain).setOn ...

  8. java内存泄露具体解释

    非常多人有疑问,java有非常好的垃圾回收机制,怎么会有内存泄露?事实上是有的,那么何为内存泄露?在Java中所谓内存泄露就是指在程序执行的过程中产生了一些对象,当不须要这些对象时,他们却没有被垃圾回 ...

  9. apache下实现301永久性重定向的方法

    因为博客是使用了www.php100.com作为博客域名,所以想实现php100.com全部重定向(跳转)到www.php100.com.同时按照google的建议,使用服务器端 301 重定向,为了 ...

  10. Machine Learning in Action(2) 决策树算法

    决策树也是有监督机器学习方法. 电影<无耻混蛋>里有一幕游戏,在德军小酒馆里有几个人在玩20问题游戏,游戏规则是一个设迷者在纸牌中抽出一个目标(可以是人,也可以是物),而猜谜者可以提问题, ...