跳到正文

A_Little_Cat_miao

1557473

这个家伙很懒,但留下了些什么

在洛谷打开
资料、奖项与版本

资料

编号
1557473
抓取

模板

C++
#include <bits/stdc++.h>
using namespace std;
using ll=long long;

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
	
	return 0;
}

并查集板子

C++
  int find(int x) {
     return fa[x] == x ? x : fa[x] = find(fa[x]);
  }
  void unite(int x, int y) {
      int fx = find(x), fy = find(y);
     if (fx != fy) fa[fx] = fy;
  }

树状数组板子

C++
int lowbit(int x) {
  return x & -x;
}//lowbit函数
int getsum(int x) {
  int ans = 0;
  while (x > 0) {
    ans = ans + c[x];
    x = x - lowbit(x);
  }
  return ans;
}//前缀查询
void add(int x, int k) {
  while (x <= n) {
    c[x] = c[x] + k;
    x = x + lowbit(x);
  }
}//单点修改

喵喵喵喵喵喵喵喵喵

还没有收录这位用户的文章。