除法 整数 符号div

Codeforces Round 887 (Div. 2)

# [Codeforces Round 887 (Div. 2)](https://codeforces.com/contest/1853) ## [A. Desorting](https://codeforces.com/contest/1853/problem/A) ### 题目大意 给出一个长 ......
Codeforces Round 887 Div

Codeforces Round 885 (Div. 2)

# [Codeforces Round 885 (Div. 2)](https://codeforces.com/contest/1848) ## [A. Vika and Her Friends](https://codeforces.com/contest/1848/problem/A) ### ......
Codeforces Round 885 Div

Codeforces Round 885 (Div. 2)

# Codeforces Round 885 (Div. 2) ## A. Vika and Her Friends ​ 考虑 Vika 和其中一个朋友的距离,Vika 走一步,他们的距离要么加一要么减一;朋友也一样。那么每秒后他们的距离,要么不变,要么 ±2。那么与 Vika 距离为奇数的朋友,永 ......
Codeforces Round 885 Div

Codeforces Round 887 (Div. 2)

# Codeforces Round 887 (Div. 2) ## T1 ​ 如果已经是无序直接输出零,如果有序, 找到前后相差最小的两个数, 答案 $$ ans = \min\{a_{i+1}-a_i\}/2+1 $$ ## T2 ​ 给定 $n$ 和 $k$ ,问有多少单调不降且非负的斐波那契 ......
Codeforces Round 887 Div

Codeforces Round 887 (Div. 2) 题解

# A. Desorting 题目的核心操作就是选定一个位置 $i$,使得: - 对于所有 $j\le i$,$a_j\leftarrow a_j+1$ - 对于所有 $j>i$,$a_j\leftarrow a_j-1$ 这样一来,操作后 $a_{i+1}-a_i$ 的值就会 $-2$ 因为 $a ......
题解 Codeforces Round 887 Div

Educational Codeforces Round 152 (Rated for Div. 2) D. Array Painting

初始所有点都是蓝色的,给定一个数组,每个元素为0,1,2等值,两种操作,选定一个点花1元变红,或者选定一个为1或者2的红色点,减去一个价值,让周围的点变红,最后所有点都要变红 思路:贪心,对于一个数组来说我们找寻连续的不等于0的一段,判断每一段最多所能变红的 存在两种情况 010,这种情况花1可以最 ......
Educational Codeforces Painting Array Round

3-3 编写函数 expand(s1, s2),将字符串 s1 中类似于 a-z 一类的速记符号 在字符串 s2 中扩展为等价的完整列表 abc…xyz。该函数可以处理大小写字母和数字,并可 以处理 a-b-c、a-z0-9 与-a-z 等类似的情况

# Archlinux GCC 13.1.1 20230429 2023-08-01 17:03:12 星期二 点击查看代码 ``` #include void expand( const char *s1, char *s2 ) { int i, j, k; i = j = k = 0; whil ......
字符串 函数 字符 a-z 等价

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

题目大意为给定一个01字符串,给定m个区间,对于每个区间进行一次局部排序,求能得到的字符串种类数 解法:因为字符串只包含0,1两个字符,我们观察可以得到,对于不同的区间来说如果排序后一样则说明肯定是某些位置在排序过程中无贡献,因此我们只需找出有贡献的位置即可 对于一个区间[l,r],来说,如果进行排 ......
Educational Codeforces Copying Binary String

Educational Codeforces Round 152 (Rated for Div. 2) B. Monsters

题目大意为给定一个伤害k,n个怪物,hp为hp[i],每次都攻击hp最高的怪物,输出怪物的死亡顺序,如果攻击次数一样则按序号由小到大 解法:每次攻击都选最大的,假设hp=k*m+r,我们可以得到当进行m次攻击后,hp只有剩余数,再进行一次攻击怪物就会死亡,因此我们只需按余数由小到大排序即可,注意余0 ......
Educational Codeforces Monsters Round Rated

2.1.3 无符号整数的表示和运算

