![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法竞赛阶级指南
文章平均质量分 51
菜鸡的博客
这个作者很懒,什么都没留下…
展开
-
hdu 4911 Inversion
Problem Description bobo has a sequence a1,a2,…,an. He is allowed to swap two adjacent numbers for no more than k times. Find the minimum number of inversions after his swaps. Note: The number of inversions is the number of pair (i,j) where 1≤i<j≤n and原创 2021-05-23 20:21:07 · 91 阅读 · 0 评论 -
poj 3468 A Simple Problem with Integers(线段树)
Description You have N integers, A1, A2, … , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval. The other is to ask for the sum of numbers in a given interval. Input The原创 2021-05-23 15:07:53 · 90 阅读 · 0 评论 -
272. 最长公共上升子序列
熊大妈的奶牛在小沐沐的熏陶下开始研究信息题目。 小沐沐先让奶牛研究了最长上升子序列,再让他们研究了最长公共子序列,现在又让他们研究最长公共上升子序列了。 小沐沐说,对于两个数列 A 和 B,如果它们都包含一段位置不一定连续的数,且数值是严格递增的,那么称这一段数是两个数列的公共上升子序列,而所有的公共上升子序列中最长的就是最长公共上升子序列了。 奶牛半懂不懂,小沐沐要你来告诉奶牛什么是最长公共上升子序列。 不过,只要告诉奶牛它的长度就可以了。 数列 A 和 B 的长度均不超过 3000。 输入格式 第一行包原创 2021-05-11 20:15:33 · 179 阅读 · 0 评论 -
AcWing 271. 杨老师的照相排列
有 N 个学生合影,站成左端对齐的 k 排,每排分别有 N1,N2,…,Nk 个人。 (N1≥N2≥…≥Nk) 第 1 排站在最后边,第 k 排站在最前边。 学生的身高互不相同,把他们从高到底依次标记为 1,2,…,N。 在合影时要求每一排从左到右身高递减,每一列从后到前身高也递减。 问一共有多少种安排合影位置的方案? 下面的一排三角矩阵给出了当 N=6,k=3,N1=3,N2=2,N3=1 时的全部 16 种合影方案。注意身高最高的是 1,最低的是 6。 123 123 124 124 125 125 1原创 2021-05-10 20:54:11 · 75 阅读 · 0 评论