题解codeforces round 879
D. Bag of mice -- (概率Dp)codeforces 148
###原题链接:[https://codeforces.com/contest/148/submission/213227373](https://codeforces.com/contest/148/submission/213227373) ###题意:捉老鼠游戏,谁捉到白鼠就是胜利,我们求公主 ......
E. Two Chess Pieces -- (codeforces) 树形DP
###原题链接:[https://codeforces.com/contest/1774/problem/E](https://codeforces.com/contest/1774/problem/E) ###题意:两颗棋子,给出两颗棋子必须要去的顶点,且给出两颗棋子的相隔距离不能大于d,算出两颗 ......
SMU Summer 2023 Contest Round 2
# [SMU Summer 2023 Contest Round 2](https://codeforces.com/group/L9GOcnr1dm/contest/450889) ## [A. Treasure Hunt](https://codeforces.com/group/L9GOcnr ......
Educational Codeforces Round 23
# A. Treasure Hunt ```cpp #include using namespace std; int read() { int x = 0, f = 1, ch = getchar(); while ((ch '9') && ch != '-') ch = getchar(); i ......
Codeforces Round 883 (Div. 3)
# Codeforces Round 883 (Div. 3) 题目链接:[Codeforces Round 883 (Div. 3)](https://codeforces.com/contest/1846 "Codeforces Round 883 (Div. 3)") ## A. Rudolp ......
洛谷 P4869 albus就是要第一个出场 题解
[洛谷 P4869 albus就是要第一个出场](https://www.luogu.com.cn/problem/P4869) #### 题意 给定一个长度为 $n$ 的序列 $A$,设**可重**集合 $S=\left\{\operatorname{xor}_{i=1}^nA_ix_i\mid ......
CF878E 题解
# CF878E Numbers on the blackboard 题解 ## Links [洛谷](https://www.luogu.com.cn/problem/CF878E) [Codeforces](https://codeforces.com/problemset/problem/87 ......
AT_abc306_h 题解
# AT_abc306_h Balance Scale 题解 ## Links [洛谷](https://www.luogu.com.cn/problem/AT_abc306_h) [AtCoder](https://atcoder.jp/contests/abc306/tasks/abc306_h ......
luoguP3403跳楼机 题解【同余最短路】
[题面](https://www.luogu.com.cn/problem/P3403) 题意: 可以发现操作四相当于是每次有了回到起点的机会,那么问题就变成了求满足:$Ax+By+Cz = k,k\leq h$ 所有的 $k$。 考虑忽略 $x$,这样只需要求出所有的通过 $y, z$ 能到达的小 ......
Educational Codeforces Round 96 (Rated for Div. 2)E
You are given a string s. You have to reverse it — that is, the first letter should become equal to the last letter before the reversal, the second le ......
2023年7月6日普及组南外集训题解
# A 阿伦 ## 题目描述 Aron要去给朋友买礼物。 前面有$n$个人在排队,其中有一些独自前来的顾客和一些组团前来的顾客。 相邻的穿着一样的衣服的顾客在同一团队里。 一个团队里只要第一个人买了就会离开。 问Aron会在第几个排到 ## 输入格式 第一行一个$n$,表示前面有多少个人 接下来共$ ......
Luogu CF633B 【A Trivial Problem】题解
一段理解起来特别容易的代码 (目前来看是最短的) ## 思路 由于末尾0的个数就是阶乘中分解出10的个数,也就是分解出2的个数与5的个数中的最小值; 显然5的个数小于2的个数,即找出分解出的5的个数。 **比较容易推出:当 $n$ 为 $5^{k}$ 的倍数时,其阶乘分解出 $5$ 的个数即为 $n ......
SMU Summer 2023 Contest Round 1
# [SMU Summer 2023 Contest Round 1](https://codeforces.com/group/L9GOcnr1dm/contest/450888) ## [A. The Contest](https://codeforces.com/group/L9GOcnr1d ......
Educational Codeforces Round 29
# Educational Codeforces Round 29 https://codeforces.com/contest/863 复健训练 太久没练直接变身傻逼(难道原来就不是吗,笑) ## A. Quasi-palindrome 直接去除后缀0即可(WA了两发评价为弱智) ```CC #i ......
牛客周赛 Round 2 A~D
A #include <iostream> #include <cstring> #include <string> #include <algorithm> #include <cmath> #include <set> #include <utility> #include <vector> # ......
CODE FESTIVAL 2017 Final J 题解
[problem](https://www.luogu.com.cn/problem/AT_cf17_final_j) & [blog](https://www.cnblogs.com/liangbowen/p/17542298.html)。 萌萌点分治,积累个 trick /qq。 > 对于完全图 ......
CodeForces 1508C Complete the MST
[洛谷传送门](https://www.luogu.com.cn/problem/CF1508C "洛谷传送门") [AtCoder 传送门](https://codeforces.com/problemset/problem/1508/C "AtCoder 传送门") 比较需要观察的题。 设 $v ......
CodeForces 920E Connected Components?
[洛谷传送门](https://www.luogu.com.cn/problem/CF920E "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/920/E "CF 传送门") 考虑直接暴力 dfs。设搜到点 $u$,把 $u$ ......
P2886题解
title: P2886题解 date: 2023-05-15 16:18:46 tags: 题解 cover: https://d-sketon.top/img/backimg/bg9.jpg # 题目大意 给定起点 $S$ 和终点 $T$,求从起点到终点**恰好**经过 $N$ ($N$ 给定) ......
P4016题解
title: P4016题解 date: 2023-05-22 14:05:46 tags: 题解 cover: https://d-sketon.top/img/backimg/bg23.jpg 本题是一个比较经典的问题(环形均分纸牌问题),我也不知道为什么它在网络流 24 题里面出现。但是作为一 ......
P3599题解
title: P3599题解 date: 2023-05-29 10:58:58 tags: 题解 cover: https://img.paulzzh.com/touhou/konachan/jpeg/068aa04808f99c146d186a4b1006ffef.jpg 本题是一道比较典的构造 ......
CF1421E题解
title: CF1421E题解 date: 2023-05-25 21:06:45 tags: 题解 cover: https://img.paulzzh.com/touhou/konachan/image/5558d2c6085f80d3cfeade810d7aa417.jpg [题目链接](h ......
NOIP2013-2023题解
title: NOIP2013-2023题解 date: 2023-06-12 21:24:37 tags: 题解 cover: https://img.paulzzh.com/touhou/konachan/jpeg/9f3e2443fc9d396c24bff395564565db.jpg ~~本 ......
CF1545D-题解
title: CF1545D 题解 date: 2023-06-05 19:36:13 tags: 题解 cover: https://img.paulzzh.com/touhou/konachan/image/bdf79fcf8026aae582a32911c942c8b0.jpg [题目链接]( ......
AT-abc214-g题解
title: AT_abc214_g题解 date: 2023-05-30 21:12:20 tags: 题解 cover: https://i.imgloc.com/2023/05/30/Vt18Rz.jpeg # 题目描述 给定两个排列 $p, q$,要求统计满足 $\forall i, r_i ......
Largest-Smallest-Cyclic-Shift题解
title: Largest Smallest Cyclic Shift题解 date: 2023-06-05 11:22:16 tags: 题解 cover: https://img.paulzzh.com/touhou/konachan/image/f7e83305150ed53be7ccf88 ......
CF1827D 题解
[problem](https://www.luogu.com.cn/problem/CF1827D) & [blog](https://www.cnblogs.com/liangbowen/p/17541713.html)。 很好的题。用到一些关于重心的 trick。 不妨认为只有一个重心 $\t ......
P1672 [USACO05FEB] Feed Accounting S 题解
给 $c$ 个区间表示牛吃草的时间段,每头牛每天吃 $1$ 千克,问距今天(即运来饲料 $f_2$ 千克的时间)最近的送饲料 $f_1$ 千克的时间是什么时候? ......
攀拓(PAT)- 程序设计(乙级)2023年夏季考试仿真卷题解
#B-1 唯手熟尔 思路:getchar一个读入到string中进行判断 代码: ``` #include using i64 = long long; #pragma GCC optimize(2) #define IOS std::ios::sync_with_stdio(false), std ......
Educational Codeforces Round 22
# A. The Contest 想一想就知道,提交的时间无所谓,所以我们选择全部做完后的第一个时间间隔提交即可 ```cpp #include using namespace std; #define int long long int read() { int x = 0, f = 1, ch ......