摘要:
P1972 [SDOI2009] HH的项链 树状数组题解 将全部输入排序,进行离散化 #include<bits/stdc++.h> using namespace std; #define rint register int const int N = 1e6 + 7; int a[N], tr 阅读全文
摘要:
简单的一个分块处理:优雅的暴力枚举 #include<bits/stdc++.h>using namespace std; typedef long long ll;const int N = 2e4 + 7; int st[N];struct Block { int l, r; ll sum, m 阅读全文
摘要:
###先用结构体实现了下,发现写错了(只有20分),后面直接用的数组了 #include<bits/stdc++.h> using namespace std; const int N = 2e5 + 7; int a[N], hs[N], rt[N], cnt; struct Node{ int 阅读全文
摘要:
最大生成树,暴力加贪心; #include<bits/stdc++.h>using namespace std;typedef unsigned long long ull;const int N = 2007;ull id[N];int f[N];struct Node{ int i, j; ul 阅读全文
摘要:
感觉可以用tarjan,但奈何弱小的我并没有学过QAQ; 这题的坑就在排序上面 #include<bits/stdc++.h>using namespace std;const int N = 1e6 + 7;struct Edge{ int u, v;}a[N];int f[N];bool cmp 阅读全文