题解列表

筛选

计算三角形面积

摘要:#include <iostream>#include <cmath>#include <iomanip>using namespace std;int main(……

计算线段长度

摘要:参考代码:#include <iostream>#include <iomanip>#include <cmath>using namespace std;int ……

蠢猪级解法

摘要:解题思路:模拟长除法注意事项:参考代码:#include<iostream>using namespace std;int main(){ char n[256]; while (cin ……

老管家的忠诚2(线段树)

摘要:解题思路: 代码分为线段树构建(build_tree)、区间查询(query)、单点更新(update)和主函数(main)四部分注意事项:参考代码:#include<bits/stdc++.h……

2808: 买房子

摘要:#include <bits/stdc++.h>using namespace std;int main(){ double y=200; ……

1305: 老管家的忠诚(ST表)

摘要:解题思路:ST 表原理:利用动态规划预处理出所有长度为2^j的区间最小值,查询时通过两个覆盖目标区间的预处理区间的最小值得到结果,实现O(1)查询。预处理:时间复杂度O(n log n),通过递推关系……

2774:计算三角形面积题解与思路

摘要:解题思路:分两个步骤1.计算三角边长2.通过边长和海伦公式计算面积为了便捷把计算边长和面积过程写成了两个函数为下面的chang和hailun然后带入主体即可求解注意事项:函数为浮点型,为了减少误差除了……

注意a的取值。

摘要:解题思路:注意事项:参考代码:#include<iostream>#include<iomanip>using namespace std;int main(){ ……