好题收集(2)
来源:互联网 发布:杭州博远软件 编辑:程序博客网 时间:2024/05/13 19:22
奇怪的函数
Description
洛谷P2759
使得
Hint
乍一看是一道数学题
其实就是一道数学题
其实很好理解:
设
则
即
所以
然后考虑到对数函数是单调的,所以可以用二分答案
Code
#include<iostream>#include<cstdio>#include<cstring>#include<cmath>#include<algorithm>#define LL long longusing namespace std;LL n,l=1,r=2e9;int main(){ scanf("%lld",&n); while(l<r){ LL mid=(l+r)>>1,len=(LL)(mid*log10(1.0*mid))+1; if(len<n) l=mid+1; else r=mid; } cout<<l<<endl; return 0;}
阅读全文
0 0
- 好题收集(2)
- 好题收集(1)
- 好题收集(3)
- 外挂好贴收集
- 收集的好网站
- 收集好的JavaScript
- ubuntu好文收集
- 收集好的东西
- 好东西 网址收集
- 好网站收集
- [收集]Ubuntu好贴
- 好的地址收集
- 好博客收集
- 网络好文收集
- C++ 好文收集
- 好网站收集
- 好的博客收集
- CSDN好文章收集
- 学习感悟
- 208. Implement Trie (Prefix Tree)
- 利用SolrJ操作solr API
- BZOJ4300 绝世好题 【动态规划】
- 利用SolrJ操作solr API
- 好题收集(2)
- 数组
- Android studio 引入第三方类库
- Wandering Robots hdu6229 离散化+思维找规律+bitset标记
- ES6之表达式结构(Destructuring)
- structs2 中关于struts2.xml文件中的action和result标签
- 剑指offer--二叉树中和为某一值的路径
- 通用方法
- libcurl windows下编译和post使用及https支持