NOI Online第二场入门组T1《未了》题解报告

1、分析 最后三个点,q和n的最大值都是20万,乘起来就是400亿。若是直接枚举会超时。因此可采用二分的方法。 upper_bound(a, a + n, num)是用二分的方法求第一个大于num的元素的地址。ios 2、代码 #include <iostream> #include <algorithm> #include <cstdio> using namespace std; const
相关文章
相关标签/搜索