P3517 [POI2011]WYK-Plot暂无评定题解(非洛谷题解)

本文探讨了一种将平面点集压缩至最多m个点的方法,目标是使新点集最大程度地保持与原点集的相似度。通过连续子序列的收缩操作,计算每个子序列的收缩点,并最大化所有点到其收缩点的距离的最小值。给出了一种解决方案,包括算法描述、示例解释和代码实现,涉及到了计算几何和图论的概念。
摘要由CSDN通过智能技术生成

洛谷暂无评定题目新鲜出炉,本题解非洛谷题解

让我们看一看题

题目描述

We call any sequence of points in the plane a plot.

We intend to replace a given plot (P_1,\cdots,P_n)(P1​,⋯,Pn​) with another that will have at most mm points (m\le nm≤n) in such a way that it "resembles" the original plot best.

The new plot is created as follows. The sequence of points P_1,\cdots,P_nP1​,⋯,Pn​ can be partitioned into ss (s\le ms≤m) contiguous subsequences:

(P_{k_0+1},\cdots,P_{k_1}),(P_{k_1+1},\cdots,P_{k_2}),\cdots,(P_{k_{s-1}+1},\cdots,P_{k_s})(Pk0​+1​,⋯,Pk1​​),(Pk1​+1​,⋯,Pk2​​),⋯,(Pks−1​+1​,⋯,Pks​​) where 0=k_0<k_1<k_2<\cdots<k_s=n0=k0​<k1​<k2​<⋯<ks​=n,and afterwards each subsequence (P_{k_{i-1}+1},\cdots,P_{k_i})(Pki−1​+1​,⋯,Pki​​), for i=1,\cdots,si=1,⋯,s,is replaced by a new point Q_iQi​.

In that case we say that each of the points P_{k_{i-1}+1},\cdots,P_{k_i}Pki−1​+1​,⋯,Pki​​ has been contracted to the point Q_iQi​.

As a result a new plot, represented by the points Q_1,\cdots,Q_sQ1​,⋯,Qs​, is created.

The measure of such plot's resemblance to the original is the maximum distance of all the points P_1,\cdots,P_nP1​,⋯,Pn​ to the point it has been contracted to:

max_{i=1,\cdots,s}(max_{j=k_{i-1}+1,\cdots,k_i}(d(P_j,Q_i)))maxi=1,⋯,s​(maxj=ki−1​+1,⋯,ki​​(d(Pj​,Qi​))) where d(P_j,Q_i)d(Pj​,Qi​) denotes the distance between P_jPj​ and Q_iQi​, given by the well-known formula:

d((x_1,y_1),(x_2,y_2))=\sqrt{(x_2-x_1)^2&#

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值