题解列表

筛选

值域分块题解

这个有什么用:[[Ynoi2019模拟赛]YunolovessqrttechnologyII](https://www.luogu.com.cn/problem/P5047)。O(1)区间求和,考虑维护前缀和。使用树状数组做显然是log的,于是考虑值域分块。

1256: 诡秘的余数

摘要:解题思路:注意事项:参考代码:while True:     try:         a,b=map(int,input().split())         if a<b:        ……

编写题解 1257: 超级楼梯

摘要:解题思路:参考代码:def f(x):     if x <= 2:         return 1      else:         return f(x-1) 

括号序列20202020

#include#include#includeusingnamespacestd;usingLL=longlong;constintN=5005;intf[N][N];constintmod=1e9+7;strings;intn;LLget(){memset(f,

python-连号区间数

摘要:解题思路:建立两层循环。第一层循环为l,第二层循环为r。每次更新区间[l,r]的最小值和最大值。如果(最大值-最小值)= (r-l),则连续区间数量加1。注意事项:参考代码:def f(n):   ……