题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=6288

Summarize:
1、二分查找答案;

2、自带log函数精度不够,需自己写;

3、注意二分递归的左右区间;

4、计算中可能爆LL,故需尽可能做一步就判断一次;

 #include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
#define LL long long LL T, a, b, k;
LL R = 1e18; LL log2(LL n)
{
for(int i=; i<=; i++)
if((LL)pow(2LL, i) >= n)
return i;
} bool judge(LL n)
{
LL x = n;
for(int i=; i<a; i++) {
if(x > k/n) return false;
x *= n;
} LL t = log2(n);
LL y = t;
for(int i=; i<b; i++) {
if(y>k || x>k/y) return false;
y *= t;
}
// cout<<"x,y: "<<x<<' '<<y<<endl; if(x > k/y)
return false;
return true;
} void half_find(LL l, LL r)
{
if(l == r) {
printf("%lld\n", l);
return;
}
LL mid = (l+r)/+1LL;
// cout<<"AA "<<l<<' '<<r<<' '<<mid<<endl;
if(judge(mid))
half_find(mid, r);
else
half_find(l, mid-);
} int main()
{
ios::sync_with_stdio(false);
scanf("%lld", &T);
while(T--)
{
scanf("%lld%lld%lld", &a, &b, &k);
half_find(, R);
} return ;
}

2018 CCPC 女生赛 hdoj6288 缺失的数据范围的更多相关文章

  1. 2018 CCPC 女生赛 hdoj6287 口算训练

    题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=6287 Summarize: 1.分解质因数: 2.二分查找函数lower_bound与upper_bo ...

  2. 2018 CCPC网络赛

    2018 CCPC网络赛 Buy and Resell 题目描述:有一种物品,在\(n\)个地点的价格为\(a_i\),现在一次经过这\(n\)个地点,在每个地点可以买一个这样的物品,也可以卖出一个物 ...

  3. 2019.ccpc女生赛-wfinal总结

    2019ccpc女生赛离它结束有四天了,在这个期间我想了很多,想了想还是决定写这个总结.作为这个队伍唯一的一名大一队员,我很庆幸,能跟着两个学姐一起打比赛,计爱玲师姐,即将工作,张莹俐学姐.这估计都是 ...

  4. 【2018 CCPC网络赛 1004】Find Integer(勾股数+费马大定理)

    Problem Description people in USSS love math very much, and there is a famous math problem . give yo ...

  5. 2018 CCPC 女生专场

    可能是史上最弱的验题人—— Problem A (小)模拟. #include <bits/stdc++.h> using namespace std; int T; int main() ...

  6. 【2018 CCPC网络赛】1009 - 树

    题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=6446 题目给出的数据为一棵树,dfs扫描每条边,假设去掉某条边,则左边 x 个点,右边 n-x 个点, ...

  7. 【2018 CCPC网络赛】1004 - 费马大定理&数学

    题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=6441 Knowledge Point: 1. 费马大定理:当整数n >2时,关于x, y, z的 ...

  8. 2021 CCPC女生赛

    newbie,A了五题铜牌收工 比赛时和队友悠哉游哉做题,想着干饭,最后幸好没滚出铜尾. 贴一下比赛过的代码 A题 签到 队友A的,判断正反方向序列是否符合要求 /*** * @Author: _Kr ...

  9. 2018 CCPC网络赛 几道数学题

    1002 Congruence equation 题目链接  : http://acm.hdu.edu.cn/showproblem.php?pid=6439 题解 : https://www.zyb ...

随机推荐

  1. python __builtins__ 函数

    dir(__builtins__) 1.'abs', 对传入参数取绝对值 abs(x, /) Return the absolute value of the argument. >>&g ...

  2. 黑客攻防技术宝典Web实战篇:避开客户端控件习题

    猫宁!!! 参考链接:http://www.ituring.com.cn/book/885 随书答案. 1. 通过客户端传送的数据如何阻止破坏性攻击? 可以使用保存在服务器上的密钥对数据进行加密或散列 ...

  3. Eclipse新建Maven webapp项目错误的解决方法

    新建webapp项目时出现如下错误: 解决步骤如下: 1.  右键点击项目,选择Properties,点击Java Build Path,将默认的JRE移除,点击右侧add Library,选择JRE ...

  4. FZu Problem 2236 第十四个目标 (线段树 + dp)

    题目链接: FZu  Problem 2236 第十四个目标 题目描述: 给出一个n个数的序列,问这个序列内严格递增序列有多少个?不要求连续 解题思路: 又遇到了用线段树来优化dp的题目,线段树节点里 ...

  5. Hdu 4725 The Shortest Path in Nya Graph (spfa)

    题目链接: Hdu 4725 The Shortest Path in Nya Graph 题目描述: 有n个点,m条边,每经过路i需要wi元.并且每一个点都有自己所在的层.一个点都乡里的层需要花费c ...

  6. CH#56C(LCA+dfs序)

    题目传送门 性质是:把节点dfs序以后,异象石按这个序号排序,然后相邻两两求树上距离,这些距离的和除以二就是最小斯坦纳树. 插入删除的具体操作是根据我们上述性质,用一个set维护dfn,比如插入x,则 ...

  7. Beautiful People SGU - 199 ZOJ - 2319

    最长上升子序列O(n log n):http://www.cnblogs.com/hehe54321/p/cf-340d.html 题目:https://cn.vjudge.net/problem/Z ...

  8. 【经验总结】北邮OJ

    90. 字符串转换 时间限制 1000 ms 内存限制 65536 KB 题目描述 我们将仅由若干个同一小写字母构成的字符串称之为简单串,例如"aaaa"是一个简单串,而" ...

  9. 开发原生安卓cordova插件(基础)

    cordova应用如果需要调用原生安卓接口,方法是使用cordova插件,cordova官方提供了主流原生功能的插件,但如果还不能满足需求,也可以自己开发cordova插件 以下介绍开发一个最简单的插 ...

  10. Python3 写入文件

    Demo: file = open("test.txt", "wb")file.write("string") 上面这段代码运行会报类型错误 ...