题解p9580 round game

P9451 [ZSHOI-R1] 新概念报数 题解

满足 $\operatorname{popcount}(x) #include #include #include #include using std::cin;using std::cout; using lolu=unsigned long long; std::sets; signed ma ......
题解 新概念 ZSHOI-R P9451 ZSHOI

【题解】Luogu[P4711] 「化学」相对分子质量

[Link](https://www.luogu.com.cn/problem/P4711) 一道简单的模拟题,评绿可能有点高了。 因为没有括号嵌套,难度瞬间降了一个档次,我们直接对着化学式扫一遍即可。 若扫到左括号,说明接下来都是在括号内的,我们标记一下。 若扫到大写字母,说明出现了一个新的元素, ......
题解 分子 化学 质量 Luogu

[USACO13DEC] The Bessie Shuffle S 洗牌 题解

提供一种思路,可以做到$O(n)$。\ 目前是全`OJ`最优解,跑到了`79ms`。 `update 2023.07.29` 完工,期望无bug(暑假快乐吖o(* ̄▽ ̄*)ブ)\ `update 2023.07.27` ~~(要原题检测了,先占个坑,有时间再补)~~ ## 原题大意 [P3095 [ ......
题解 Shuffle Bessie USACO DEC

CF858C 题解

[洛谷链接](https://www.luogu.com.cn/problem/CF858C)&[CF 链接](https://codeforces.com/problemset/problem/858/C) 本篇题解为此题**较简单做法**及**较少码量**,并且码风优良,请放心阅读。 ## 题目 ......
题解 858C 858 CF

AT_agc022_a 题解

[洛谷链接](https://www.luogu.com.cn/problem/AT_agc022_a)&[Atcoder 链接](https://www.luogu.com.cn/remoteJudgeRedirect/atcoder/agc022_a) 本篇题解为此题**较简单做法**及**较少 ......
题解 AT_agc 022 agc AT

Educational Codeforces Round 152 (Rated for Div. 2)(A~D)

感觉代码越写越丑了...... 但能过题就是了 A. Morning Sandwich 莫诺卡普总是用美味的三明治开始他的早晨。莫诺卡普做的三明治总是由面包、奶酪和/或火腿组成。 三明治总是遵循以下公式 一块面包 一片奶酪或火腿 一块面包 …… 一片奶酪或火腿 一块面包 因此,面包总是放在顶部和底部 ......
Educational Codeforces Round Rated 152

games101 HomeWork

# Games101 HomeWork4 - **bezier:该函数实现绘制 Bézier 曲线的功能。它使用一个控制点序列和一个OpenCV::Mat 对象作为输入,没有返回值。它会使 t 在 0 到 1 的范围内进行迭代,并在每次迭代中使 t 增加一个微小值。对于每个需要计算的 t,将调用另一 ......
HomeWork games 101

【题解】[2023牛客多校] Qu'est-ce Que C'est?

题目传送门:[[2023牛客多校] Qu'est-ce Que C'est?](https://ac.nowcoder.com/acm/contest/57358/J) # 题意 给定 $n,m$ 构造 $a_{1},a_{2},...,a_{n}$, 其中 $a_{i} \in [-m, m]$ ......
题解 est est-ce 2023 39

Educational Round 147

前言:非常好场次编号,爱来自小粉兔。 唉,GF。 A. shaber 模拟。 B. shaber。找最大的满足 $a_{l\sim r}$ 和 $a'_{l\sim r}$ 有不同,且 $a'_{l\sim r}$ 递增的 $\langle l,r \rangle$ 即可。$\mathcal O(n ......
Educational Round 147

Educational Codeforces Round 152 (Rated for Div. 2)记录

A. Morning Sandwich #include <cstdio> #include <algorithm> #include <cmath> #include <vector> #include <string.h> #include <set> #include <string> #in ......
Educational Codeforces Round Rated 152

SMU Summer 2023 Contest Round 7

# [SMU Summer 2023 Contest Round 7](https://codeforces.com/group/L9GOcnr1dm/contest/464081) ## [A. Two Rival Students](https://codeforces.com/group/L9 ......
Contest Summer Round 2023 SMU

Educational Codeforces Round 76 (Rated for Div. 2)

Educational Codeforces Round 76 (Rated for Div. 2) A - Two Rival Students 思路:最多可加x个距离,且最后的距离不能超过n-1 #include<bits/stdc++.h> using namespace std; #defi ......
Educational Codeforces Round Rated Div

Educational Codeforces Round 152 A~D

A #include <bits/stdc++.h> #define endl '\n' #define ios ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr) using namespace std; typedef ......
Educational Codeforces Round 152

【题解】HDOJ 7304 [2023杭电多校] Out Of Control

题目传送门:[HDOJ 7304 [2023杭电多校] Out Of Control](https://acm.hdu.edu.cn/showproblem.php?pid=7304) # 题意 给长度为 $n$ 的序列 $a_n$ 以及 $k$ ,问容量分别为 $i \in k$ 时,有多少种取 ......
题解 Control HDOJ 7304 2023

Codeforces Round 888 (Div. 3) 题解

考场上 $7$ 题做出来 $4$ 题,最后几分钟才把 D 题调出来,但还是吃了不少罚时 # A. Escalator Conversations $O(n)$ 枚举即可,对于每个人计算需要的间隔台阶数是否在 $(0,m)$ 以内以及相差高度是否是 $k$ 的倍数 # B. Parity Sort 显 ......
题解 Codeforces Round 888 Div

题解 Gym 103960K【Kalel, the Jumping Frog】

## problem 一只青蛙,他会跳,现在要从 $1$ 跳到 $n$。跳一次有 $m$ 种跳法,假设现在在 $x$,那么第 $i$ 次可以从 $x$ 跳到 $x+d_i$,同时消耗 $p_j$ 的能量。问你有多少种跳的方案使得消耗能量不超过 $k$。$n\leq 10^9,m\leq 10^5,1 ......
题解 103960K Jumping 103960 Kalel

Educational Codeforces Round 152 (Rated for Div. 2) C. Binary String Copying

# C. 二进制字符串复制 每次测试的时间限制2秒 每个测试的内存限制256兆字节 输入标准输入 输出标准输出 给你一个字符串s包含由...组成n个0或1。给出m次操作,让i-th 副本是字符串ti。然后,您对每个副本执行一次操作:i-th 副本,您对其子字符串进行排序[li,ri](子字符串来自原 ......
Educational Codeforces Copying Binary String

Educational Codeforces Round 76

# A. Two Rival Students 让两个人向两侧走就好了。 ```cpp #include using namespace std; void solve(){ int n , x , a , b; cin >> n >> x >> a >> b; if( a > b ) swap( ......
Educational Codeforces Round 76

CF1188B 题解

[题目传送门](https://www.luogu.com.cn/problem/CF1188B) 感觉并不是特别难的题。 首先是一个简单的推式子,有原式: $$(a_i+a_j) \times ({a_i}^2+{a_j}^2) \equiv k \mod p$$ 如何针对 $a_i+a_j$ 进 ......
题解 1188B 1188 CF

P2679 [NOIP2015 提高组] 子串 题解

[原题](http://https://www.luogu.com.cn/problem/P2679 "原题")\ $题目大意$\ $从字符串a中选出k个子串s_1,s_2,s_3...s_k使得s_1+s_2+s_3+...+s_k=b$\ $求总方案数对10^9+7取模的结果$\ $1\le | ......
题解 P2679 2679 2015 NOIP

AT_tenka1_2015_qualB_b 题解

[洛谷链接](https://www.luogu.com.cn/problem/AT_tenka1_2015_qualB_b)&[Atcoder 链接](https://www.luogu.com.cn/remoteJudgeRedirect/atcoder/tenka1_2015_qualB_b) ......
题解 AT_tenka qualB_b tenka qualB

[ABC296E] Transition Game

题意:给定$n$个数,$a_i$为$i$的后继,有$n$轮游戏中,若第$i$轮游戏,对于$1~n$中任意一个后继次数$j$,都能选择一个数$x$使得$x$后继$j$次之后都为$i$,则称之赢一局,问赢的局数。 首先可以肯定一个数的后继是唯一确定的,我们可以从任意$1~n$中的连向它的后继。考虑如果当 ......
Transition 296E Game ABC 296

题解:【ICPC WF 2021 C】 Fair Division

[题目链接](https://www.luogu.com.cn/problem/P9441) 记 $g = 1 - f$,即传递下去的宝藏有多少。如果一个海盗在第一轮得到了 $x$,则第二轮将得到 $g^n x$,第 $T$ 轮得到 $g^{Tn} x$,于是在极限情况下总共得到的宝藏为 $\dfr ......
题解 Division ICPC 2021 Fair

CF709B 题解

[洛谷链接](https://www.luogu.com.cn/problem/CF709B)&[CF 链接](http://codeforces.com/problemset/problem/709/B) 本篇题解为此题**较简单做法**及**较少码量**,并且码风优良,请放心阅读。 ## 题目简 ......
题解 709B 709 CF

HDU1702 ACboy needs your help again! 题解

#include <iostream> #include <string> #include <queue> #include <stack> using namespace std; int t, n, m; int main() { cin >> t; while (t--) { queue<i ......
题解 ACboy needs again 1702

Educational Codeforces Round 1

# Educational Codeforces Round 1 ## A. Tricky Sum ```cpp int fac[N],p2[N]; void init(){ fac[0]=1;p2[0]=1; for(int i=1;i0?"YES":"NO"); //puts(ans>0?"Ye ......
Educational Codeforces Round

P1880 [NOI1995] 石子合并 题解

区间DP。 首先将其复制一遍(因为是环)。 设 $f[i][j]$ 表示将 $i$ 到 $j$ 段的石子合并需要的次数。 有 $$f[i][j] = 0(i = j)$$ $$f[i][j] = min(max)\{f[i][k] + f[k + 1][j] + \sum_{k = i }^{j}a ......
题解 石子 P1880 1880 1995

P1941 [NOIP2014 提高组] 飞扬的小鸟 题解

我们先不管障碍物。 设 $f[i][j]$ 表示来到点 $(i,j)$ 的最少点击屏幕数。 因为每秒要不上升 $k\times x[i]$,要么下降 $y[i]$。 所以有: $$f[i][j] = min(f[i - 1][j + y[i]], f[i - 1][j - k \times x[i] ......
题解 小鸟 P1941 1941 NOIP

HDU4841 AHOI1999 圆桌问题 题解

朴素的约瑟夫问题,用vector处理即可 #include <iostream> #include <vector> using namespace std; //AHOI1999 圆桌问题 类似于约瑟夫问题 vector<int>table; int n, m; int main() { whil ......
题解 圆桌 问题 4841 1999

【题解】[HNOI2015] 落忆枫音

[题目传送门](https://www.luogu.com.cn/problem/P3244) 感觉这题挺有意思的,遂写。 ## 题目大意 给出一个有向无环图,再给定两个点 $s$ 和 $t$,表示在点 $s$ 和 $t$ 间加上一条边。求这个图有多少种生成树。 ## 题目分析 首先考虑不加边之前的 ......
题解 HNOI 2015