自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(52)
  • 收藏
  • 关注

原创 Educational Codeforces Round 94 (Rated for Div. 2) E. Clear the Multiset

TitleCodeForces 1400 E. Clear the MultisetTime Limit2 secondsMemory Limit256 megabytesProblem DescriptionYou have a multiset containing several integers. Initially, it contains a1a_1a1​ elements equal to 111, a2a_2a2​ elements equal to 222, …, ana_n

2020-08-26 01:29:29 173

原创 Educational Codeforces Round 94 (Rated for Div. 2) D. Zigzags

TitleCodeForces 1400 D. ZigzagsTime Limit2 secondsMemory Limit256 megabytesProblem DescriptionYou are given an array a1,a2…ana_1, a_2 \dots a_na1​,a2​…an​. Calculate the number of tuples (i,j,k,l)(i, j, k, l)(i,j,k,l) such that:1≤i<j<k<l≤

2020-08-26 01:23:48 163

原创 Educational Codeforces Round 94 (Rated for Div. 2) C. Binary String Reconstruction

TitleCodeForces 1400 C. Binary String ReconstructionTime Limit2 secondsMemory Limit256 megabytesProblem DescriptionConsider the following process. You have a binary string (a string where each character is either 0 or 1) www of length nnn and an int

2020-08-26 01:12:44 145

原创 Educational Codeforces Round 94 (Rated for Div. 2) B. RPG Protagonist

TitleCodeForces 1400 B. RPG ProtagonistTime Limit2 secondsMemory Limit256 megabytesProblem DescriptionYou are playing one RPG from the 2010s. You are planning to raise your smithing skill, so you need as many resources as possible. So how to get res

2020-08-26 01:01:36 204

原创 Educational Codeforces Round 94 (Rated for Div. 2) A. String Similarity

TitleCodeForces 1400 A. String SimilarityTime Limit2 secondsMemory Limit256 megabytesProblem DescriptionA binary string is a string where each character is either 0 or 1. Two binary strings aaa and bbb of equal length are similar, if they have the s

2020-08-26 00:56:46 132

原创 Codeforces Round #665 (Div. 2)D. Maximum Distributed Tree

TitleCodeForces 1401 D. Maximum Distributed TreeTime Limit2 secondsMemory Limit256 megabytesProblem DescriptionYou are given a tree that consists of nnn nodes. You should label each of its n−1n-1n−1 edges with an integer in such way that satisfies t

2020-08-22 01:25:00 749

原创 Codeforces Round #665 (Div. 2) C. Mere Array

TitleCodeForces 1401 C. Mere ArrayTime Limit2 secondsMemory Limit256 megabytesProblem DescriptionYou are given an array a1,a2,…,ana_1, a_2, \dots, a_na1​,a2​,…,an​ where all aia_iai​ are integers and greater than 000.In one operation, you can choos

2020-08-22 01:23:10 295

原创 Codeforces Round #665 (Div. 2) B. Ternary Sequence

TitleCodeForces 1401 B. Ternary SequenceTime Limit2 secondsMemory Limit256 megabytesProblem DescriptionYou are given two sequences a1,a2,…,ana_1, a_2, \dots, a_na1​,a2​,…,an​ and b1,b2,…,bnb_1, b_2, \dots, b_nb1​,b2​,…,bn​. Each element of both sequ

2020-08-22 01:20:05 853 8

原创 Codeforces Round #665 (Div. 2) A. Distance and Axis

TitleCodeForces 1401 A. Distance and AxisTime Limit1 secondMemory Limit256 megabytesProblem DescriptionWe have a point AAA with coordinate x=nx = nx=n on OXOXOX-axis. We’d like to find an integer point BBB (also on OXOXOX-axis), such that the absolu

2020-08-22 01:16:20 213

原创 通信原理之考前突击

