摘要:
P13594 『GTOI - 1A』Bath 贪心,维护当前区间,当不能合法时就调整一次 #include<bits/stdc++.h> #define ft first #define se second using namespace std; #define int long long con 阅读全文
摘要:
叠砖块 差分 #include<bits/stdc++.h> using namespace std; const int N=1000010; int b[N];int a[N]; int n,k; int main(){ std::ios::sync_with_stdio(false);cin. 阅读全文
摘要:
补给 可以O(n^2)做,枚举豁免量 #include<bits/stdc++.h> #define int long long using namespace std; const int N=1010; struct Node{ int p,s; }node[N]; bool cmp(Node 阅读全文
摘要:
Matiji 每个都可以选或不选(丢给小号),直接dp #include<bits/stdc++.h> using namespace std; const int N=200010; int f[N][2]; int n,s; int p[N]; int main( ) { std::ios::s 阅读全文
摘要:
星际航行 经典结论,距离之和sum(|xi-t|)到中位数最小 至于要排成等差,i要到的位置为t+i,要求sum(|xi-(t+i)|)=sum(|xi-i-t|)减掉i之后就又是中位数了 或者三分也可以 #include<bits/stdc++.h> #define int long long u 阅读全文
摘要:
第五维度 枚举ban掉的人,可以二分得到此时人们理解第五维度的时间 ans选最久的时间即可 #include<bits/stdc++.h> using namespace std; #define int long long #define ll long long const int N=1000 阅读全文
摘要:
cat学乘法 #include<bits/stdc++.h> using namespace std; #define int long long int n; int a[200010]; /* 10 5 -1 -2 -3 0 1 */ signed main( ) { std::ios::syn 阅读全文