摘要: 原题 题目描述 Z 国的骑士团是一个很有势力的组织,帮会中汇聚了来自各地的精英。他们劫富济贫,惩恶扬善,受到社会各界的赞扬。 最近发生了一件可怕的事情,邪恶的 Y 国发动了一场针对 Z 国的侵略战争。战火绵延五百里,在和平环境中安逸了数百年的 Z 国又怎能抵挡的住 Y 国的军队。于是人们把所有的希望 阅读全文
posted @ 2020-11-10 22:21 kurum! 阅读(83) 评论(0) 推荐(0) 编辑
摘要: 原题 Once Petya read a problem about a bracket sequence. He gave it much thought but didn't find a solution. Today you will face it. You are given strin 阅读全文
posted @ 2020-11-02 08:20 kurum! 阅读(67) 评论(0) 推荐(0) 编辑
摘要: 原题 You are given an array of nn integers \(a1, a2, ..., an\), and a set bb of kk distinct integers from $1$ to \(n\). In one operation, you may choose 阅读全文
posted @ 2020-10-29 16:15 kurum! 阅读(110) 评论(2) 推荐(0) 编辑
摘要: 原题 You are given a matrix aa of size n×mn×m consisting of integers. You can choose no more than \(⌊\frac{m}{2}⌋\) elements in each row. Your task is t 阅读全文
posted @ 2020-10-26 17:40 kurum! 阅读(122) 评论(1) 推荐(0) 编辑
摘要: 原题 This year Alex has finished school, and now he is a first-year student of Berland State University. For him it was a total surprise that even thoug 阅读全文
posted @ 2020-10-03 18:45 kurum! 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 原题 思路 cdq分治,三维偏序问题(x, y, id)。第一维用sort排,第二维归并排序同时根据第三维树状数组统计贡献,手动交换会T,先sort再统计贡献,node数组要开4倍。 #include <algorithm> #include <cmath> #include <cstdio> #i 阅读全文
posted @ 2020-09-28 09:22 kurum! 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 原题 思路 前缀和处理人数, 10表示是否有序,经行状压,枚举当前状态最后一个有序的乐队。 #include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include < 阅读全文
posted @ 2020-09-19 21:55 kurum! 阅读(115) 评论(0) 推荐(0) 编辑
摘要: P2014 [CTSC1997]选课 没有变形的树上背包 #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <list> #include <map> #include <iostr 阅读全文
posted @ 2020-09-11 23:39 kurum! 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 【原题】 一棵二叉树可以按照如下规则表示成一个由 0、1、2 组成的字符序列,我们称之为“二叉树序列 \(S\)”: \(S = \begin{cases}0,表示该树没有子节点\\ 1S_1,表示该树有一个节点,S_1为其子树的二叉树序列\\ 2S_1S_2,表示该树由两个子节点,S_1和S_2分 阅读全文
posted @ 2020-09-03 22:09 kurum! 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 【原题】 题目描述 涵涵有两盒火柴,每盒装有 n 根火柴,每根火柴都有一个高度。 现在将每盒中的火柴各自排成一列, 同一列火柴的高度互不相同, 两列火柴之间的距离定义为:$∑(ai−bi)^2 $ 其中 ai 表示第一列火柴中第 i 个火柴的高度,bib_ibi 表示第二列火柴中第 i 个火柴的高度 阅读全文
posted @ 2020-08-16 10:49 kurum! 阅读(142) 评论(0) 推荐(0) 编辑