通信原理之考前突击第一章例题第一章#通信系统一般模型及其组成(当中各个组成部分的作用)各部分的作用如下:信源:把消息转换成原始的电信号,完成非电/电的转换。信宿:把复原的电信号转换成相应的消息。信源编码:进行模/数转换。信源解码:信源编码的逆过程信道编码:将数字信号变成合适于信道传输的码型。信道解码:信道编码的反变换。调制:把各种数字基带信号转换成适应于信道传输的数字频带信号。解调:调制的逆变换。信道:信号传输的通道(媒质)。信息量及香农公式多路复用(频分,时分,

2020-06-09 22:56:14 638

原创 Codeforces Round #643 (Div. 2)A-E个人题解

Codeforces Round #643 Div. 2A-E个人题解[A.Sequence with Digits](https://codeforces.com/contest/1355/problem/A)题面水题AC代码[B. Young Explorers](https://codeforces.com/contest/1355/problem/B)题面桶+贪心AC代码[C. Count Triangles](https://codeforces.com/contest/1355/problem/

2020-05-17 11:53:47 675

原创 2020/5/11 每日一咕

2020/5/11 每日一咕1.线段树优化dpProblem - 1216F - Codeforces (Unofficial mirror site by GGAutomaton, accelerated for Chinese users)You work as a system administrator in a dormitory, which has nnn rooms one after another along a straight hallway. Rooms are number

2020-05-11 22:19:51 258

原创 2020/5/10 每日一咕

2020/5/101.思维+STLProblem - 1277D - CodeforcesPolycarp has n different binary words. A word called binary if it contains only characters ‘0’ and ‘1’. For example, these words are binary: “0001”, “11”, “0” and “0011100”.Polycarp wants to offer his set of

2020-05-11 21:52:28 163

原创 Codeforces Round #639 (Div. 2) D. Monopole Magnets 思维+DFS

题面Problem - D - Codeforces (Unofficial mirror site by GGAutomaton, accelerated for Chinese users)A monopole magnet is a magnet that only has one pole, either north or south. They don’t actually exis...

2020-05-07 13:27:04 291

原创 概率论与数理统计之考前突击

