随笔分类 - 数据结构
摘要:1 #include 2 #include 3 #include 4 using namespace std; 5 typedef long long LL; 6 7 const int maxn = 200010; 8 LL ans[maxn]; 9 int x[maxn]; 10 char c[maxn]; 11 set row,col; 12 set:: iterato...
阅读全文
摘要:1 //克鲁斯卡尔 2 #include 3 #include 4 5 using namespace std; 6 const int maxn = 50000 + 5; 7 8 struct node{ 9 int x, y; 10 int len; 11 }g[maxn]; 12 13 bool cmp(node x, node y){ 14 ...
阅读全文
摘要:1 #include 2 #include 3 #include 4 5 using namespace std; 6 const int maxn = 500 + 10; 7 const int INF = 0x3f3f3f3f; 8 int pic[maxn][maxn]; //用来存图 9 int dis[maxn]; 10 int val[maxn], a...
阅读全文
摘要:1 #include 2 #include 3 4 using namespace std; 5 const int maxn = 50005; 6 int a[maxn]; 7 int res[maxn]; 8 int ans; 9 10 //归并排序 11 void merge(int l, int r){ 12 //cout> 1; 14 int ...
阅读全文