2018-2019 ACM-ICPC, Asia Xuzhou Regional Contest- H. Rikka with A Long Colour Palette -思维+贪心 [Problem Description] 有\(k\)种颜色,给你\(n\)个区间段,选择一种合适的方案给每个区间段染色,使得最终染色次数等于\(k\)次的长度和最大. [Solution] 将左右端点放在一起排序,但是标记出它是左端点,还是右端点,并且记录每个端点属于第几个区间,排序后,对于每个左端点,从未使…
The link to problem:Problem - D - Codeforces D. Range and Partition time limit per test: 2 seconds memory limit per test: 256 megabytes input: standard input output: standard output Given an array a of n integers, find a range of values [x,y] (x≤y…
题面 这是2022年ICPC昆明站的F题.在赛场上,我一开始敲了个贪心,但是出锅了,改敲树形DP,但是时间来不及了.在队友的提醒下补过了这个题,知道解法的我发现我就是个纯纯的老坛-- 原题链接在牛客网:F-Find the Maximum_第46届ICPC亚洲区域赛(昆明)(正式赛),需要先登录之后才能访问.下面搬运一下原题面: A tree with nn vertices is a connected undirected graph with \(n\) vertices and \(n-…
C. Maximum splitting time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given several queries. In the i-th query you are given a single positive integer ni. You are to represent ni as…