codeforces round 879 div
CodeForces Gym 102900B Mine Sweeper II
[CF 传送门](https://codeforces.com/gym/102900/problem/B "CF 传送门") 感觉像脑筋急转弯。 考虑所有数字之和就是相邻的 $(\text{雷}, \text{空地})$ 对数,因此翻转后这个对数不会改变。 然后由于抽屉原理,$b \to a$ 和 ......
CodeForces 1364D Ehab's Last Corollary
[洛谷传送门](https://www.luogu.com.cn/problem/CF1364D "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1364/D "CF 传送门") 简单题。 特判掉 $m = n - 1$ 的情况 ......
UESTC 2023 Summer Training #02 Div.2
# Preface 都给我丑完了这怎么办啊, 被血虐了苦路西 这场本来前面感觉都还可以,但是当中期看了眼C的题意后准备开C后就不对劲了起来 最后1h扔掉一直T的C题去做H,结果因为被卡自然溢出的Hash一直挂到比赛结束,直接红温 感觉这场策略问题挺大的,比如没有跟榜去写更加简单的E题(比赛的时候题目 ......
Codeforces Round #771 (Div. 2) A-E
# A ## 代码 ```c++ #include using namespace std; using ll = long long; int p[507]; bool solve() { int n; cin >> n; for (int i = 1;i > p[i]; int pos1 = 0 ......
CodeForces 1525F Goblins And Gnomes
[洛谷传送门](https://www.luogu.com.cn/problem/CF1525F "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1525/F "CF 传送门") 套路地,将 DAG 的最小不交路径覆盖转化为点数 ......
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 ......
JQuery 控制 Div 显示和隐藏
页面上有两个 Div 用 JQuery 控制 Div 显示和隐藏。实现Div间切换的需求 <div class="IndConK Huans overH" id="divExtTelList"> 11111111111111111111 <div> <div class="IndConB flex" ......
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 ......
div小窗的拖动
最近要做一个置顶聊天框的功能,想着要给他做成可以拖动的 一开始使用的是@mousedown+@mousemove+@mouseup来进行小窗口的拖动,但是出现拖动的时候小窗会闪烁,并且位置距离也不好把控,效果不好。然后借鉴了网上大神的帖子,使用v-drage和directives对div进行拖动 首 ......
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> # ......
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$ ......
Educational Codeforces Round 22
# A. The Contest 想一想就知道,提交的时间无所谓,所以我们选择全部做完后的第一个时间间隔提交即可 ```cpp #include using namespace std; #define int long long int read() { int x = 0, f = 1, ch ......
CodeForces 1847F The Boss's Identity
[洛谷传送门](https://www.luogu.com.cn/problem/CF1847F "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1847/F "CF 传送门") 我们首先观察 $a$ 的形态。令题面中给出的 $ ......
Codeforces Round 882 题解
## [Codeforces Round 882 (Div. 2)](https://codeforces.com/contest/1847 "Codeforces Round 882 (Div. 2)") ## [A. The Man who became a God](https://codef ......
Codeforces Round #883 (Div. 3) A-G
[比赛链接](https://codeforces.com/contest/1846) # A ## 代码 ```c++ #include using namespace std; using ll = long long; bool solve() { int n; cin >> n; int c ......
Codeforces Round 771 (Div.2) C
刚开始c题用dp做的,一直没做出来 ## B. Odd Swap Sort [Problem - B - Codeforces](https://codeforces.com/contest/1638/problem/B) ### 题意 给定一个序列$a$,如果$a_i$与$a_{i+1}$的和为奇 ......
CodeForces 997C Sky Full of Stars
[洛谷传送门](https://www.luogu.com.cn/problem/CF997C "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/997/C "CF 传送门") 考虑容斥,钦定 $i$ 行 $j$ 列放同一种颜色, ......
Codeforces Global Round 14
这场貌似很典很好啊。 ### A. Phoenix and Gold > 给定一个长度为 $ n $ 的数组 $ w $ 和一个数 $ x $,数组中的数**各不相同**,要求**重新排列**这个数组,使得对于每一个 $ i $ $ (1 \le i \le n) $,都有 $ \sum\limit ......
round 函数
# round 函数 要求**四舍五入**的情况,用round函数就很方便。 ## 一、用法 ### 1.基本用法 对于小数而言,round()函数**仅仅保留到整数位**,仅对小数点后一位进行四舍五入。 比如:round(1.5) = 2.000000,round(1.57) = 2.000000 ......
内置函数round
1 ''' 2 内置函数round对参数进行四舍五入/ 3 语法: round(number, ndigits) 4 其中,number是要进行四舍五入的数字,而ndigits是可选参数,表示保留小数的位数,默认为0。 5 number:要进行四舍五入的数字。 6 ndigits:保留小数的位数。如 ......
Codeforces Round 862 (div.2) C
vp时c题用自已的方法过了,赛后补下正解 ## C.Place for a Selfie [Problem - C - Codeforces](https://codeforces.com/contest/1805/problem/C) ### 题意 给定一些抛物线和过原点的直线,对于每个抛物线,是 ......
Codeforces Round 882 (Div. 2) A-D题解
[比赛地址](https://codeforces.com/contest/1847) ## A. The Man who became a God 题意:定义f(l,r)为区间[l,r]所有相邻数的差的绝对值的和,大小为1的区间的f为0,给出一个数组a,问把他分成m个区间,这m个区间的f值的和最小 ......
Codeforces 1593G Changing Brackets
考虑到括号变方向并不需要花费,所以并不用考虑左右括号,考虑小中括号就行了。 因为一个合法括号序列长度为偶数,则说明对于一对括号其左右括号位置奇偶肯定相反。 所以一个类型的括号在奇数位和在偶数位的数量之差就为需要改变类型的括号的数量。 这部分用前缀和维护即可。 时间复杂度 $O(\sum n + \s ......