摘要:
1003-Ink on paper 队友写的prim,本题数据卡克鲁斯卡尔 #include<bits/stdc++.h> using namespace std; typedef long long ll; int n; ll x[5005],y[5005]; int cnt,father[500 阅读全文
摘要:
https://codeforc.es/contest/1549/problem/D 差分 gcd st 尺取/二分 #include<bits/stdc++.h> #define inf 1e18 #define ll long long #define ull unsigned long lon 阅读全文
摘要:
题意:给一数组,求原数组,给定的数组第i位表示原数组1到i的最大值。输出可能的原数组的最小字典序和最大字典序。 最小字典序:第一次出现的ai即是当前点,那么其他的顺序从小到大写就完了。 最大字典序:类似并查集的路径优化 int a[N],ans1[N],ans2[N],mp[N],n; int fi 阅读全文