无符号整数,即“自然数”,0、1、2、3、4... ##无符号整数的表示 ![](https://img2023.cnblogs.com/blog/3177419/202308/3177419-20230801142900958-1410227920.png) ##无符号整数的加法运算 ![](ht ......
整数 符号

2023-08-01 v-html不识别换行↵符号 ==》 设置样式white-space: pre-line;

原本看到它不识别这个↵符号,我就打算把数据中的↵符号替换成<br >来看看能不能显示(a.rule.replace(/↵/g,'<br >');),结果还是不显示,之后我就设置了这个样式上去就可以显示换行了。 补充一下: 更多white-space可查看这篇文章👉http://t.csdn.cn/ ......
white-space 样式 符号 pre-line v-html

npm 版本符号含义

> ### 版本号符号的意义,在进行 npm install 后会根据依赖包版本的下载对应版本的包 ` ~ `会匹配最近的小版本依赖包,比如~1.2.3会匹配所有1.2.x版本,但是不包括1.3.0 ` ^ ` 会匹配最新的大版本依赖包,比如^1.2.3会匹配所有1.x.x的包,包括1.3.0,但是 ......
符号 含义 版本 npm

Codeforces Round 888 (Div. 3)

比赛链接:https://codeforces.com/contest/1851 ## A. Escalator Conversations 题意:一个扶梯,共m阶,n人站,每个台阶高k,Vlad身高H,Vlad任意站,问有多少人站在这个扶梯上正好和Vlad齐平 满足`abs(H - h[i]) % ......
Codeforces Round 888 Div

Codeforces Round 889 (Div. 2)

[TOC] ### 写在前面 我是飞舞。 ### A 随便做。 ### B 发现每一个长度为 $i$ 的区间中至少有 1 个 $i$ 的倍数,于是仅需检查能整除 $n$ 的最长的 $1\sim n$ 的前缀即可。 ### C1/C2 一个显然的想法是先让所有数同正/同负,再做前缀和/后缀和。 如果某 ......
Codeforces Round 889 Div

Codeforces Round 889 Div.2 A-F

前言:wssb ## [Dalton the Teacher](https://codeforces.com/contest/1855/problem/A) 题意:给定一个排列,每次可以交换两个元素,求使得 $\forall i\in[1,n],a_i\neq i$ 的最小操作数。 一次可以操作两个 ......
Codeforces Round 889 A-F Div

Codeforces Round 889 (Div. 1)

# Preface 由于一轮集训最后一周题目难度变大加上要写专题补专题导致欠了很多的博客没写,接下来慢慢把它们补上吧 ~~才不是因为天天溜会寝室看LPL呢,我发誓~~ 顺序的话就倒着来好了,先从最后的这场收尾的CF补起好了 这场其实刚开始就被A1,A2卡的很难受,大概1h左右过了之后一直在刚B,其实 ......
Codeforces Round 889 Div

Codeforces Round 888 (Div. 3) 补题

- 独立补了一道记忆化搜索的题,https://codeforces.com/contest/1851/problem/E 由于初次接触对于使用场景和注意事项都不是很熟悉,写加调估计得有3h。 # 本题的题面保证了本题是个无环图,允许dfs函数会有出口,存图不能用链式前向图,因为非常容易构造数据使得 ......
Codeforces Round 888 Div

Codeforces Round 887 (Div. 2)

