![](https://img-blog.csdnimg.cn/20200601170850914.jpg?x-oss-process=image/resize,m_fixed,h_224,w_224)
Codeforces 比赛题解
文章平均质量分 89
Codeforces比赛题解
繁凡さん
只想当个小透明,就图一乐^q^,希望可以做出一些微小的贡献(目前研究方向:自然语言处理、深度学习中的对抗攻击、元学习,欢迎大佬们来与我交流^0^)
展开
-
Educational Codeforces Round 114 (Rated for Div. 2) (A ~ F)全题解
A ~ F前四题过于简单()后两题有点要命()原创 2021-09-21 18:00:14 · 936 阅读 · 0 评论 -
解题报告(十八)数论题目泛做(Codeforces 难度:2000 ~ 3000 + )
解题报告(十八)Codeforces - 数学题目泛做(难度:2000 ~ 3000 + )原创 2021-06-14 22:54:33 · 3774 阅读 · 6 评论 -
Educational Codeforces Round 106 (Rated for Div. 2)(A ~ E)题解(每日训练 Day.16 )
整理的算法模板合集: ACM模板点我看算法全家桶系列!!!实际上是一个全新的精炼模板整合计划Educational Codeforces Round 106 (Rated for Div. 2)(A ~ D)A. Domino on WindowsillProblemSolution签到题…画个图算一下就好Code// Problem: A. Domino on Windowsill// Contest: Codeforces - Educational Codeforces R原创 2021-04-10 22:01:07 · 414 阅读 · 0 评论 -
Codeforces Round #696 (Div. 2) (A ~ E)超高质量题解(每日训练 Day.16 )
Codeforces Round #696 (Div. 2) (A ~ E)超高质量题解(每日训练 Day.16 )原创 2021-04-05 22:18:33 · 402 阅读 · 1 评论 -
Codeforces Round #712 Div.2(A ~ F) 超高质量题解(每日训练 Day.15 )
Codeforces Round #712 Div.2(A~F) 题解A. Déjà VuProblem给你一个字符串。问能否在该字符串里插入一个字母 a,使得它不是回文字符串。Solution显然不想让他变成回文字符串,那就破坏它成为回文字符串的条件,我们只能插入字符 a ,所以我们直接算一下该字符串前缀、后缀里各有有几个 a ,把我们能插入的 a 放到 a 多的地方即可。Code// Problem: A. Déjà Vu// Contest: Codeforces - Codefor原创 2021-04-04 22:07:16 · 772 阅读 · 6 评论 -
Codeforces 1499D - The Number of Pairs(数论 + 组合计数)
昨晚的cf没打,然后有人QQ问我D来着,正好在上毛概课可以划水就来口胡一波题解(原创 2021-03-19 10:17:23 · 515 阅读 · 5 评论 -
洛谷千题复习计划(一)(Codeforces + AtCoder)
整理的算法模板合集: ACM模板点我看算法全家桶系列!!!实际上是一个全新的精炼模板整合计划每天花一个小时简单复习一下我写过的洛谷的题目!虽然还没有到千题,但是快了(等我复习完这些以后我 luogu 刷的题目就够千题了hhh尽管因为太菜了写的都是水题呜呜呜红橙黄绿蓝紫黑[AT2271 黄]:思维,组合计数 若有奇数个人,一定有一个人左右差值为0否则不合法,从中间往两边拓展,一定均存在两个人的差值为 2,4,6,8…偶数没有为0的,往两边拓展一定为2,4,6,8,每个位置有两种选择,原创 2021-03-05 21:35:52 · 5737 阅读 · 15 评论 -
Codeforces Round #704 (Div. 2)(A ~ E)5题全 超高质量题解【每日亿题2 / 23】
Codeforces Round #704 (Div. 2)(A ~ E)5题全 超高质量题解【每日亿题2 / 23】原创 2021-02-24 00:27:25 · 1408 阅读 · 7 评论 -
Codeforces Round #703 (Div. 2)(A ~ F)超高质量题解【每日亿题2 / 19】
Codeforces Round #703 (Div. 2)(A、B、C、D、E、F)超高质量题解A. Shifting StacksB - Eastern ExhibitionC1 - Guessing the Greatest (easy version)C2 - Guessing the Greatest (hard version)D - Max MedianE - Paired PaymentF - Pairs of Paths原创 2021-02-19 01:39:53 · 3587 阅读 · 10 评论 -
Codeforces Round #701 (Div. 2) A ~ F ,6题全,超高质量良心题解【每日亿题】2021/2/13
Codeforces Round #701 (Div. 2) A ~ F ,6题全,超高质量良心题解【每日亿题】2021/2/13原创 2021-02-13 17:47:08 · 2689 阅读 · 4 评论 -
Codeforces Round #665 (Div. 2) Maximum Distributed Tree(树上贪心)
Codeforces Round #665 (Div. 2) Maximum Distributed Tree(树上贪心)原创 2021-02-05 22:02:20 · 222 阅读 · 1 评论 -
Codeforces Round #700 (Div. 2) D2 Painting the Array II(最通俗易懂的贪心策略讲解)看不懂来打我 ~
最通俗易懂的贪心策略讲解,保证听懂!看不懂你来打我 ~原创 2021-02-08 16:28:24 · 583 阅读 · 1 评论 -
Codeforces Round #700 (Div. 2) A ~ E ,6题全,超高质量良心题解【每日亿题】2021/2/8
Codeforces Round #700 (Div. 2) A ~ E ,超高质量良心题解【每日亿题】2021/2/8原创 2021-02-08 01:13:22 · 2952 阅读 · 9 评论 -
Codeforces Round #699 (Div. 2) (A ~ F)6题全,超高质量良心题解【每日亿题】2021/2/6
Codeforces Round #699 (Div. 2) (A、B、C、D、E)超高质量题解原创 2021-02-06 14:12:01 · 529 阅读 · 7 评论 -
Codeforces Round #699 (Div. 2) E.Sorting Books(贪心+DP / 线段树)超高质量题解,看不懂来打我 ~
整理的算法模板合集: ACM模板点我看算法全家桶系列!!!实际上是一个全新的精炼模板整合计划E - Sorting Books一排书架上有 nnn 本书排成一排,每本书上有一个颜色 aia_iai,你可以每次将一本书移动到书架的最右端,如果书架上的书,颜色相同的书都排到了一块,我们就认为他是漂亮的,请问将这个书架通过上面的那一种操作排成漂亮的书架,最少需要几次操作?Solution其实是超级简单的一道题 ~首先根据题意,先不考虑最优解,我们直接全部往右乱扔就一定能满足,但是不一定是最优原创 2021-02-06 14:08:36 · 814 阅读 · 2 评论 -
Codeforces Round #698 (Div. 2)(A ~ F)6题全,超高质量题解)【每日亿题】2021/2/4
整理的算法模板合集: ACM模板点我看算法全家桶系列!!!实际上是一个全新的精炼模板整合计划目录【每日亿题2/4】Codeforces Round #698 (Div. 2)(A ~ F)6题全,超高质量题解)A - Nezzar and Colorful BallsB - Nezzar and Lucky NumberC - Nezzar and Symmetric ArrayD - Nezzar and BoardE - Nezzar and Binary StringF - Nezzar原创 2021-02-04 22:25:43 · 474 阅读 · 1 评论 -
Codeforces Round #694 (Div. 1 + Div2)(A ~ H,8题全,超高质量题解)【每日亿题】2021/2/1、2/2
寒假每日训练2021/1/21每日亿题这套Div2 好简单呀,我写了不到两个小时就快AK了…原创 2021-02-02 00:24:30 · 1456 阅读 · 1 评论 -
CF498C Array and Operations(数论 + 最大流)
首先显然的是,如果一次操作中我们选择的v不是质数,那显然把它拆成若干次v是质数的操作更优(因为任何一个合数都可以拆成若干个质数的次方的乘积,唯一分解定理,这样拆成质数最后操作的次数会更多),那么问题就变成了:每次选取满足要求的一对数,同除一个质数,问能操作多少次。我们发现题目中还有一个重要的条件:ik+jki_k+j_kik+jk 为奇数,那么iki_kik 和 jkj_kjk 一定有一个是奇数,另一个是偶数,因此我们可以把数列中的元素按下标的奇偶分成两个集合。感觉有点像二分图了。最多的操作看上去.原创 2020-11-04 22:26:23 · 284 阅读 · 0 评论 -
CF 第二次周赛
A、CF1409D Decrease the Sum of Digits模拟进位,因为只有101810^{18}1018的数,也就是说最多只有18位,所以可以暴力模拟进位,我们从最后一位(最小位)开始,如果和大于S就进位,答案加上差,我们可以预处理一个 pow10 数组备用。#include<cstdio>#include<cmath>#include<algorithm>#include<iostream>#include<cstring原创 2020-11-01 20:44:10 · 249 阅读 · 0 评论 -
CF853 (Div.1) A Planning(贪心)
设时间安排为did_idi, 则总花费为∑i=1n(di−ti)⋅ci\sum_{i=1}^n{(d_i-t_i)\cdot{c_i}}i=1∑n(di−ti)⋅ci改变一下,即sumi=1ndi⋅ci−∑i=1nti⋅cisum_{i=1}^n{d_i\cdot{c_i}} - \sum_{i=1}^n{t_i\cdot c_i}sumi=1ndi⋅ci−i=1∑nti⋅ci∵ti⋅ci∵t_i\cdot c_i∵ti⋅ci不变∴di∴d_i∴di需.原创 2020-09-08 11:22:04 · 258 阅读 · 0 评论 -
CF1398D Colored Rectangles (记忆化搜索DP)
闫氏DP分析法用着是真的爽#include<cstdio>#include<algorithm>#include<iostream>using namespace std;const int N = 207;int f[N][N][N];int n, m;int a[N], b[N], c[N];int dfs(int i, int j, int k){ if(f[i][j][k])return f[i][j][k]; if(.原创 2020-09-07 15:59:31 · 288 阅读 · 1 评论 -
Educational Codeforces Round 93 (Rated for Div. 2) 题解
A、CF1398A Bad Triangle(模拟)排个序就好了#include<cstdio>#include<algorithm>#include<iostream>using namespace std;#define x first#define y secondtypedef pair<int, int> PII;const int N = 500007;int n, m, t;PII a[N];int main(){原创 2020-09-07 10:18:21 · 272 阅读 · 0 评论 -
Codeforces Round #661 (Div. 3)题解
Codeforces Round #661 (Div. 3)题解原创 2020-09-06 21:25:03 · 314 阅读 · 0 评论 -
Codeforces Round #665 (Div. 2) 题解( 小学奥数专场 )
目录A、Distance and Axis(简单高中数学应用题)B、Ternary Sequence(分类讨论)C、Mere Array(GCD的性质)D、Maximum Distributed Tree(树上贪心)E、Divide Square(计算几何)F、Reverse and Swap(线段树、实现 区间翻转, 区间交换)A、Distance and Axis(简单高中数学应用题)若k>nk>nk>n,那么直接将 AAA 点移动到 kkk 位置是最优的。否则我们设 BB原创 2020-08-30 00:17:54 · 396 阅读 · 0 评论 -
Codeforces Round #621题解
A、 Cow and HaybalesCow\ and\ HaybalesCow and Haybales贪心模拟题。#include<iostream>#include<iomanip>using namespace std;const int N = 51007, M = 5000007, INF = 0x3f3f3f3f;int n,m,k;int a[N];int t;int main(){ scanf原创 2020-07-24 21:26:33 · 245 阅读 · 1 评论 -
Codeforces Round #643 (Div. 2)题解
A Sequence with DigitsSequence\ with\ DigitsSequence with Digits原创 2020-07-22 18:45:48 · 415 阅读 · 1 评论 -
Codeforces Round #535 (Div. 3)题解
A. Two distinct pointsTwo\ distinct\ pointsTwo distinct points题目大意就是给出两个区间的左右边界,输出两个数,满足两个数分别在两个区间内且这两个数不相等。(左右边界不相等)大水题,直接判断一下两个边界是否相同,然后输出就行了。#include<cstdio>#include<algorithm>#include<iostream>#include<c原创 2020-07-10 23:29:24 · 259 阅读 · 0 评论 -
Codeforces Round 550 (Div.3) 题解
目录A. Diverse StringsA.\ Diverse\ StringsA. Diverse StringsB. Parity Alternated DeletionsB.\ Parity\ Alternated\ DeletionsB. Parity Alternated DeletionsC. Two Shuffled SequencesC.\ Two\ Shuffl原创 2020-05-31 12:09:16 · 1129 阅读 · 0 评论