题解codeforces round 1805

UVA333 题解

## 大意: 给定一个字符串 $s$ 判断 $s$ 是否符合要求。 1. 由数字,`-` 和大写英文数字 `X`,空格组成,`X` 代表 $10$ 且只能在最后出现。 2. 依次相加前面的数字的总和可以被 $11$ 整除,也就是前缀和,而且刚好 $s$ 只有 $10$ 个数字。 ## 坑点: 1. ......
题解 UVA 333

Codeforces Round 424 (Div. 1)D. Singer House

[传送门](https://codeforces.com/problemset/problem/830/D) 显然要自底向上进行$dp$ 深度相同的子树结构相同所以可以利用深度来代表子树。 那么就应该统计出有向路径的个数。 考虑路径由链所拼成。那么状态里应该有有向链的条数。 设$f_{i,j}$表示 ......
Codeforces Singer Round House 424

CF958E1 Guard Duty (easy) 题解

[题面传送门(luogu)](https://www.luogu.com.cn/problem/CF958E1) | [题面传送门(CF)](https://codeforces.com/problemset/problem/958/E1) 本题的翻译好像少了点东西(建议直接阅读英文题面,推荐一个[ ......
题解 Guard 958E Duty easy

Codeforces Round 827 (Div. 4)

# [Dashboard - Codeforces Round 827 (Div. 4) - Codeforces](https://codeforces.com/contest/1742) ## A Sum 简单题 ```c++ void solve() { int a, b, c; cin >> ......
Codeforces Round 827 Div

Codeforces 1855B:Longest Divisors Interval 最长的连续约数区间

# [1855B.Longest Divisors Interval](https://codeforces.com/contest/1855/problem/B "Codeforces 1855B") ## Description: - 对于一个整数 $n$ $(1\leq n \leq 10^{ ......
约数 区间 Codeforces Divisors Interval

T1的题解

一道小清新的思维题!和 $bocchi$ 酱一样可爱的喵 **30 pts** 首先典中典套路:破环成链,数组复制一份。 设 $to[i] = \max(\mathbb j) (j\geq i \wedge \sum_{i \leq l \leq j} a_l \leq k)$ 枚举起始下标,容易想 ......
题解

Codeforces Round 449 (Div. 1) D. Nephren Runs a Cinema 卡特兰数

[luogu链接](https://www.luogu.com.cn/problem/CF896D) 题意不再赘述。 优先枚举的应该是$VIP$用户,枚举范围应该是$[0,n-l]$ 之后总客户数为$s=n-i$ 再考虑枚举$100$的总人数为$x$ 则要求$s-2x\in [l,r]$ 这部分方案 ......
卡特兰 Codeforces Nephren Cinema Round

P4826 [USACO15FEB] Superbull S题解

#Superbull S题解 ###[题目传送门(可点击)](https://www.luogu.com.cn/problem/P4826) #题面 ##题目描述 $Bessie$和她的朋友们正在一年一度的$Superbull$锦标赛中打球,而$Farmer$ $John$负责让比赛尽可能激动人心。 ......
题解 Superbull P4826 USACO 4826

「题解」AGC034F RNG and XOR

$f_i$ 为变成 $i$ 的期望步数,那么 $f_0=0$,$f_i=1+\sum_{j=0}^{2^n-1}f_j\cdot p_{i\oplus j}$,理解为从 $i$ 走到 $0$ 的期望步数即可。 尝试用集合幂级数描述这个东西,如果不管 $f_0$ 那么就是 $F=F\times P+I ......
题解 034F AGC 034 RNG

SMU Summer 2023 Contest Round 9(2019 山东省大学生程序设计竞赛)

# 2019 山东省大学生程序设计竞赛 # A. Calandar **纯模拟吧(~~感觉我做麻烦了(?)~~,** **就是如果问的是未来的日期,就用相隔天数取模后加上这天的星期,** **如果问的是曾经的,就用这天的星期减去相隔天数的取模后的数,因为是减法,记得加模数** ```c++ #inc ......
程序设计 Contest 大学生 程序 Summer

JSC 2019 Qual D 题解

[problem](https://www.luogu.com.cn/problem/AT_jsc2019_qual_d) & [blog](https://www.cnblogs.com/liangbowen/p/17604061.html)。 是一道不难想,但是有趣的构造题阿!没有题解,我来一发 ......
题解 2019 Qual JSC

Educational Codeforces Round 38 C- F

# Educational Codeforces Round 38 C - F https://codeforces.com/contest/938 今天写出了三题ovo ## C. Constructing Tests 多画几个图就能发现,对于 $n\times n$ 的正方形来说,要使得 $m\ ......
Educational Codeforces Round 38

【csp2020】 方格取数 题解

[洛谷传送门](https://www.luogu.com.cn/problem/P7074) ## 1.题目大意 给定一个 $n*m$ 的矩阵,矩阵中每个点 $(i,j)$ 都有一个权值 $f_{(i,j)}$。每次可以向上,向下或向右走。问从 $(1,1)$ 走到 $(n,m)$,经过的路径上点 ......
题解 方格 2020 csp

SMU Summer 2023 Contest Round 8(2019 陕西省大学生程序设计竞赛)

# [SMU Summer 2023 Contest Round 8](https://codeforces.com/group/L9GOcnr1dm/contest/464880)(2019 陕西省大学生程序设计竞赛) ## B - Grid with Arrows(欧拉图) 题意:一个总规模为$ ......
程序设计 Contest 大学生 程序 Summer

Ceil and floor of the dataframe in Pandas Python – Round up and Truncate

In this article, we will discuss getting the ceil and floor values of the Pandas Dataframe. First, Let’s create a dataframe. Example: Python3 # import ......
and dataframe Truncate Pandas Python

SMU Summer 2023 Contest Round 6

# Problem - D. Number Of Permutations [传送门](https://codeforces.com/group/L9GOcnr1dm/contest/462070/problem/D) > [==容斥原理==](https://blog.csdn.net/weixi ......
Contest Summer Round 2023 SMU

SMU Summer 2023 Contest Round 1

# [Problem - A The Contest](https://codeforces.com/group/L9GOcnr1dm/contest/450888/problem/A)(纯属眼瞎) ```cpp #include using namespace std; typedef long ......
Contest Summer Round 2023 SMU

SMU Summer 2023 Contest Round 2

# [Problem - A Treasure Hunt](https://codeforces.com/group/L9GOcnr1dm/contest/450889/problem/A) ```cpp #include using namespace std; typedef long long ......
Contest Summer Round 2023 SMU

SMU Summer 2023 Contest Round 3

# [Problem - A - Curriculum Vitae](https://codeforces.com/group/L9GOcnr1dm/contest/450890/problem/A) ````cpp #include using namespace std; const int N ......
Contest Summer Round 2023 SMU

【题解】Luogu[P5022] [NOIP2018 提高组] 旅行

[Link](https://www.luogu.com.cn/problem/P5022) 因为是道NOIP,那么我们不妨按照考场上的策略一点一点想。 先看部分分,有一档有很明显的特征 $n=m-1$ 这显然构成一棵树,对于一棵树,我们想把他按照题目的要求遍历完,一定是像dfs的遍历顺序一样,对于 ......
题解 Luogu P5022 5022 2018

CCPC Changchun 2020 D, Meaningless Sequence题解

听说是签到题。 不难看出设x为i二进制个数下1的个数(还是难的),则a_i=c^x。那么我们只需要考虑所有0到n的个数。 当n为1111时,可以得到为(1+c)^n次方,那么我们把答案看成两部分一部分是1到111...和1000到n, 那么当si位为1时,可以看成是n去掉前一位后再乘以c,递推得到每 ......
题解 Meaningless Changchun Sequence CCPC

梦幻岛宝珠 个人题解

这题的物品数量非常小,但是背包的重量非常大,我们采用压缩到二进制位来考虑,因为最多是n*20的数位*个数,并且上一位dp的状态不影响下一位。所以我们设计当前dp的状态为选取了前i位置时候所能获得的最大值。又因为上一维在数组dp时可能会被上一维的影响所以f[min(2*i+d,s)] =max(f[m ......
宝珠 题解 梦幻 个人

题解 SP15454

## 前言 ### 数学符号约定 $\operatorname{lowbit}(x)$:表示 $x$ 的二进制最低位。 $[a,b]$:表示区间 $a\sim b$,其中包含 $a,\,b$ 端点,其区间长度为 $b - a + 1$。 如非特殊说明,将会按照上述约定书写符号。 ### 题目大意 有 ......
题解 15454 SP

题解 ARC104F

## 前言 在这里首先感谢一下题解区的 [FZzzz](https://www.luogu.com.cn/user/174045),本人的题解思路主要是基于他并给出了自己的理解。 如非特殊说明,本题解中的数学符号原则上与题目中一致。 ## 题目分析 需要转化的喵喵题。 我们需要把原问题转化成一个图论 ......
题解 104F ARC 104

题解 AGC054D

## 前言 因为本人尚菜,所以本篇文章没有什么数学符号,请大家放心食用。 ## 题目分析 先吐槽一嘴,这个 `o` 表示 `()`,这个 `x` 表示 `)(`,十分形象。 好,我们先观察原序列,容易得出第一条性质: > `ox` 的加入不会让我们不合法的序列变合法,相反,它会让我们合法的序列变不合 ......
题解 054D AGC 054

Limit线段树题单题解(更新中)

## [P3373 线段树模板 2](https://www.luogu.com.cn/problem/P3373) ![image-20230803010844370](https://zeoy-typora.oss-cn-hangzhou.aliyuncs.com/image-202308030 ......
线段 题解 Limit

HDU 多校 2023 Round #5 题解

# HDU 多校 2023 Round #5 题解 $\text{By DaiRuiChen007}$ ## A. Typhoon [Problem Link](https://acm.hdu.edu.cn/showproblem.php?pid=7324) **题目大意** > 给一条 $n$ 个 ......
题解 Round 2023 HDU

Codeforces Round 887 (Div. 1)

# Preface 补一篇好久之前打的CF的博客,说实话其实B题我当时怎么想的已经忘的七七八八了 这场第一眼看A没啥思路,就先去把B这个构造写了,中间想了挺久的大概40min才写出来 然后回头一看A发现可以倒着做,就是个丁真题了然后15min写完 后面看C刚开始以为是个贪心,后面又感觉是个DP,但状 ......
Codeforces Round 887 Div

题解 P9233【[蓝桥杯 2023 省 A] 颜色平衡树】

看到树上数颜色,想到树上启发式合并(dsu on tree)。 这题几乎就是树上启发式合并板子了,感觉讲一下算法的原理比较好。 暴力解法显然是对每棵子树 dfs 一遍,求出子树大小 $\operatorname{size}$、子树颜色出现次数的桶 $\operatorname{cnt}$,以及颜色出 ......
蓝桥 题解 颜色 P9233 9233

题解 P9406【[POI2020-2021R3] Nawiasowania】

一个显然的思路是:在排列 $p$ 的括号串合法的基础上,使得左括号在原括号串中尽量靠左,这样答案更有可能合法。于是我们求出这个原括号尽量靠左的括号串(下文称为“最优括号串”),然后 check 合法性即可。 下文中 $s$ 是排列 $p$ 的括号串。 当 $n=2$ 时,唯一的填法是令 $s_1\g ......
题解 Nawiasowania P9406 9406 2020