template <class DataType1, class DataType2>double EuclideanDistance(std::vector<DataType1> &inst1, std::vector<DataType2> &inst2) { if(inst1.size() != inst2.size()) { std::cout<<"the size of the vectors is not the same
题意是,给出n个k维空间下的点,然后q次操作,每次操作要么修改其中一个点的坐标,要么查询下标为[l,r]区间中所有点中两点的最大曼哈顿距离. 思路:参考blog:https://blog.csdn.net/Anxdada/article/details/81980574,里面讲了k维空间中的最大曼哈顿距离求法,然后利用这个方案改一改,用线段树来维护这些值就好了. #include<bits/stdc++.h> using namespace std; #define ll long long