educational codeforces together round

Round-Robin轮询调度法及其实现原理

轮询调度算法(Round-Robin Scheduling) 轮询调度算法的原理是每一次把来自用户的请求轮流分配给内部中的服务器,从1开始,直到N(内部服务器个数),然后重新开始循环。 算法的优点是其简洁性,它无需记录当前所有连接的状态,所以它是一种无状态调度。 轮询调度算法流程 假设有一组服务器N ......
Round-Robin 原理 Round Robin

Codeforces Round 875 (Div. 2)B-D

原题链接:https://codeforces.com/contest/1831 原文:https://www.cnblogs.com/edgrass/p/17440602.html (B) Array merging 主体思想是找到ab数组的最长相同字串(c中操作可实现连续) 1 #include ......
Codeforces Round 875 B-D Div

Educational Codeforces Round 149 (Rated for Div. 2)

# A. Grasshopper on a Line ```cpp #include using namespace std; #define int long long void solve(){ int x , k; cin >> x >> k; if( x % k == 0 ){ cout > ......
Educational Codeforces Round Rated 149

「闲话随笔」「DROI」Round 2

# 「闲话随笔」「DROI」Round 2 点击查看目录 > [TOC] 题挺好玩的。 ## [P9373 「DROI」Round 2 构造与取模](https://www.luogu.com.cn/problem/P9373) 发现 $k, n - k$ 即为一组正确构造,$k \ge n - k ......
随笔 Round DROI

Codeforces Round 875 (Div. 2) 题解 A ~ D

## [A](https://codeforces.com/contest/1831/problem/A). Twin Permutations ### 题目大意 题目给定一个 $1\sim n$ 的排列 $a$ ,现在想求一个排列 $b$, 使得对于 $i #include #include #d ......
题解 Codeforces Round 875 Div

Codeforces Round 875 (Div. 2) A-D

## A. Twin Permutations 题意:给出一个由[1,2,...,n]组成的数组a,构造另一个由[1,2,...,n]组成的数组b,使得a[1]+b[1]>n; for(int i=1;i>a[i]; } for(int i=1;i>n; for(int i=1;i>a[i]; fo ......
Codeforces Round 875 A-D Div

