- 博客(53)
- 收藏
- 关注
原创 Codeforces Round 954 (Div. 3) A B C D
Codeforces Round 954 (Div. 3) A B C D
2024-06-24 01:33:01 1154
原创 Codeforces Round 553 (Div. 2) D. Stas and the Queue at the Buffet
Codeforces Round 553 (Div. 2) D. Stas and the Queue at the Buffet
2024-06-21 09:55:13 819
原创 Educational Codeforces Round 51 (Rated for Div. 2) D. Bicolorings
Educational Codeforces Round 51 (Rated for Div. 2) D. Bicolorings
2024-06-19 11:21:29 952
原创 Codeforces Beta Round 33 (Codeforces format) B. String Problem
Codeforces Beta Round 33 (Codeforces format) B. String Problem
2024-06-18 23:35:23 667
原创 Canada Cup 2016 D. Contest Balloons
One tradition of ACM-ICPC contests is that a team gets a balloon for every solved problem. We assume that the submission time doesn’t matter and teams are sorted only by the number of balloons they have. It means that one’s place is equal to the number of
2024-06-16 00:30:00 971
原创 Codeforces Round 551 (Div. 2)C. Serval and Parenthesis Sequence
Serval soon said goodbye to Japari kindergarten, and began his life in Japari Primary School.In his favorite math class, the teacher taught him the following interesting definitions.A parenthesis sequence is a string, containing only characters “(” and “)”
2024-06-15 00:30:00 957
原创 Codeforces Global Round 18 C. Menorah
There are nnn candles on a Hanukkah menorah, and some of its candles are initially lit. We can describe which candles are lit with a binary string sss, where the iii-th candle is lit if and only if si=1s_i=1si=1.Initially, the candle lights are described
2024-06-14 14:11:19 406
原创 Codeforces Round 614 (Div. 1) B. Aroma‘s Search
With a new body, our idol Aroma White (or should we call her Kaori Minamiya?) begins to uncover her lost past through the OS space.The space can be considered a 2D plane, with an infinite number of data nodes, indexed from 000, with their coordinates defin
2024-06-13 12:08:12 809
原创 Educational Codeforces Round 33 D. Credit Card
Recenlty Luba got a credit card and started to use it. Let’s consider nnn consecutive days Luba uses the card.She starts with 000 money on her account.In the evening of iii-th day a transaction aia_iai occurs. If ai > 0a_i > 0ai > 0, then aia_iai bourle
2024-06-11 17:18:56 308
原创 VK Cup 2015 - Round 1 C. The Art of Dealing with ATM
ATMs of a well-known bank of a small country are arranged so that they can not give any amount of money requested by the user. Due to the limited size of the bill dispenser (the device that is directly giving money from an ATM) and some peculiarities of th
2024-06-10 23:51:17 909
原创 Codeforces Round 460 (Div. 2) D. Substring
You are given a graph with nnn nodes and mmm directed edges. One lowercase letter is assigned to each node. We define a path’s value as the number of the most frequently occurring letter. For example, if letters on a path are “abaca”, then the value of tha
2024-06-09 00:37:35 897
原创 Mail.Ru Cup 2018 Round 3 B. Divide Candies
Arkady and his friends love playing checkers on an n×nn \times nn×n field. The rows and the columns of the field are enumerated from 111 to nnn.The friends have recently won a championship, so Arkady wants to please them with some candies. Remembering an o
2024-06-08 20:02:44 748
原创 Codeforces Round 689 (Div. 2, based on Zed Code Competition) D. Divide and Summarize
Mike received an array aaa of length nnn as a birthday present and decided to test how pretty it is.An array would pass the iii-th prettiness test if there is a way to get an array with a sum of elements totaling sis_isi, using some number (possibly zero)
2024-06-07 14:56:25 838
原创 Codeforces Round 740 (Div. 2, based on VK Cup 2021 - Final (Engine)) D2. Up the Strip
108m109;
2024-06-06 13:30:18 626
原创 Codeforces Round 744 (Div. 3) E2. Array Optimization by Deque
In fact, the problems E1 and E2 do not have much in common. You should probably think of them as two separate problems.You are given an integer array a[1…n]=[a1,a2,…,an]a[1 \ldots n] = [a_1, a_2, \ldots, a_n]a[1…n]=[a1,a2,…,an].Let us consider an empty
2024-06-05 23:59:55 753
原创 Codeforces Round 950 (Div. 3) A B C D E
Vlad is planning to hold mmm rounds next month. Each round should contain one problem of difficulty levels ‘A’, ‘B’, ‘C’, ‘D’, ‘E’, ‘F’, and ‘G’.Vlad already has a bank of nnn problems, where the iii-th problem has a difficulty level of aia_iai. There may
2024-06-04 18:32:04 1454
原创 European Championship 2024 I. Disks
You are given nnn disks in the plane. The center of each disk has integer coordinates, and the radius of each disk is a positive integer. No two disks overlap in a region of positive area, but it is possible for disks to be tangent to each other.Your task
2024-06-04 11:42:23 966
原创 Helvetic Coding Contest 2017 B. Heidi and Library (medium)
Your search for Heidi is over – you finally found her at a library, dressed up as a human. In fact, she has spent so much time there that she now runs the place! Her job is to buy books and keep them at the library so that people can borrow and read them.
2024-06-03 17:44:21 952
原创 01-regression
/ 定义:由多段锯齿状的线段所组成的线⇒ 可以看作是一个常数,再加上一堆蓝色的 Function(Hard Sigmoid)
2024-06-03 14:39:54 1042
原创 Codeforces Round 548 (Div. 2) C. Edgy Trees
You are given a tree (a connected undirected graph without cycles) of nnn vertices. Each of the n−1n - 1n−1 edges of the tree is colored in either black or red.You are also given an integer kkk. Consider sequences of kkk vertices. Let’s call a sequence [a1
2024-06-02 09:48:50 1393
原创 CodeCraft-21 and Codeforces Round 711 (Div. 2) C. Planar Reflections
Gaurang has grown up in a mystical universe. He is faced by nnn consecutive 2D planes. He shoots a particle of decay age kkk at the planes.A particle can pass through a plane directly, however, every plane produces an identical copy of the particle going i
2024-06-01 18:57:56 911
原创 Educational Codeforces Round 127 D. Insert a Progression
You are given a sequence of nnn integers a1,a2,…,ana_1, a_2, \dots, a_na1,a2,…,an. You are also given xxx integers 1,2,…,x1, 2, \dots, x1,2,…,x.You are asked to insert each of the extra integers into the sequence aaa. Each integer can be inserted at the
2024-05-31 10:46:18 1324
原创 Educational Codeforces Round 72 C. The Number Of Good Substrings
You are given a binary string sss (recall that a string is binary if each character is either 000 or 111).Let f(t)f(t)f(t) be the decimal representation of integer ttt written in binary form (possibly with leading zeroes). For example f(011)=3,f(00101)=5,f
2024-05-30 16:42:49 722
原创 Codeforces Global Round 3 C. Crazy Diamond
You are given a permutation ppp of integers from 111 to nnn, where nnn is an even number.Your goal is to sort the permutation. To do so, you can perform zero or more operations of the following type:There is no need to minimize the number of operations, ho
2024-05-29 19:28:37 985
原创 Codeforces Round 439 (Div. 2) C. The Intriguing Obsession
With hands joined, go everywhere at a speed faster than our thoughts! This time, the Fire Sisters — Karen and Tsukihi — is heading for somewhere they’ve never reached — water-surrounded islands!There are three clusters of islands, conveniently coloured red
2024-05-28 15:50:25 1067
原创 Educational Codeforces Round 164 D. Colored Balls
There are balls of nnn different colors; the number of balls of the iii-th color is aia_iai.The balls can be combined into groups. Each group should contain at most 222 balls, and no more than 111 ball of each color.Consider all 2n2^n2n sets of colors. Fo
2024-05-27 15:54:25 853
原创 VK Cup 2015 - Round 2 E. Correcting Mistakes
Analyzing the mistakes people make while typing search queries is a complex and an interesting work. As there is no guaranteed way to determine what the user originally meant by typing some query, we have to use different sorts of heuristics.Polycarp neede
2024-05-26 12:00:00 985
原创 Educational Codeforces Round 42 D. Merge Equals
You are given an array of positive integers. While there are at least two equal elements, we will perform the following operation. We choose the smallest value xxx that occurs in the array 222 or more times. Take the first two occurrences of xxx in this ar
2024-05-25 10:16:08 259
原创 Codeforces Round 529 (Div. 3) D. Circular Dance
a211a224;a312a324;a411a425;
2024-05-24 10:57:35 319
原创 Codeforces Round 450 (Div. 2) C. Remove Extra One
You are given a permutation ppp of length nnn. Remove one element from permutation to make the number of records the maximum possible.We remind that in a sequence of numbers a1,a2,…,aka_1,a_2,\dots,a_ka1,a2,…,ak the element aia_iai is a record if for e
2024-05-23 16:56:05 1000
原创 Educational Codeforces Round 61 C. Painting the Fence
You have a long fence which consists of nnn sections. Unfortunately, it is not painted, so you decided to hire qqq painters to paint it. iii-th painter will paint all sections xxx such that li≤x≤ril_i \le x \le r_ili≤x≤ri.Unfortunately, you are on a tigh
2024-05-22 15:04:17 324
原创 Mail.Ru Cup 2018 Round 3 D. Decorate Apple Tree
There is one apple tree in Arkady’s garden. It can be represented as a set of junctions connected with branches so that there is only one way to reach any junctions from any other one using branches. The junctions are enumerated from 111 to nnn, the juncti
2024-05-18 22:18:53 811
原创 Codeforces Round 505 C. Plasticine zebra
Is there anything better than going to the zoo after a tiresome week at work? No wonder Grisha feels the same while spending the entire weekend accompanied by pretty striped zebras.Inspired by this adventure and an accidentally found plasticine pack (repre
2024-05-17 09:16:05 351
原创 Codeforces Round 474 C. Subsequence Counting
Pikachu had an array with him. He wrote down all the non-empty subsequences of the array on paper. Note that an array of size n has 2n−12^n-12n−1 non-empty subsequences in it.Pikachu being mischievous as he always is, removed all the subsequences in which
2024-05-16 22:35:34 335
原创 Educational Codeforces Round 161 (Rated for Div. 2) A B C
一条线段上有多个城市,每个城市有唯一的距离自己最近的一个城市,每个城市到达离自己最近的城市所需花费的金币个数是1,到达其他的城市所需花费的金币个数是|ai-aj|。组成三角形的条件是任意两边之和要大于第三边,那么不存在长度完全不相等的三条边组成三角形(两条较小的边之和不可能大于第三条边)。从城市x到城市y过程中不会折返,故分别从前往后和从后往前两个方向计算出从城市ai到城市aj可能会多被计算上的金币个数sum。有n根木棒,每根木棒的长度是2^ai,求出选择三根木棒使得他们可以组成三角形的方法的数量。
2024-01-19 15:53:43 398
原创 Codeforces Round 920 (Div. 3) A~D
贪心,首先将两个数组排序,对于某个数,如果要选择b数组中间的某个数,那么一定存在比bi大的数和比bi小的数,故从b数组两边选所得结果|ai-bi|一定最大。某人需要在n个时间点发短信,他的手机每一秒要消耗的电量是a,开关一次机消耗的电量是b,初始手机电量是f,判断他能否发完消息。给出两个只包含01的字符串a和b,求出将字符串a转换成字符串b所需要的最少次数,其中a中的1可以换位置,多余的1要去除。用pair存,按照a.ff排序,a[0].ss-a[1].ss即正方形的边长。
2024-01-16 17:33:57 454 1
原创 Codeforces Round 828 (Div. 3) A~E
因为x*y可以整除a*b,那么x*y可以整除a的因子*b的因子。故先将a的因子和b的因子两两组和相乘去重,因为要是ab的倍数,至少是ab,故tmp=ab/x,在a~c和b~d中分别找x和tmp的最小公倍数,找到即满足题意。rrrgg 循环遍历,两个g之间只记最远的那个r需要的秒数,其他r所需要的秒数一定小于该值(因为是顺序进行的)。给定a,b,c,d四个正整数(a<c和b<d),找出任意一对x和y,a<x<=c,b<y<=d且x*y能被a*b整除。两个操作,对给定字符串的奇数值上加x|偶数值上加x。
2024-01-11 17:04:08 381
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人