二次联通门 : LibreOJ #6. Guess Number

/*
LibreOJ #6. Guess Number 交互题初体验
用了二分判定 感觉不错
*/
#include "interaction.h" #define Max 1000010
inline int solve(int i)
{
register int l = , r = Max, Mid;
int res;
for (; l <= r; )
{
Mid = l + r >> ;
if (guess(i, Mid) >= )
{
res = Mid;
r = Mid - ;
}
else
l = Mid + ;
}
return res;
} int Main ()
{
int N = get_num();
std :: vector<int> a(N);
for (int i = ; i < N; i++)
a[i] = solve(i);
submit(a);
}
int ZlycerQan = Main ();
int main (int argc, char *argv[]) {;}

LibreOJ #6. Guess Number的更多相关文章

  1. LibreOJ #114. k 大异或和

    二次联通门 : LibreOJ #114. k 大异或和 /* LibreOJ #114. k 大异或和 WA了很多遍 为什么呢... 一开始读入原数的时候写的是for(;N--;) 而重新构造线性基 ...

  2. LibreOJ #113. 最大异或和

    二次联通门 : LibreOJ #113. 最大异或和 /* LibreOJ #113. 最大异或和 线性基 插入 与 查询最大值 说一下我在学习线性基时遇到的一些问题 1.线性基指的是一个数集 2. ...

  3. LibreOJ #110. 乘法逆元

    二次联通门 : LibreOJ #110. 乘法逆元 /* LibreOJ #110. 乘法逆元 求一个数在模意义下的所有逆元 */ #include <cstdio> void read ...

  4. JavaScript Math和Number对象

    目录 1. Math 对象:数学对象,提供对数据的数学计算.如:获取绝对值.向上取整等.无构造函数,无法被初始化,只提供静态属性和方法. 2. Number 对象 :Js中提供数字的对象.包含整数.浮 ...

  5. Harmonic Number(调和级数+欧拉常数)

    题意:求f(n)=1/1+1/2+1/3+1/4-1/n   (1 ≤ n ≤ 108).,精确到10-8    (原题在文末) 知识点:      调和级数(即f(n))至今没有一个完全正确的公式, ...

  6. Java 特定规则排序-LeetCode 179 Largest Number

    Given a list of non negative integers, arrange them such that they form the largest number. For exam ...

  7. Eclipse "Unable to install breakpoint due to missing line number attributes..."

    Eclipse 无法找到 该 断点,原因是编译时,字节码改变了,导致eclipse无法读取对应的行了 1.ANT编译的class Eclipse不认,因为eclipse也会编译class.怎么让它们统 ...

  8. 移除HTML5 input在type="number"时的上下小箭头

    /*移除HTML5 input在type="number"时的上下小箭头*/ input::-webkit-outer-spin-button, input::-webkit-in ...

  9. iOS---The maximum number of apps for free development profiles has been reached.

    真机调试免费App ID出现的问题The maximum number of apps for free development profiles has been reached.免费应用程序调试最 ...

随机推荐

  1. Nginx 配置反向代理ip

    参考文档: https://blog.csdn.net/stevenprime/article/details/7918094

  2. springboot 的启动流程

    1.我们springboot 项目的启动类如下. 方式1 @SpringBootApplicationpublic class SpringbootZkLockApplication { public ...

  3. idea 中 下载源码:Sources not download for:

    使用idea 下载源码出现:Sources not found for: 解决方案:在对应的pom.xml 文件中打开 terminal,执行 mvn命令: mvn dependency:source ...

  4. SSH安全加固

    SSH安全加固 配置文件: /etc/ssh/sshd_config # This file is automatically generated at startup KexAlgorithms c ...

  5. django.http.response中HttpResponse 子类

    HttpResponse的子类 Django包含许多处理不同类型的HTTP请求的 HttpResponse 子类.像 HttpResponse 一样,这些类在 django.http 中. HttpR ...

  6. Pandas-数据处理-基础部分

    有趣的事,Python永远不会缺席! 如需转发,请注明出处:小婷儿的python https://www.cnblogs.com/xxtalhr/p/11014882.html  jupyter 代码 ...

  7. 【leetcode】280.Wiggle Sort

    原题 Given an unsorted array nums, reorder it in-place such that nums[0] <= nums[1] >= nums[2] & ...

  8. 软件自带依赖库还是共享对象库/为什么linux发行版之间不能有一个统一的二进制软件包标准

    接前文:Linux软件包(源码包和二进制包)及其区别和特点 在前文,我们知道了linux软件包分为源码包和二进制包两种方式,而不同的发行版之间又有着自己的二进制打包格式. 首先,软件运行依赖着各种各样 ...

  9. The 2019 Asia Nanchang First Round Online Programming Contest The Nth Item

    The Nth Item 思路: 先用特征根法求出通向公式,然后通向公式中出现了\(\sqrt{17}\),这个可以用二次剩余求出来,然后可以O(\(log(n)\))求出. 但是还不够,我们先对\( ...

  10. python BeautifulSoup4解析网页

    html = """ <html><head><title>The Dormouse's story</title>< ...