
cf800--1200
文章平均质量分 86
800--1200
我不是手机
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Codeforces Round #693 (Div. 3) D. Even-Odd Game 简单博弈
During their New Year holidays, Alice and Bob play the following game using an array a of n integers:Players take turns, Alice moves first.Each turn a player chooses any element and removes it from the array.If Alice chooses even value, then she adds it原创 2021-01-06 21:17:28 · 414 阅读 · 0 评论 -
Codeforces Round #693 (Div. 3) C. Long Jumps
Polycarp found under the Christmas tree an array a of n elements and instructions for playing with it:At first, choose index i (1≤i≤n) — starting position in the array. Put the chip at the index i (on the value ai).While i≤n, add ai to your score and mov原创 2021-01-06 21:14:58 · 405 阅读 · 0 评论 -
Codeforces Round #693 (Div. 3) B. Fair Division 模拟
Alice and Bob received n candies from their parents. Each candy weighs either 1 gram or 2 grams. Now they want to divide all candies among themselves fairly so that the total weight of Alice’s candies is equal to the total weight of Bob’s candies.Check if原创 2021-01-06 21:07:49 · 253 阅读 · 0 评论 -
Codeforces Round #693 (Div. 3) A. Cards for Friends 模拟
or the New Year, Polycarp decided to send postcards to all his n friends. He wants to make postcards with his own hands. For this purpose, he has a sheet of paper of size w×h, which can be cut into pieces.Polycarp can cut any sheet of paper w×h that he ha原创 2021-01-06 21:01:36 · 206 阅读 · 0 评论 -
Good Bye 2020 D. 13th Labour of Heracles 贪心
You’ve probably heard about the twelve labors of Heracles, but do you have any idea about the thirteenth? It is commonly assumed it took him a dozen years to complete the twelve feats, so on average, a year to accomplish every one of them. As time flows fa原创 2021-01-01 09:44:35 · 344 阅读 · 0 评论 -
Good Bye 2020 C. Canine poetry 回文字符串
After his wife’s tragic death, Eurydice, Orpheus descended to the realm of death to see her. Reaching its gates was uneasy, but passing through them proved to be even more challenging. Mostly because of Cerberus, the three-headed hound of Hades.Orpheus, a原创 2021-01-01 09:34:41 · 317 阅读 · 0 评论 -
Good Bye 2020 B. Last minute enhancements 模拟
Athenaeus has just finished creating his latest musical composition and will present it tomorrow to the people of Athens. Unfortunately, the melody is rather dull and highly likely won’t be met with a warm reception.His song consists of n notes, which we原创 2021-01-01 09:32:43 · 2355 阅读 · 3 评论 -
Good Bye 2020 A. Bovine Dilemma 思维
Argus was charged with guarding Io, which is not an ordinary cow. Io is quite an explorer, and she wanders off rather frequently, making Argus’ life stressful. So the cowherd decided to construct an enclosed pasture for Io.There are n trees growing along原创 2021-01-01 09:30:05 · 195 阅读 · 0 评论 -
Codeforces Round #692 (Div. 2, based on Technocup 2021 Elimination Round 3) B. Fair Numbers 暴力
We call a positive integer number fair if it is divisible by each of its nonzero digits. For example, 102 is fair (because it is divisible by 1 and 2), but 282 is not, because it isn’t divisible by 8. Given a positive integer n. Find the minimum integer x,原创 2020-12-21 20:57:39 · 1262 阅读 · 4 评论 -
Codeforces Round #692 (Div. 2, based on Technocup 2021 Elimination Round 3) A. In-game Chat 模拟
You have been assigned to develop a filter for bad messages in the in-game chat. A message is a string S of length n, consisting of lowercase English letters and characters ‘)’. The message is bad if the number of characters ‘)’ at the end of the string st原创 2020-12-21 20:55:53 · 903 阅读 · 0 评论 -
Codeforces Round #691 (Div. 2) B. Move and Turn 数学
A robot is standing at the origin of the infinite two-dimensional plane. Each second the robot moves exactly 1 meter in one of the four cardinal directions: north, south, west, and east. For the first step the robot can choose any of the four directions, b原创 2020-12-21 20:54:13 · 176 阅读 · 0 评论 -
Codeforces Round #691 (Div. 2) A. Red-Blue Shuffle 简单模拟
There are n cards numbered 1,…,n. The card i has a red digit ri and a blue digit bi written on it.We arrange all n cards in random order from left to right, with all permutations of 1,…,n having the same probability. We then read all red digits on the car原创 2020-12-21 20:50:39 · 278 阅读 · 0 评论 -
Educational Codeforces Round 100 (Rated for Div. 2) B. Find The Array 奇怪构造
B. Find The Arraytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array [a1,a2,…,an] such that 1≤ai≤109. Let S be the sum of all elements of the array a.Let’s call an array b of n原创 2020-12-21 20:47:12 · 348 阅读 · 1 评论 -
Educational Codeforces Round 100 (Rated for Div. 2) A. Dungeon思维
You are playing a new computer game in which you have to fight monsters. In a dungeon you are trying to clear, you met three monsters; the first of them has a health points, the second has b health points, and the third has c.To kill the monsters, you can原创 2020-12-18 16:33:28 · 294 阅读 · 1 评论 -
Codeforces Round #690 (Div. 3) E2. Close Tuples (hard version) 卢卡斯组合数逆元
outputstandard outputThis is the hard version of this problem. The only difference between the easy and hard versions is the constraints on k and m. In this version of the problem, you need to output the answer by modulo 109+7.You are given a sequence a原创 2020-12-16 15:27:15 · 241 阅读 · 0 评论 -
Codeforces Round #690 (Div. 3) E1. Close Tuples (easy version)组合数公式
This is the easy version of this problem. The only difference between easy and hard versions is the constraints on k and m (in this version k=2 and m=3). Also, in this version of the problem, you DON’T NEED to output the answer by modulo.You are given a s原创 2020-12-16 11:36:16 · 477 阅读 · 0 评论 -
Codeforces Round #690 (Div. 3) D. Add to Neighbour and Remove 前缀和
outputstandard outputPolycarp was given an array of a[1…n] of n integers. He can perform the following operation with the array a no more than n times:Polycarp selects the index i and adds the value ai to one of his choice of its neighbors. More formally原创 2020-12-16 11:31:14 · 330 阅读 · 0 评论 -
Codeforces Round #690 (Div. 3) C. Unique Number 暴力打表
You are given a positive number x. Find the smallest positive integer number that has the sum of digits equal to x and all digits are distinct (unique).InputThe first line contains a single positive integer t (1≤t≤50) — the number of test cases in the te原创 2020-12-16 11:27:14 · 335 阅读 · 1 评论 -
Codeforces Round #690 (Div. 3) B. Last Year‘s Substring 思维
Polycarp has a string s[1…n] of length n consisting of decimal digits. Polycarp performs the following operation with the string s no more than once (i.e. he can perform operation 0 or 1 time):Polycarp selects two numbers i and j (1≤i≤j≤n) and removes cha原创 2020-12-16 11:26:09 · 430 阅读 · 2 评论 -
Codeforces Round #690 (Div. 3) A. Favorite Sequence 模拟
Polycarp has a favorite sequence a[1…n] consisting of n integers. He wrote it out on the whiteboard as follows:he wrote the number a1 to the left side (at the beginning of the whiteboard);he wrote the number a2 to the right side (at the end of the whiteb原创 2020-12-16 11:23:12 · 229 阅读 · 0 评论 -
Codeforces Global Round 12 B. Balls of Steel 曼哈顿距离
You have n distinct points (x1,y1),…,(xn,yn) on the plane and a non-negative integer parameter k. Each point is a microscopic steel ball and k is the attract power of a ball when it’s charged. The attract power is the same for all balls.In one operation,原创 2020-12-10 10:33:59 · 368 阅读 · 0 评论 -
Codeforces Global Round 12 A. Avoid Trygub 字典序
A string b is a subsequence of a string a if b can be obtained from a by deletion of several (possibly, zero or all) characters. For example, “xy” is a subsequence of “xzyw” and “xy”, but not “yx”.You are given a string a. Your task is to reorder the char原创 2020-12-10 10:32:18 · 264 阅读 · 0 评论 -
Codeforces Round #686 (Div. 3) D. Number into Sequence 唯一分解定理
You are given an integer n (n>1).Your task is to find a sequence of integers a1,a2,…,ak such that:each ai is strictly greater than 1;a1⋅a2⋅…⋅ak=n (i. e. the product of this sequence is n);ai+1 is divisible by ai for each i from 1 to k−1;k is the ma原创 2020-11-26 10:46:22 · 298 阅读 · 0 评论 -
Codeforces Round #686 (Div. 3) C. Sequence Transformation 模拟
You are given a sequence a, initially consisting of n integers.You want to transform this sequence so that all elements in it are equal (i. e. it contains several occurrences of the same element).To achieve this, you choose some integer x that occurs at原创 2020-11-26 10:44:00 · 241 阅读 · 0 评论 -
Codeforces Round #686 (Div. 3) B. Unique Bid Auction 排序
There is a game called “Unique Bid Auction”. You can read more about it here: https://en.wikipedia.org/wiki/Unique_bid_auction (though you don’t have to do it to solve this problem).Let’s simplify this game a bit. Formally, there are n participants, the i原创 2020-11-26 10:38:25 · 255 阅读 · 0 评论 -
Codeforces Round #686 (Div. 3) A. Special Permutation 简单构造
You are given one integer n (n>1).Recall that a permutation of length n is an array consisting of n distinct integers from 1 to n in arbitrary order. For example, [2,3,1,5,4] is a permutation of length 5, but [1,2,2] is not a permutation (2 appears twi原创 2020-11-26 10:36:39 · 237 阅读 · 0 评论 -
Codeforces Round #685 (Div. 2) D. Circle Game 简单博弈
Utkarsh is forced to play yet another one of Ashish’s games. The game progresses turn by turn and as usual, Ashish moves first.Consider the 2D plane. There is a token which is initially at (0,0). In one move a player must increase either the x coordinate原创 2020-11-22 13:28:31 · 420 阅读 · 1 评论 -
Codeforces Round #685 (Div. 2) C. String Equality 思维
Ashish has two strings a and b, each of length n, and an integer k. The strings only contain lowercase English letters.He wants to convert string a into string b by performing some (possibly zero) operations on a.In one move, he can eitherchoose an inde原创 2020-11-22 13:23:51 · 271 阅读 · 0 评论 -
Codeforces Round #685 (Div. 2) B. Non-Substring Subsequence 模拟
Hr0d1y has q queries on a binary string s of length n. A binary string is a string containing only characters ‘0’ and ‘1’.A query is described by a pair of integers li, ri (1≤li<ri≤n).For each query, he has to determine whether there exists a good sub原创 2020-11-22 13:21:33 · 334 阅读 · 0 评论 -
Codeforces Round #685 (Div. 2) A. Subtract or Divide 构造
Ridbit starts with an integer n.In one move, he can perform one of the following operations:divide n by one of its proper divisors, orsubtract 1 from n if n is greater than 1.A proper divisor is a divisor of a number, excluding itself. For example, 1,原创 2020-11-22 13:19:44 · 428 阅读 · 0 评论 -
Educational Codeforces Round 98 (Rated for Div. 2) D. Radio Towers fibs+快速幂逆元
There are n+2 towns located on a coordinate line, numbered from 0 to n+1. The i-th town is located at the point i.You build a radio tower in each of the towns 1,2,…,n with probability 12 (these events are independent). After that, you want to set the sign原创 2020-11-21 11:08:44 · 181 阅读 · 0 评论 -
Educational Codeforces Round 98 (Rated for Div. 2) C. Two Brackets
You are given a string s, consisting of brackets of two types: ‘(’, ‘)’, ‘[’ and ‘]’.A string is called a regular bracket sequence (RBS) if it’s of one of the following types:empty string;‘(’ + RBS + ‘)’;‘[’ + RBS + ‘]’;RBS + RBS.where plus is a conc原创 2020-11-21 11:06:55 · 139 阅读 · 0 评论 -
Educational Codeforces Round 98 (Rated for Div. 2) B. Toy Blocks 贪心
You are asked to watch your nephew who likes to play with toy blocks in a strange way.He has n boxes and the i-th box has ai blocks. His game consists of two steps:he chooses an arbitrary box i;he tries to move all blocks from the i-th box to other boxe原创 2020-11-21 11:05:43 · 269 阅读 · 0 评论 -
Educational Codeforces Round 98 (Rated for Div. 2) A. Robot Program
There is an infinite 2-dimensional grid. The robot stands in cell (0,0) and wants to reach cell (x,y). Here is a list of possible commands the robot can execute:move north from cell (i,j) to (i,j+1);move east from cell (i,j) to (i+1,j);move south from c原创 2020-11-21 11:02:51 · 307 阅读 · 0 评论 -
Codeforces Round #684 (Div. 2) C1. Binary Table (Easy Version) 模拟
This is the easy version of the problem. The difference between the versions is in the number of possible operations that can be made. You can make hacks if and only if you solved both versions of the problem.You are given a binary table of size n×m. This原创 2020-11-19 10:23:12 · 269 阅读 · 0 评论 -
Codeforces Round #684 (Div. 2) B. Sum of Medians
A median of an array of integers of length n is the number standing on the ⌈n2⌉ (rounding up) position in the non-decreasing ordering of its elements. Positions are numbered starting with 1. For example, a median of the array [2,6,4,1,3,5] is equal to 3. T原创 2020-11-19 10:21:07 · 333 阅读 · 0 评论 -
Codeforces Round #684 (Div. 2) A. Buy the String
You are given four integers n, c0, c1 and h and a binary string s of length n.A binary string is a string consisting of characters 0 and 1.You can change any character of the string s (the string should be still binary after the change). You should pay h原创 2020-11-19 10:19:45 · 174 阅读 · 0 评论 -
Codeforces Round #683 (Div. 2, by Meet IT) D. Catching Cheaters lcs问题
You are given two strings A and B representing essays of two students who are suspected cheaters. For any two strings C, D we define their similarity score S(C,D) as 4⋅LCS(C,D)−|C|−|D|, where LCS(C,D) denotes the length of the Longest Common Subsequence of原创 2020-11-16 15:02:43 · 278 阅读 · 0 评论 -
Codeforces Round #683 (Div. 2, by Meet IT)C. Knapsack 贪心
You have a knapsack with the capacity of W. There are also n items, the i-th one has weight wi.You want to put some of these items into the knapsack in such a way that their total weight C is at least half of its size, but (obviously) does not exceed it.原创 2020-11-16 14:35:35 · 187 阅读 · 0 评论 -
Codeforces Round #683 (Div. 2, by Meet IT) B. Numbers Box
You are given a rectangular grid with n rows and m columns. The cell located on the i-th row from the top and the j-th column from the left has a value aij written in it.You can perform the following operation any number of times (possibly zero):Choose a原创 2020-11-16 14:31:21 · 280 阅读 · 0 评论