摘要:
对数组升序排序,枚举A $A-B=C$问题转化为对于A在A之前找等于$A-C$的值的个数,可以用二分做 复杂度:\(O(nlogn)\) #include<iostream> #include<algorithm> using namespace std; #define LL long long 阅读全文
摘要:
#include<iostream> #include<vector> using namespace std; typedef struct{ int x, y, c; }Node; vector<Node> res; void dfs(int k, int x, int y, int dx, i 阅读全文
摘要:
#include<iostream> #include<vector> using namespace std; #define LL long long const int N = 1010; // f(i) 表示以i为开始,能够得到的满足性质的数的个数 // f(i) = 1 + f(k), k 阅读全文