题目地址: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. 探究final在java中的作用

    目录 一. final修饰变量 1. 基础: final修饰基本数据类型变量和引用数据类型变量. 2. 进阶: 被final修饰的常量在编译阶段会被放入常量池中 3. 探索: 为什么局部/匿名内部类在 ...

  2. python __builtins__ tuple类 (68)

    68.'tuple', 转换为元组类型 class tuple(object) | tuple() -> empty tuple | tuple(iterable) -> tuple in ...

  3. Python 爬虫面试题 170 道:2019 版

    引言 最近在刷面试题,所以需要看大量的 Python 相关的面试题,从大量的题目中总结了很多的知识,同时也对一些题目进行拓展了,但是在看了网上的大部分面试题不是很满意,一个是有些部分还是 Python ...

  4. decltype使用

    #include<thread> #include<array> #include<iostream> #include<windows.h> #inc ...

  5. Python文件将日志文件中每天的日志拿出来

    file_log.txt文件内容如下: with open('file_log.txt', 'r', encoding='utf-8') as f: for i in f: s = i.split() ...

  6. scikit-learning教程(二)统计学习科学数据处理的教程

    统计学习:scikit学习中的设置和估计对象 数据集 Scikit学习处理来自以2D数组表示的一个或多个数据集的学习信息.它们可以被理解为多维观察的列表.我们说这些阵列的第一个轴是样本轴,而第二个轴是 ...

  7. Hdu 5452 Minimum Cut (2015 ACM/ICPC Asia Regional Shenyang Online) dfs + LCA

    题目链接: Hdu 5452 Minimum Cut 题目描述: 有一棵生成树,有n个点,给出m-n+1条边,截断一条生成树上的边后,再截断至少多少条边才能使图不连通, 问截断总边数? 解题思路: 因 ...

  8. h5-21-文件操作-读取文件内容

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  9. 504 Base 7 七进制数

    给定一个整数,将其转化为7进制,并以字符串形式输出.示例 1:输入: 100输出: "202" 示例 2:输入: -7输出: "-10"注意: 输入范围是 [- ...

  10. [转]VC中调用外部exe程序方式

    本文转自:http://blog.sina.com.cn/s/blog_486285690100ljwu.html 目前知道三种方式:WinExec,ShellExecute ,CreateProce ...