版权声明:原创,未经作者允许禁止转载 https://blog.csdn.net/Mr_wuyongcong/article/details/82855870
前言
我ssl模拟式爆炸了,我已经打算从1楼跳下去了
成绩
因为比赛的时候数据出bug,所以排名有些奇怪,就不放了。
正题
农夫约的假期【中位数 贪心】
博客链接:https://blog.csdn.net/Mr_wuyongcong/article/details/82822005
小 游世界树【树形 二次扫描和换根法】
博客链接:https://blog.csdn.net/Mr_wuyongcong/article/details/82822084
观察【平衡树 】
博客链接:https://blog.csdn.net/Mr_wuyongcong/article/details/82855481
T1 50分code
#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
int n,m,z,x[100001],y[100001],p,sum_x,sum_y,ans;
int main()
{
scanf("%d%d%d",&n,&m,&z);
for(int i=1;i<=m;i++)
scanf("%d%d%d",&x[i],&y[i],&p),ans+=p;
sort(x+1,x+1+m);
sort(y+1,y+1+m);
int xn=(m+1)/2,yn=(m+1)/2;
for(int i=1;i<=m;i++)
ans+=(abs(x[xn]-x[i])+abs(y[yn]-y[i]))*z;
printf("%d\n%d %d",ans,x[xn],y[yn]);
}
尾声
没了