P's Blog

  • Home

  • About

  • Tags

  • Categories

  • Archives

  • Search

HDU-1024 Max Sum Plus Plus

Posted on 2019-03-21 | Edited on 2019-06-17 | In hdu | Views:

题意

给你一个序列n个数组成,然后让你在里面找到m个子序列,让这m个子序列的和最大。

Read more »

POJ-2559 Largest Rectangle in a Histogram

Posted on 2019-03-21 | Edited on 2019-08-08 | In poj | Views:

题意

45660aba95464e61adfbbcc7cea2c44c

求柱形图中的最大矩形面积。

Read more »

CF-1012

Posted on 2019-03-21 | Edited on 2019-04-14 | In cf | Views:

B. Chemical table

题意

95223620a323ec59470718b34958c7f295698ff1

一个 n*m 的矩阵,当涂了三个角时,会自动涂第四个,已有一些点涂色,问最少需要涂几个点。

Read more »

城市建设

Posted on 2019-03-21 | Edited on 2019-09-20 | In 蓝桥杯 | Views:

题意

n 个城市,m 条道路,每条道路有一个权值(可能为负),每个点有一个权值,表示修建码头的费用(为-1时表示不可以修建码头)。

Read more »

斐波那契

Posted on 2019-03-20 | Edited on 2019-09-20 | In 蓝桥杯 | Views:

题意

$f(x)$为斐波那契数列,求$\large\left(\sum\limits_{i=1}^nf(i)\right) mod f(m) mod p$

$0<n,m,p<1e18$

Read more »

图形排版

Posted on 2019-03-20 | Edited on 2019-04-19 | In 蓝桥杯 | Views:

题意

小明需要在一篇文档中加入 N 张图片,其中第 i 张图片的宽度是 Wi,高度是 Hi。假设纸张的宽度是 M,小明使用的文档编辑工具会用以下方式对图片进行自动排版:

  1. 该工具会按照图片顺序,在宽度 M 以内,将尽可能多的图片排在一行。该行的高度是行内最高的图片的高度。例如在 M=10 的纸张上依次打印 3x4, 2x2, 3x3 三张图片,则效果如下图所示,这一行高度为4。(分割线以上为列标尺,分割线以下为排版区域;数字组成的矩形为第x张图片占用的版面)
    img

  2. 如果当前行剩余宽度大于0,并且小于下一张图片,则下一张图片会按比例缩放到宽度为当前行剩余宽度(高度向上取整),然后放入当前行。例如再放入一张4x9的图片,由于剩余宽度是2,这张图片会被压缩到2x5,再被放入第一行的末尾。此时该行高度为5:
    img

  3. 如果当前行剩余宽度为0,该工具会从下一行开始继续对剩余的图片进行排版,直到所有图片都处理完毕。此时所有行的总高度和就是这 N 张图片的排版高度。例如再放入11x1, 5x5, 3x4 的图片后,效果如下图所示,总高度为11:
    img

    现在由于排版高度过高,图片的先后顺序也不能改变,小明只好从 N 张图片中选择一张删除掉以降低总高度。他希望剩余N-1张图片按原顺序的排版高度最低,你能求出最低高度是多少么?

Read more »

格子刷油漆

Posted on 2019-03-20 | Edited on 2019-04-01 | In 蓝桥杯 | Views:

题意

给一个$2*N$的矩阵,可以从任意一个格子刷起,但只能移动到和它相邻的格子(可以对角),求总的方案数,对$1e9+7$取模。

Read more »

高僧斗法

Posted on 2019-03-20 | Edited on 2019-04-02 | In 蓝桥杯 | Views:

题意

n 个物品放在阶梯,向上移动物品,不能越过挡在前面的物品,最后物品都挤在高段台阶,不能移动的输。

Read more »

国王的烦恼

Posted on 2019-03-20 | Edited on 2019-04-01 | In 蓝桥杯 | Views:

题意

n 个点 m 条边,每条边有一个权值表示该边消失的时间,求有新的点不联通的时刻的数量。

Read more »

CF-1062

Posted on 2019-03-02 | Edited on 2019-08-08 | In cf | Views:

D. Fun with Integers

题意

You are given a positive integer n​ greater or equal to 2. For every pair of integers a and b (2≤|𝑎|,|𝑏|≤𝑛2≤|a|,|b|≤n), you can transform a into b if and only if there exists an integer x such that 1<|x| and (a⋅x=b or b⋅x=a), where |x| denotes the absolute value of x.

After such a transformation, your score increases by |x| points and you are not allowed to transform a into b nor b into a anymore.

Initially, you have a score of 0. You can start at any integer and transform it as many times as you like. What is the maximum score you can achieve?

Read more »
1…789
PerpEternal

PerpEternal

81 posts
12 categories
27 tags
Links
  • GuYF's Blog
© 2019 PerpEternal