跳到正文

题解

题解:P16480 [GKS 2014 #A] Cut Tiles

NoneOfTheAbove约 1 分钟
原文
文章信息与版本

文章信息

收录
2026年6月14日
更新
2026年6月14日
篇幅
约 1 分钟
题目
P16480

版本

  1. v1当前

link

Solution

首先贪心一下,显然先选大的更优。

所以一种方法就是把 M×MM \times M 的大正方形分成二的幂次的正方形,设现在有 cnticnt_i 个 2i×2i2^i \times 2^i 的正方形。

为了满足先选大的的贪心,加入一块的时候要从大到小加,所以当 i<30i<30 时,cnti←cnti+⌊m2i⌋2cnt_i \gets cnt_i + \lfloor \dfrac{m}{2^i} \rfloor^2

原文