Codeforces Round 875 (Div

# Codeforces Round 875 (Div. 2) C-D题解 ### C [Problem - C - Codeforces](https://codeforces.com/contest/1831/problem/C) 我们发现题述所形成的父亲节点一定比子节点先画出,并且如果子节点顺 ......
Codeforces Round 875 Div

Codeforces Round 875 (Div. 2)

# Preface 难得现场打一次,这天下午打了三个半小时的校内赛,然后八点打了两小时ARC,最后再接上两个半小时的CF真是爽歪歪 不过有一说一其实很多时候都在坐牢,这场CF也差不多,一个小时写完ABCD然后开始坐牢,其实E基本想出来了但是没想到用随机赋值的方法来实现 不过由于这场手很稳因此排名极高 ......
Codeforces Round 875 Div

Codeforces Round 874 (Div. 3)

# A. Musical Puzzle ```cpp #include using namespace std; void solve(){ int n; string s; cin >> n >> s; set cnt; for( int i = 0 ; i + 1 > t; while( t - ......
Codeforces Round 874 Div

Codeforces Round 875 (Div. 2) A-D

# Codeforces Round 875 (Div. 2) ## A. Twin Permutations ```c++ int a[N]; void solve(){ int n=read(); for(int i=1;i0?"YES":"NO"); //puts(ans>0?"Yes":"N ......
Codeforces Round 875 A-D Div

CodeForces 1830D Mex Tree

[洛谷传送门](https://www.luogu.com.cn/problem/CF1830D "洛谷传送门") [CF 传送门](https://codeforces.com/contest/1830/problem/D "CF 传送门") 考虑答案的下界。 对整棵树进行二分图染色,我们得到答案 ......
CodeForces 1830D 1830 Tree Mex

CodeForces 1830C Hyperregular Bracket Strings

[洛谷传送门](https://www.luogu.com.cn/problem/CF1830C "洛谷传送门") [CF 传送门](https://codeforces.com/contest/1830/problem/C "CF 传送门") 每一步思路都非常自然的题。 考虑先从一些简单的 cas ......

Codeforces Round #875 (Div. 2)

# Codeforces Round #875 (Div. 2) [bilibili: Codeforces Round #875 (Div. 2) 实况 | 完成度 \[4.01 / 6\]](https://www.bilibili.com/video/BV1bo4y137he) ## A `` ......
Codeforces Round 875 Div

Codeforces Round 875 (Div. 2) A~D

# Codeforces Round 875 (Div. 2) A~D ### A. Twin Permutations 构造$a[i]+b[i]=n+1$ ```c++ void work() { int n; cin >> n; rep (i, 1, n) { int x; cin >> x; ......
Codeforces Round 875 Div

2023.5.28「DROI」Round 2 解题报告

# 「DROI」Round 2 ## 期望得分 T1 : $100$pts , T2 : $30$pts , T3:$10$pts , T4:$0$pts ## 实际得分 因为是 IOI 赛制,提交了就能看到分数,所以也是这个分数 ## 用时情况 T1 : $20$min , T2:$2.5$h , ......
报告 Round 2023 DROI 28

Educational Codeforces Round 149 (Rated for Div.2) 题解 A~D

## [A](https://codeforces.com/contest/1837/problem/A). Grasshopper on a Line ### 题目大意 给定两个整数 $x$ 和 $k$,我们需要规划一条路线,从 $(0,0)$ 走到 $(0, x)$,同时满足我们每次走的距离不能 ......
题解 Educational Codeforces Round Rated

Codeforces 1740I - Arranging Crystal Balls

(注:默认下标 1-indexed) 考虑一个数组被清零的充要条件:记 $b_i=a_{i}-a_{(i+n-2)\bmod n+1}$,那么最终 $a_i=0$ 当且仅当 $b_i=0$ 且 $a_1=0$。 思考一次操作的影响:假设我们对 $[x,x+k-1]$ 这段环上的区间进行了 $+v$, ......
Codeforces Arranging Crystal 1740I Balls

Educational Codeforces Round 149 (Rated for Div. 2)(A~F)

A. Grasshopper on a Line 题意:给出n,k,从0开始,每次可以加一个数,最快到达n需要,输出首先跳几次,然后每次跳多少,限制只有一个跳的长度不能整除k。 分析:n%k,有余直接跳,没余数,先跳一个,再跳剩余的长度。 代码: ``` #include #include #inc ......
Educational Codeforces Round Rated 149

Codeforces 1444E - Finding the Vertex

非常神秘的一道题,当之无愧的 *3500。 首先考虑转化题意。考虑一种决策树,由于我们每次问一条边之后,相当于会根据信息删掉两个连通块中的一个,因此一种决策树实际上对应了原树的一棵边分树。而为了让最坏情况下的询问次数最少,我们目标实际上是最小化边分树的深度。 考虑借鉴 [P5912 JAS](htt ......
Codeforces Finding Vertex 1444E 1444

Educational Codeforces Round 149 (Rated for Div. 2) 题解

https://codeforces.com/contest/1837 https://codeforces.com/contest/1837/problems 利益相关:上紫祭。 真的不要以为这道题放在 F 就不敢做。 压线过题的感觉真好。 ![image](https://img2023.cnb ......
题解 Educational Codeforces Round Rated

Educational Codeforces Round 149 (Rated for Div. 2)

# Preface 补题,本来这场想现场打的,但是玩**《Island》**玩的有点上头就没打了~~(逸一时,误一世~~ 然后今天发现2h30min就没啥难度的全写了,早知道昨天现场打给大号涨波分了 不过现场打以我的尿性也不知道会整出什么逆天操作,等下一个细节写挂心态一崩就开始坐牢~~(乐~~ # ......
Educational Codeforces Round Rated 149

CodeForces 1837F Editorial for Two

[洛谷传送门](https://www.luogu.com.cn/problem/CF1837F "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1837/F "CF 传送门") 这是一个常规 $\log^2$ 做法。 最大值最 ......
CodeForces Editorial 1837F 1837 for

Codeforces Round 874 (Div. 3)

Codeforces Round 874 (Div. 3) A - Musical Puzzle 思路:记录两个长度字符串的种数 #include<bits/stdc++.h> using namespace std; typedef pair<int,int>PII; typedef pair<s ......
Codeforces Round 874 Div

Educational Codeforces Round 149 (Rated for Div. 2)

Educational Codeforces Round 149 (Rated for Div. 2) A - Grasshopper on a Line 思路:只有两种情况,x整除k时为x-1和1,否则为x void solve() { int x, k; cin >> x >> k; if (x ......
Educational Codeforces Round Rated 149

Codeforces 1439E - Cheat and Win

模拟赛放了道 *3500,结果全场都切了,非常恐怖。 首先考虑怎么样的树是合法的,打个表发现 SG 函数值为 $\sum_{d}2^d·(\text{深度为 d 的点个数}\bmod 2)$,换句话说后手必胜当且仅当每种深度的点数都是偶数。 于是实际上我们只用建出虚树之后树上差分一下求出每个点被覆盖 ......
Codeforces 1439E Cheat 1439 and

UVA1514 Piece it together 题解

图论题还是在于建图 ## 题意 给定一个长度为 $n \times m$ 的网格图,有的地方是白方块,有的是黑方块,有的啥也没用。 给你如下四种 $L$ 形方块,询问是否存在方法,让这些方块正好就是给出的图的形状。 $ L $ 形方块如下 ![](https://cdn.luogu.com.cn/u ......
题解 together Piece 1514 UVA

【题解】Codeforces Round 737 (CF1557)

VP 情况: solve:4/5 rank:431st 评价: VP 了一下,我这个 shaber B 直接 5 发罚时,耽误了二十多分钟,以及被 D 各种细节差点搞死。 ## A.Ezzat and Two Subsequences(*800) ### 题目描述: 给定一个序列,将其分为 $2$ ......
题解 Codeforces Round 1557 737

Codeforces Round 837 (Div. 2) F. Hossam and Range Minimum Query

[传送门](https://codeforces.com/contest/1771/problem/F) 大致题意: ** 给一个n,然后给一个数组a, 有m个询问,询问区间[l, r]出现次数为奇数的最小值,若没有输出0, 每次输入的l,r需要异或上上一个答案,在第一个询问的时候认为上一个答案为0 ......
Codeforces Minimum Hossam Round Range

Educational Codeforces Round 143 (Rated for Div. 2) A-D

Educational Codeforces Round 143 (Rated for Div. 2) A. Two Towers void solve(){ int n=read(),m=read(); string s,t; cin>>s>>t; int ans=1; for(int i=0;i ......
Educational Codeforces Round Rated 143

「解题报告」LOJ561 「LibreOJ Round #9」CommonAnts 的调和数

模拟赛考的题,但是模拟赛没有打,哈哈,摆烂。 考场上想到大致做法了,没继续推,去打 GP of Tokyo 了。 首先发现操作都在查询前面,所以我们只需要预处理出答案即可。 我们先记 $b_i$ 表示对 $i$ 进行的操作的总和,那么容易写出 $a_i$ 的式子: $$ a_i = \sum_{j ......
CommonAnts LibreOJ 报告 Round LOJ