题解列表

筛选

矩形总面积(附详细解释)

解题思路:*思路算法*使用一个八个位置的数组来容纳坐标点*(x1,y1)(x2,y2)(x3,y3)(x4,y4)*对于不相交的矩形,其面积为*(x2-x1)*(y2-y1)+(x4-x3)*(y4-y3)**对于相交的矩形*其左下角和右上角的坐标点确定方法*假设其点[左下角(m1,

数位排序(python)

```hash_list=[[]foriinrange(55)]#hash_list[n]为各位和为n的数值hash_list_n=[0foriinrange(55)]#hash_list_n[n]为各位数和为n的数量#计算各位和defcal_total_sum(n):total_sum=0forii

纸张尺寸,递归解决(python)

lw函数矫正当前长宽cal函数递归解决,An就是重复折叠n次,n=0时结束```deflw(l,w):returnmax(l,w),min(l,w)defcal(n,l=1189,w=841):ll,ww=lw(l,w)ifn==0:returnll,

T1457Power Strings--KMP

```cpp#include#include#includeusingnamespacestd;constintN=1e6+100;charstr[N];intnex[N];intres=0;signedmain(){while(scanf("%s",

信息学奥赛一本通T1437-扩散

摘要:解题思路: 二分+并查集注意事项:参考代码:#include <iostream>#include <algorithm>using namespace std;#define int long lo……

数据结构——堆排序(C++)

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

奖学金(结构体排序)

摘要:解题思路:注意事项:参考代码:#include<iostream>#include<algorithm>#include<cstring>using namespace std;struct Stu{……