08 2023 档案

摘要:C. MEX Repetition You are given an array $a_1,a_2,\ldots, a_n$ of pairwise distinct integers from $0$ to $n$. Consider the following operation: consec 阅读全文
posted @ 2023-08-31 14:43 onlyblues 阅读(37) 评论(0) 推荐(0)
摘要:B. Split Sort You are given a permutation$^{\dagger}$ $p_1, p_2, \ldots, p_n$ of integers $1$ to $n$. You can change the current permutation by applyi 阅读全文
posted @ 2023-08-31 12:14 onlyblues 阅读(73) 评论(0) 推荐(0)
摘要:D. Matrix Cascade There is a matrix of size $n \times n$ which consists of 0s and 1s. The rows are numbered from $1$ to $n$ from top to bottom, the co 阅读全文
posted @ 2023-08-30 10:48 onlyblues 阅读(107) 评论(0) 推荐(0)
摘要:2024-01-26 upd:这篇可以作废了,请移步至数位 dp 学习笔记(灵神模板),该博客介绍了递归的写法,会更容易理解与编写代码。 前言 最近学了一种新的数位dp的状态表示,打算应用到以前做过的数位dp的题目。如果我们对数$N$进行数位dp,以前的状态定义$f(i,j)$表示所有数位大小为$i 阅读全文
posted @ 2023-08-28 10:25 onlyblues 阅读(50) 评论(0) 推荐(0)
摘要:二进制 给定一个长度为 $N$ 的二进制串($01$ 串)以及一个正整数 $K$。 按照从左到右的顺序,依次遍历给定二进制串的 $N-K+1$ 个长度为 $K$ 的子串,并计算每个遍历子串的各位数字之和。 将这 $N-K+1$ 个子串数字和按照子串的遍历顺序进行排列,得到的序列就是给定二进制串的 $ 阅读全文
posted @ 2023-08-26 09:50 onlyblues 阅读(45) 评论(0) 推荐(0)
摘要:G. The Great Equalizer Tema bought an old device with a small screen and a worn-out inscription "The Great Equalizer" on the side. The seller said tha 阅读全文
posted @ 2023-08-25 15:23 onlyblues 阅读(113) 评论(0) 推荐(0)
摘要:E. Kolya and Movie Theatre Recently, Kolya found out that a new movie theatre is going to be opened in his city soon, which will show a new movie ever 阅读全文
posted @ 2023-08-25 09:31 onlyblues 阅读(61) 评论(0) 推荐(0)
摘要:Number of Beautiful Integers in the Range You are given positive integers low, high, and k. A number is beautiful if it meets both of the following co 阅读全文
posted @ 2023-08-20 16:31 onlyblues 阅读(71) 评论(0) 推荐(0)
摘要:叶子的颜色 给一棵有 $m$ 个节点的无根树,你可以选择一个度数大于 $1$ 的节点作为根,然后给一些节点(根、内部节点、叶子均可)着以黑色或白色。 你的着色方案应保证根节点到各叶子节点的简单路径上都至少包含一个有色节点,哪怕是这个叶子本身。 对于每个叶子节点 $u$,定义 $c_u$ 为从根节点到 阅读全文
posted @ 2023-08-19 11:34 onlyblues 阅读(28) 评论(0) 推荐(0)
摘要:D. Trees and Segments The teachers of the Summer Informatics School decided to plant $n$ trees in a row, and it was decided to plant only oaks and fir 阅读全文
posted @ 2023-08-16 20:51 onlyblues 阅读(71) 评论(0) 推荐(0)
摘要:E. Maximum Monogonosity You are given an array $a$ of length $n$ and an array $b$ of length $n$. The cost of a segment $[l, r]$, $1 \le l \le r \le n$ 阅读全文
posted @ 2023-08-14 20:15 onlyblues 阅读(59) 评论(0) 推荐(0)
摘要:D. Andrey and Escape from Capygrad An incident occurred in Capygrad, the capital of Tyagoland, where all the capybaras in the city went crazy and star 阅读全文
posted @ 2023-08-13 19:40 onlyblues 阅读(89) 评论(0) 推荐(0)
摘要:G. Vlad and the Mountains Vlad decided to go on a trip to the mountains. He plans to move between $n$ mountains, some of which are connected by roads. 阅读全文
posted @ 2023-08-11 15:57 onlyblues 阅读(107) 评论(0) 推荐(0)
摘要:G. Counting Graphs Given a tree consisting of $n$ vertices. A tree is a connected undirected graph without cycles. Each edge of the tree has its weigh 阅读全文
posted @ 2023-08-08 23:17 onlyblues 阅读(196) 评论(0) 推荐(1)
摘要:E1. PermuTree (easy version) This is the easy version of the problem. The differences between the two versions are the constraint on $n$ and the time 阅读全文
posted @ 2023-08-07 19:59 onlyblues 阅读(102) 评论(0) 推荐(0)

Web Analytics