codeforces round 860 div

Codeforces Round 811 (Div. 3) A. Everyone Loves to Sleep

闹钟设有 \(n\) 个时间点,第 \(i\) 个时间为 \((H_i,M_i)\) 。在 \(h, m\) 时刻入睡,响铃必须起床,问能睡多久。 使用 \(set<pair<int, int>>\) 存储闹铃时刻,然后在其中 \(lower_{bound}\) 到 \(<first \geq h, ......
Codeforces Everyone Round Loves Sleep

Codeforces Round 815 (Div. 2) A. Burenka Plays with Fractions

给两个数 \(\frac{a}{b}\) 和 \(\frac{c}{d}\) ,一次修改可以修改 \(a\) 或 \(b\) 之一,求最小修改数使得 \(\frac{a}{b} = \frac{c}{d}\) 。 若 \(\frac{a}{b} = \frac{c}{d}\) ,除式化乘式,则讨论 ......
Codeforces Fractions Burenka Round Plays

Codeforces Round 819 (Div. 1 + Div. 2) and Grimoire of Code Annual Contest 2022 A. Mainak and Array

给一个长为 \(n\) 的正整数数组,执行以下操作严格一次。 选择 \(l, r, (1 \leq l < r \leq n)\) ,任意一个正整数 \(k\) 。 重复 \(k\) 次:让 \([l, r]\) 的数组成环,按顺时针走一次。 希望 \(a_n - a_1\) 最大,找到这个数。 分 ......
Codeforces Div and Grimoire Contest

SICTF2023 #Round 2 wp

Reverse [签到]PYC 电脑上的pycdc出问题了,就找个在线的 https://www.lddgo.net/string/pyc-compile-decompile print('SICTF{07e278e7-9d66-4d90-88fc-8bd61e490616}') Myobject ......
SICTF Round 2023 wp

Codeforces Round 830 (Div. 2) B. Ugu

给一个 \(01\) 字符串,需要使它变为非降的,可以执行以下操作: 选择一个下标 \(i, (1 \leq i \leq n)\) ,\(\forall j \geq i\) 的数位翻转。 经典的按无后效性翻转问题。 考虑从前往后,得到一个全 \(0\) 串。若开始存在 \(1\) ,则答案减 \ ......
Codeforces Round 830 Div Ugu

$Codeforces Round 891 (Div. 3)$

\(A. Array Coloring\) 显然需要奇数个偶数即可满足题目。 void solve(){ int n=read(),res=0; for(int i=1;i<=n;i++){ int x=read(); if(x%2)res++; } puts(res%2==0?"YES":"NO" ......
Codeforces Round 891 Div

$Codeforces Round 888 (Div. 3)$

\(A. Escalator Conversations\) 用 \(map\) 存楼梯的高度(差),对每个人看一下需要的楼梯高度是否存在。 int a[N]; void solve(){ int n=read(),m=read(),k=read(),h=read(); map<int,int>mp ......
Codeforces Round 888 Div

[EDISOI] Round 1 题解

写在前面的话 本场比赛难度估计大约可能是 \(\text{NOIp}\) 难度? 考场得分 \(100+100+100+0=300\) ,封榜时排名 \(\text{rank6}\) 。 T1 题目描述: 有一张地铁交通网 \(G\).\(G\) 拥有 \(n\) 个站点和 \(m\) 条地铁线路. ......
题解 EDISOI Round

Codeforces Round 821 (Div. 2) B. Rule of League

有 \(n\) 名选手参加一场比赛,编号为 \(1 \sim n\) 。规则为: 选手 \(1\) 和选手 \(2\) 比赛 第 \(1\) 轮胜者胜者与选手 \(3\) 比赛; 第 \(2\) 轮胜者与选手 \(4\) 比赛 \(\cdots\) 第 \(n - 2\) 轮胜者与选手 \(n\) ......
Codeforces League Round Rule 821

Codeforces Round 824 (Div. 2) B. Tea with Tangerines

有 \(n\) 块橘子皮,第 \(i\) 块大小为 \(a_i\) 。在一部操作中可以把一块橘子皮分成两块,即这块橘子皮为 \(x\) ,让 \(x\) 变为 \(y, z(x = y + z)\) 。 希望对于任意两块橘子皮,他们相差严格小于两倍。即两块中更小的为 \(x\) ,更大的为 \(y\ ......
Codeforces Tangerines Round with 824

【题解】Educational Codeforces Round 143(CF1795)

A.Two Towers 题目描述: 有 \(a,b\) 两座由红蓝色方块垒成的塔,其中 \(a\) 的高度为 \(n\) ; \(b\) 的高度为 \(m\) ,用 R 代表红色;用B代表蓝色。 你可以多次把其中一座顶端的方块移到另一座的顶端(可以不移动)。问有没有一种方法可以使两座塔中均没有连续 ......
题解 Educational Codeforces Round 1795

Codeforces Round 827 (Div. 4) C. Stripes

在一个 \(8 \times 8\) 的网格上,一开始无色。每次一整行或一整列地染色,后染的颜色会覆盖前染的颜色。 染色方式有两种,一种是横着染 \(R\) 色,一种是竖着染 \(B\) 色。给出最终染色的网格,问最后染的色是哪种。 对每行开 \(R\) 计数器、每列开 \(B\) 计数器。遍历行、 ......
Codeforces Stripes Round 827 Div

Codeforces Round 832 (Div. 2) B. BAN BAN

给一个正整数 \(n\) ,定义 \(S{n}\) 为字符串 \(BAN\) 复制 \(n\) 次。比如 \(S(3) = BANBANBAN\) 。可以对 \(S(n)\) 执行任意次以下操作: 选择 \(i, j (1 \leq i, j \leq 3n, i \neq j)\) 。\(swap ......
Codeforces BAN Round 832 Div

[题解] Codeforces Round 895 (Div. 3) F~G

Codeforces Round 895 (Div. 3) F~G F. Selling a Menageri 考虑如何让卖出的价格翻倍,那么自然是从 \(i \to a_i\) 。通过这样连边,我们可以发现,边集构成了基环树森林。显而易见的是,如果不考虑环,那么图就是拓扑图,按照拓扑关系跑一遍,就 ......
题解 Codeforces Round 895 Div

Codeforces Round 895 (Div. 3) 考试总结

前言 首先就是不太会打 CF,主要体现在晚上熬夜太难受,不过这场的状态还是挺好的。 然后就是时间把握不好,CCF 和模拟赛基本都是 \(3h\) 到 \(4h\),而 CF 只有 \(2h\) 左右。所以时间很紧,像这场,明明后面的题会做也没时间做了。 赛时实况: A B C D E F G √ √ ......
Codeforces Round 895 Div

SMU Autumn 2023 Round 1(Div.1)

SMU Autumn 2023 Round 1(Div.1) A. Set or Decrease(枚举) 题意就是你可以进行两种操作,将\(a_i-1\)或者令\(a_i\)等于\(a_j\),然后使得\(\sum\limits_{i=1}^{n}a_i \leq k\),求最少的操作步数 首先我 ......
Autumn Round 2023 SMU Div

Codeforces Round 895 (Div. 3)

# Codeforces Round 895 (Div. 3) [比赛链接](https://codeforces.com/contest/1872) ## A. Two Vessels [题目链接](https://codeforces.com/contest/1872/problem/A) 给你 ......
Codeforces Round 895 Div

CF1857 Div3全场题解

`2023-08-08 23:01:17` 2023.8.8 # 前言 $Div_3$ 太简单了,但是因为我太菜了想到了但来不及写最后一题,然后 F 题因为用 unordered_map 被卡哈希 hack T 了,最后结果出来只过了 $5$ 题,排到了 $rk1365$。 # A ## 题意: 给 ......
题解 全场 1857 Div3 Div

[LGR-152-Div2] 全场题解

`2023-08-22 16:15:06` # 前言 现在的比赛怎么都开始向 CF Div.2 的遍地结论题看齐了,感觉打下来 3 题都是结论题? # A 这么秒的题我一开始猜结论居然猜错了啊啊啊。 看了题目以后,毫无头绪,准备从部分分入手。 $p=2$?奇奇偶偶互配即可,找不出什么性质。 $p=3 ......
题解 全场 Div2 LGR 152

结营信心赛div1C题题解

简要题意: 对于一张$n$条边的无向完全图,每条边有两个权值$a_i,b_i$,求一棵最小生成树使其$\frac{\sum{a_i}}{\sum{b_i}}$最小。 这道题如果没见过这种技巧可能不好想,但我们也可以考虑一个朴素的想法,那就是猜! 我们猜这个答案是$ mid$,然后就可以推一下柿子。 ......
题解 信心 div1C div1 div

Codeforces Round 895 (Div. 3)

## B. The Corridor or There and Back Again >![image-20230908015323851](https://zeoy-typora.oss-cn-hangzhou.aliyuncs.com/image-20230908015323851.png) # ......
Codeforces Round 895 Div

895 DIV3 [A~F]

# 895 DIV3 **A.** ```C++ void solve() { int a,b,c; cin>>a>>b>>c; int t=abs(a-b); double tt=t*1.0/2.0/c; t=tt; if(t>n; int maxa=500; for(int i=1;i>d>>s ......
DIV3 895 DIV

$Codeforces Round 895 (Div. 3)$

## $A. Two Vessels$ 一开始我以为那个 $c$ 桶只能装满,看了好久。 范围内的任意容量都可以取的话,那么只要看需要转移多少量,然后看需要多少次。 ```cpp void solve(){ int n=read(),m=read(),k=read(); double nd=abs( ......
Codeforces Round 895 Div

$Educational Codeforces Round 138 (Rated for Div. 2)$

## $A. Cowardly Rooks$ 我模拟了一遍,因为我没看到题目中*给出的矩阵已经合法*, $a$ 题第一次写这么多。 实验室同事跟我说只要判断 $n$ 和 $m$ 的大小关系就行了。 ```cpp int x[N],y[N],m,n; bool check(){ for(int i=1 ......
Educational Codeforces Round Rated 138

Codeforces Round 798 (Div. 2) C (树形DP、思维、*1600)

[C. Infected Tree](https://codeforces.com/problemset/problem/1689/C "C. Infected Tree") > 题意:给定一棵树, 钦定 $ 1 $ 号点为根节点, 一开始根节点中毒了, 接下来的 $ n $ 个时刻, 每一时刻可以 ......
树形 Codeforces 思维 Round 1600

【题解】Educational Codeforces Round 144(CF1796)

被 C 卡了。 最后被 E 的各种分讨劝退,但是同时也学习到了一种换根 dp 的简单写法。 评价:It's educational for me. ## A.Typical Interview Problem ### 题目描述: 有一个包含 F 和 B 的字符串,最开始是空的。我们开始从 $1$ 向 ......
题解 Educational Codeforces Round 1796

The 16-th BIT Campus Programming Contest - Onsite Round

链接:[https://codeforces.com/gym/104025](https://codeforces.com/gym/104025) ## A. Gifts in box ```cpp #include "bits/stdc++.h" using namespace std; usin ......
Programming Contest Campus Onsite Round

# Codeforces Round 887 E Ina of the Mountain(反悔贪心)

~~被这个题折磨了好久,决定写一篇题解~~ 先考虑没有这个$k$的限制的情况,等价于对原来的$a_i$序列的差分数组$b_i$,每次找到两个位置$1\le x 0$的位置进行$-1$的操作,后面对应的$+1$可以放在$b_ic[i]$,那么$c[i]$减去$k$对答案的贡献就是$0$,因为$d[i] ......
Codeforces Mountain Round 887 Ina

app直播源码,js在div里让它在内容更新时自动滚到底部

app直播源码,js在div里让它在内容更新时自动滚到底部 <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="content-type" content="text/html; charset=utf-8" /></ ......
源码 内容 app div

CodeForces 960G Bandit Blues

[洛谷传送门](https://www.luogu.com.cn/problem/CF960G "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/960/G "CF 传送门") 发现设排列最大值位置为 $i$,那么 $[1, i] ......
CodeForces Bandit Blues 960G 960