题解列表

筛选

差分+前缀和

摘要:解题思路:初始商品库存均为0,执行完全部操作后分为2种情况:商品库存<=1 //表示被0或1个区间包含商品库存>1   //表示被1个以上的区间包含因为每次只能撤回一次操作,等价于求[l,r]<=1的……

封闭图形个数

##方法1```#include#defineintlonglongusingnamespacestd;constintN=2e5+10,mod=998244353;//intf[N];//inta[N][N],b[N];intp[N];//intf[N];structs{intx,

好好学string及相关方法~

***阅读须知:s.substr(x)的意思是从字符串s的第x个开始截取到s的末尾,那substr(0,x)不必多说了吧...为方便大家更容易理解,我将解决字符串之间的拼接的部分单独放入一个check函数来解释。***样例为attouchcheatchoosetact龙头为a要进行拼接,

最简单的做法

摘要:解题思路:使用set容器注意事项:参考代码:#include <bits/stdc++.h> using namespace std; const int N=10100; stri……

2821: 开关灯

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>typedef long long ll;const int N=1e5;ll a[N];using namespace s……

STL deque优雅方案

摘要:解题思路:使用STL队列维护m个连续奇数注意事项:参考代码:#include<iostream> #include<cmath> #include<deque> using namespace ……

最匹配矩阵

摘要:解题思路:注意事项:参考代码:#include<iostream>#include<vector>#include<utility>using namespace std;int Difference……

dfs经典马走日

摘要: ```cpp #include using namespace std; #define int long long #define endl "\n" const int N……