[Codeforces Round 887 (Div. 2)](https://codeforces.com/contest/1853) ## [A. Desorting](https://codeforces.com/contest/1853/problem/A) ### 题目大意 给出一个长度为 ......
Codeforces Round 887 Div

div 的 placeholder

```js .editor { width: 100%; height: 100%; outline: none; border: 1px solid #cacdd4; border-radius: 5px; box-sizing: border-box; overflow-y: auto; pad ......
placeholder div

LC 7、整数反转

# LC 7、整数反转 ### 题目描述 这是LeetCode 上的 7、整数反转,难度为 ==简单== 给你一个 32 位的有符号整数 `x` ,返回将 `x` 中的数字部分反转后的结果。 如果反转后整数超过 32 位的有符号整数的范围 [−2^31,2^31−1] ,就返回 0。 假设环境不允许 ......
整数 LC

LC 8、字符串转换整数(atoi)

# LC 8、字符串转换整数(atoi) ### 题目描述 Leetcode上的 8、字符串转换整数(atoi),难度为 ==中等== 请你来实现一个 `myAtoi(string s)` 函数,使其能将字符串转换成一个 32 位有符号整数(类似 C/C++ 中的 atoi 函数)。 函数 `myA ......
整数 字符串 字符 atoi LC

Codeforces Round 888 (Div. 3)

# [传送门](https://codeforces.com/contest/1851) ### A Escalator Conversations 读懂题意即可 ``` /* Author : north_h File : A.cpp Time : 2023/7/26/12:32 _ _ _ _ ......
Codeforces Round 888 Div

Codeforces Round 889 (Div. 2)

# Codeforces Round 889 (Div. 2) A-D https://codeforces.com/contest/1855 打的太烂了,决心好好复盘 ## A. Dalton the Teacher ```CC #include using namespace std; void ......
Codeforces Round 889 Div

Codeforces Round 889 (Div. 2) C1 - C2

[Problem - C1 - Codeforces](https://codeforces.com/contest/1855/problem/C1) [Problem - C2 - Codeforces](https://codeforces.com/contest/1855/problem/C2 ......
Codeforces Round 889 Div C1

Codeforces #889 div2 B

### [B. Longest Divisors Interval](https://codeforces.com/contest/1855/problem/B) **做法:**假设我们找到了一个最大区间``[l, r]``,这个区间的长度为``k``,那么这个区间里有一个数必定是``k``的倍数( ......
Codeforces div2 889 div

Codeforces Round 889 (Div. 2) 题解

$6$ 题只做出来 $1$ 题,损失惨重 # A. Dalton the Teacher 显然,答案一定和最初的不满意人数有关,所以输入的时候统计一下 然后,将不满意的人的座位 **每两个人交换一次** 即可,交换次数就是答案 如果不满意人数是奇数,那么答案还要加 $1$ 时间复杂度 $O(n)$( ......
题解 Codeforces Round 889 Div

Codeforces Round 889 (Div. 1) 题解

# A1. Dual (Easy Version) https://codeforces.com/contest/1854/problem/A1 ## 题意 给定一个长度为 $n$ 的序列 $a_1, a_2, \dots, a_n$,你可以做以下操作: - 选定两个下标 $i, j(1 \leq ......
题解 Codeforces Round 889 Div

Round 889 Div.2 当小丑了。

太丢人了!D2D 狂吃 6 发罚时,D2C 都不会! D2A. 答案为 $\lceil \frac{\sum_{i=1}^n [a_i=i]}{2}\rceil$。 D2B. 我不会啊,猜了一下只需要枚举 $\le 2000$ 的,莫名其妙过了。 D2C1/C2. 不会。 D2D. 考虑动态维护前 ......
小丑 Round 889 Div

Codeforces Round 105 (Div. 2) - D. Bag of mice DP 或 记忆化搜索 求概率

# [D. Bag of mice](https://codeforces.com/contest/148/problem/D) ## 题意 待补充~ ## 思路 可利用 DP 或者记忆化搜索求解本问题,实际上这两个方法等价。 ## 代码 - 记忆化搜索 ```cpp //>>>Qiansui #i ......
概率 Codeforces 记忆 Round mice

Educational Codeforces Round 152 (Rated for Div. 2)

[传送阵](https://codeforces.com/contest/1849) ## [T1 Morning Sandwich](https://codeforces.com/contest/1849/problem/A) ### 题目大意 $t$ 个测试,每个测试给三个正整数 $b,c,h$ ......
Educational Codeforces Round Rated 152