概率公式条件概率 乘法定理P(B∣A)=P(AB)P(A)P(B|A)=\frac{P(AB)}{P(A)}P(B∣A)=P(A)P(AB)​P(Bˉ∣A)=1−P(B∣A)P(\bar{B}|A)=1-P(B|A)P(Bˉ∣A)=1−P(B∣A)若P(A)>0,则P(AB)=P(A)P(B∣A)若P(A)>0,则P(AB)=P(A)P(B|A)若P(A)>0,则P(A...

2020-05-05 15:29:21 1576 2

原创 2020/5/4/ 每日一咕

2020/5/4 来两道状压dp1.状压DP1434. 每个人戴不同帽子的方案数 - 力扣(LeetCode)总共有 nnn 个人和 404040 种不同的帽子,帽子编号从 111 到 404040 。给你一个整数列表的列表 hats ,其中 hats[i] 是第 i 个人所有喜欢帽子的列表。请你给每个人安排一顶他喜欢的帽子,确保每个人戴的帽子跟别人都不一样,并返回方案数。由于答案可能...

2020-05-04 10:33:12 196

原创 2020/5/1每日一咕

2020/5/11.字符串dpProblem - 1183H - Codeforces A subsequence is a string that can be derived from another string by deleting some or no symbols without changing the order of the remaining symbols. Cha...

2020-05-01 19:40:09 165

原创 2020/4/29 每日一咕

2020/4/291.二分Problem - 1251D - Codeforces题面You are the head of a large enterprise. n people work at you, and n is odd (i. e. n is not divisible by 2).You have to distribute salaries to your emplo...

2020-04-29 21:26:46 202

原创 Educational Codeforces Round 86 (Rated for Div. 2)个人A-D题解

A. Road To Zero给出x,y,a,b花a单位可以使x或y +1或-1花b单位可以使x和y +1或-12*a<=b时直接全部通过a否则通过b使一个降到0,再通过a(两种情况取小)B. Binary Period字符串的周期为对于所有1到|s|-k都有si==si+k的最小整数k。给出一个01串t求满足以下要求的串s1.01串2.长度不超过2*|t|3.t是s...

2020-04-27 10:58:20 162

原创 2020/4/26 每日一练

2020/4/26昨天摸了1.贪心+二分传送门给出一个长度为n的数组,元素%=m。一次操作可以选若干个数使他们变成(自身+1)%m。求最小操作使得数组非严格递增。贪心的想每个数在操作数范围内需要变得尽可能小,以使得后面的数递增比较容易。所以二分操作数,O(N)check。bool check(const int& mid, const vector<int>&amp...

2020-04-26 21:23:45 121

原创 2020/4/24 每日一练

2020/4/241.思维+组合数学传送门中文题目 不解释了 戳进去看就好了。朴素想法n*m*t 必超时想了很久没思路 开始推规律 发现和组合数相关奈何太菜 没想出来题解如下问题可以转化为以下模型:多次询问从点 (0,0) 出发,每个时刻可以选择将 x 坐标或 y 坐标增加 1 或不走动,时刻t走到点 (x,y)的方案数量。如果要在时刻t走到点(x,y),那么必定有x+y-1...

2020-04-24 23:00:02 140

原创 2020/4/23 每日一练

2020/4/231.树+思维传送门题意就是给出一棵树,带点权(-1e9<=vi<=1e9)。第一步先任选一个点,然后接下来选择的点满足这些条件1.它之前还没被选。2.它与一个被选的点直接相连。每选择一个点,与他直接相连的点和与与他直接相连的点直接相连的点的点权都+1。大概就是1连2,2连3,选择1,2和3点权都+1。求选完所有点的最大点权的最小可能值。分析后可以发现...

2020-04-23 17:09:38 129

原创 2020/4/22每日一练

2020/4/221.组合数学dp传送门定义一个数组为good,当且仅当它能够划分为若干个这样的子段(首元素等于区间长度-1 且 首元素>0)。求给出序列(长度1e3)中有多少个这样的子序列%mod。可能有点绕 上一下样例。输入41 1 1 1输出7包括任取两个,因为数组[1,1]中a[1]=区间长度-1=2-1=1以及全选,因为1 1 1 1可以划分为两个数组[1,1...

2020-04-22 22:02:55 126

原创 2020/4/21每日一练

2020/4/211.质因数分解 数学题传送门题意就是给出一个长度为n<=1e5的序列和一个k范围[2,100],元素范围[1,1e5]。求aiaj=pow(x,k) ,x是任意的。很容易想到用除过去map找,于是我就先预处理出每个数需要的最小数num,比如k=3时,2所需要的num就是4,因为24=8,num[12]是18因为12*18==pow(6,3)。这里我是用质因数分解和快...

2020-04-21 18:41:19 132

原创 2020/4/20每日一练

2020/4/201.思维+暴力传送门大意就是给一个长度为100的数字的串,找出其中能够被8整除的一个子序列。其实就是利用一个数能够被8整除后三位就可以被8整除的原理(因为1000的整数倍一定是8的倍数,同理还有4的是后两位)。所以三重循环枚举一下每一位,注意结果并不一定是三位,也有16,8这样的所以每重循环都要判断一下,代码如下。 string s; cin >>...

2020-04-20 19:24:25 191

原创 Codeforces Round #631 (Div. 2) D. Dreamoon Likes Sequences

题面传送门大概题意就是给出一个d和m。求满足以下条件的数组的数量模m。数组长度大于等于1数组所有元素大于等于1,小于等于d数组严格递增衍生数组( b1=a1, ∀i>1,bi=bi−1⊕ai)严格递增思路定义f(x)为x的下一位最小值打表可得f(1)=2,f(2)=f(3)=4,f(4)=f(5)=f(6)=f(7)=8…至于原因就是一个数若异或上自己最高也是1的那...

2020-04-04 18:33:21 153

原创 2019西安EC-final H-king (随机化+dp)

2019西安EC-final H-king (随机化+dp) 题目链接题面随机化算法正确性复杂度checkAC代码总结题目链接题面给出一个长度为n的序列,和一个小于1e9+7的质数。如果最长的模意义下的等比数列长度小于n/2则输出-1,否则则输出长度。随机化算法因为小于n/2的时候不用求出长度,而当长度大于n/2时,我们可以通过相邻两个数或者隔着一个数来计算q(通过逆元),再通过q出现的...

2020-01-12 19:53:40 752

原创 codeforces Lemonade Line

水题题面题意分析代码题面It’s a hot summer day out on the farm, and Farmer John is serving lemonade to his N cows! All N cows (conveniently numbered 1…N) like lemonade, but some of them like it more than others....

2019-03-12 15:58:07 241

原创 codeforces Team Tic Tac Toe

模拟水题题面题意分析代码题面Farmer John owns 26 cows, which by happenstance all have names starting with different letters of the alphabet, so Farmer John typically refers to each cow using her first initial – a ...

2019-03-12 15:51:13 282

原创 codeforces Out of Sorts

思维题题面题意分析代码题面outputstandard outputKeeping an eye on long term career possibilities beyond the farm, Bessie the cow has started learning algorithms from various on-line coding websites.Her favorite...

2019-03-12 15:47:54 253 1

原创 codeforces Snow Boots

dp题面题意题面It’s winter on the farm, and that means snow! There are N tiles on the path from the farmhouse to the barn, conveniently numbered 1…N, and tile i is covered in fi feet of snow.Farmer John s...

2019-03-12 15:38:06 163

原创 codeforces Teleportation

分类 水题题面题意分析代码题面One of the farming chores Farmer John dislikes the most is hauling around lots of cow manure. In order to streamline this process, he comes up with a brilliant invention: the manure t...

2019-03-12 15:07:31 261

原创 codeforces Rest Stops

贪心题面题意分析代码题面outputstandard outputFarmer John and his personal trainer Bessie are hiking up Mount Vancowver. For their purposes (and yours), the mountain can be represented as a long straight trail ...

2019-03-10 15:08:33 173

原创 codeforces Hoofball

模拟 dfs题面题意分析代码题面In preparation for the upcoming hoofball tournament, Farmer John is drilling his N cows (conveniently numbered 1…N, where 1≤N≤100) in passing the ball. The cows are all standing alon...

2019-03-10 14:54:37 346

原创 codeforces Taming the Herd

水题题面题意分析代码题面Early in the morning, Farmer John woke up to the sound of splintering wood. It was the cows, and they were breaking out of the barn again!Farmer John was sick and tired of the cows’ mor...

2019-03-10 14:43:13 354

原创 codeforces Mixing Milk

模拟 水题题面题意分析代码题面Farming is competitive business – particularly milk production. Farmer John figures that if he doesn’t innovate in his milk production methods, his dairy business could get creamed! F...

2019-03-10 14:16:21 288

原创 codeforces Convention

模拟 二分题面题意分析代码题面Cows from all over the world are arriving at the local airport to attend the convention and eat grass. Specifically, there are N cows arriving at the airport (1≤N≤105) and cow i arriv...

2019-03-10 14:08:06 383

原创 codeforces Back and Forth

dfs 模拟题面题意分析代码题面Farmer John has two milking barns, each of which has a large milk tank as well as a storage closet containing 10 buckets of various sizes. He likes to carry milk back and forth betwe...

2019-03-10 13:58:34 203

原创 codeforces Cowpatibility

map映射 + 二进制容斥题面题意分析代码题面It turns out there is one factor that matters far more than any other when determining whether two cows are compatible as potential friends: whether they like similar flavors ...

2019-03-10 13:44:56 189

原创 codeforces Mooyo Mooyo

挺有意思的题 双dfs题面题意分析代码题面With plenty of free time on their hands (or rather, hooves), the cows on Farmer John’s farm often pass the time by playing video games. One of their favorites is based on a popu...

2019-03-10 13:25:35 434

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除