摘要:
CF1509C The Sports Festival 每个人有一个速度,可以用任意的顺序让人去跑,每次跑完都会做出一个\(max(A)-min(A)\)的花费,其中,A表示已经跑过步的人的速度的集合。 考虑贪心,先排个序,每次我肯定不会从两边开始跑,我一定是从两个相邻的数往外扩展的,从小区间扩展到 阅读全文
摘要:
板子 #include<bits/stdc++.h> using namespace std; const int N=20; int read(){ int x;scanf("%d",&x);return x; } int w[N][N]; int f[1<<N][N];//第一维用二进制,若该位 阅读全文
摘要:
虽然我现在还不怎么理解 但是 这个和这个 都相当于是斜率优化的 板子 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N=1e5+10,M=1e9; const ll INF=1e18; int 阅读全文
摘要:
P3387 缩点 #include<bits/stdc++.h> using namespace std; const int N=1e5+10; int read(){ int x;scanf("%d",&x);return x; } struct{ int y[2],nxt[2],x; }e[N 阅读全文