
Codeforces
文章平均质量分 75
旺 崽
这个作者很懒,什么都没留下…
展开
-
Codeforces Beta Round #51 D. Beautiful numbers
题目链接Volodya is an odd boy and his taste is strange as well. It seems to him that a positive integer number is beautiful if and only if it is divisible by each of its nonzero digits. We will not argue with this and just count the quantity of beautiful numb原创 2021-05-14 10:01:05 · 1967 阅读 · 0 评论 -
Codeforces Round #717 (Div. 2) B. AGAGA XOOORRR
题目链接Baby Ehab is known for his love for a certain operation. He has an array a of length n, and he decided to keep doing the following operation on it:he picks 2 adjacent elements; he then removes them and places a single integer in their place: their bi原创 2021-04-22 19:11:55 · 2006 阅读 · 0 评论 -
Codeforces Round #717 (Div. 2) C. Baby Ehab Partitions Again
题目链接Baby Ehab was toying around with arrays. He has an array a of length n. He defines an array to be good if there’s no way to partition it into 2 subsequences such that the sum of the elements in the first is equal to the sum of the elements in the seco原创 2021-04-22 16:42:36 · 1979 阅读 · 2 评论 -
Educational Codeforces Round 98 (Rated for Div. 2) D. Radio Towers
Educational Codeforces Round 98 (Rated for Div. 2) D. Radio Towers题目链接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 probabilit原创 2020-12-17 22:19:05 · 2306 阅读 · 0 评论 -
Technocup 2020 - Elimination Round 1 C. Save the Nature
Technocup 2020 - Elimination Round 1 C. Save the Nature题目链接You are an environmental activist at heart but the reality is harsh and you are just a cashier in a cinema. But you can still do something!You have n tickets to sell. The price of the i-th tick原创 2020-12-17 20:59:57 · 2376 阅读 · 0 评论 -
Educational Codeforces Round 99 (Rated for Div. 2) D. Sequence and Swaps
Educational Codeforces Round 99 (Rated for Div. 2) D. Sequence and Swaps题目链接You are given a sequence a consisting of n integers a1,a2,…,an, and an integer x. Your task is to make the sequence a sorted (it is considered sorted if the condition a1≤a2≤a3≤⋯≤原创 2020-12-17 20:29:26 · 2279 阅读 · 0 评论 -
Codeforces 1250J The Parade
Codeforces 1250J The ParadeThe Berland Army is preparing for a large military parade. It is already decided that the soldiers participating in it will be divided into k rows, and all rows will contain the same number of soldiers.Of course, not every arra原创 2020-12-17 18:41:47 · 2333 阅读 · 0 评论 -
Codeforces Round #671 (Div. 2) D2. Sage‘s Birthday (hard version)
Codeforces Round #671 (Div. 2) D2. Sage’s Birthday (hard version)题目链接Today is Sage’s birthday, and she will go shopping to buy ice spheres. All n ice spheres are placed in a row and they are numbered from 1 to n from left to right. Each ice sphere has a原创 2020-10-09 16:27:58 · 2319 阅读 · 0 评论 -
Codeforces Round #670 (Div. 2) C. Link Cut Centroids
Codeforces Round #670 (Div. 2) C. Link Cut Centroids题目链接Fishing Prince loves trees, and he especially loves trees with only one centroid. The tree is a connected graph without cycles.A vertex is a centroid of a tree only when you cut this vertex (remov原创 2020-10-06 10:49:37 · 3303 阅读 · 2 评论 -
Codeforces Round #674 (Div. 3) F. Number of Subsequences
Codeforces Round #674 (Div. 3) F. Number of Subsequences题目链接You are given a string s consisting of lowercase Latin letters “a”, “b” and “c” and question marks “?”.Let the number of question marks in the string s be k. Let’s replace each question mark wi原创 2020-10-05 11:09:43 · 3297 阅读 · 0 评论 -
The 2019 China Collegiate Programming Contest Harbin Site F. Fixing Banners
The 2019 China Collegiate Programming Contest Harbin Site F. Fixing Banners题目链接Harbin, whose name was originally a Manchu word meaning “a place for drying fishing nets”, grew from a small rural settlement on the Songhua River to become one of the largest原创 2020-10-03 19:08:23 · 3531 阅读 · 0 评论 -
2019 China Collegiate Programming Contest Qinhuangdao Onsite F. Forest Program
2019 China Collegiate Programming Contest Qinhuangdao Onsite F. Forest Program题目链接The kingdom of Z is fighting against desertification these years since there are plenty of deserts in its wide and huge territory. The deserts are too arid to have rainfall原创 2020-10-03 17:07:45 · 2673 阅读 · 0 评论 -
Codeforces Round #674 (Div. 3) E. Rock, Paper, Scissors
Codeforces Round #674 (Div. 3) E. Rock, Paper, Scissors题目链接Alice and Bob have decided to play the game “Rock, Paper, Scissors”.The game consists of several rounds, each round is independent of each other. In each round, both players show one of the foll原创 2020-10-01 18:36:55 · 2531 阅读 · 0 评论 -
Codeforces Round #674 (Div. 3) C. Increase and Copy
Codeforces Round #674 (Div. 3) C. Increase and Copy题目链接Initially, you have the array a consisting of one element 1 (a=[1]).In one move, you can do one of the following things:Increase some (single) element of a by 1 (choose some i from 1 to the curr原创 2020-09-29 11:42:24 · 2552 阅读 · 0 评论 -
Codeforces Round #674 (Div. 3) D. Non-zero Segments
Codeforces Round #674 (Div. 3) D. Non-zero Segments题目链接Kolya got an integer array a1,a2,…,an. The array can contain both positive and negative integers, but Kolya doesn’t like 0, so the array doesn’t contain any zeros.Kolya doesn’t like that the sum of原创 2020-09-29 09:22:27 · 2574 阅读 · 0 评论 -
Codeforces Round #200 (Div. 1) C. Read Time
Codeforces Round #200 (Div. 1) C. Read Time题目链接Mad scientist Mike does not use slow hard disks. His modification of a hard drive has not one, but n different heads that can read data in parallel.When viewed from the side, Mike’s hard drive is an endless原创 2020-09-24 18:10:49 · 2465 阅读 · 0 评论 -
Codeforces Round #218 (Div. 2) C. Hamburgers
Codeforces Round #218 (Div. 2) C. Hamburgers题目链接Polycarpus loves hamburgers very much. He especially adores the hamburgers he makes with his own hands. Polycarpus thinks that there are only three decent ingredients to make hamburgers from: a bread, sausa原创 2020-09-23 19:33:00 · 2527 阅读 · 0 评论 -
Codeforces Round #510 (Div. 2) D. Petya and Array
Codeforces Round #510 (Div. 2) D. Petya and Array题目链接Petya has an array a consisting of n integers. He has learned partial sums recently, and now he can calculate the sum of elements on any segment of the array really fast. The segment is a non-empty seq原创 2020-09-16 16:52:14 · 2424 阅读 · 0 评论 -
Educational Codeforces Round 90 (Rated for Div. 2) C. Pluses and Minuses
Educational Codeforces Round 90 (Rated for Div. 2) C. Pluses and Minuses题目链接You are given a string s consisting only of characters + and -. You perform some process with this string. This process can be described by the following pseudocode:res = 0for原创 2020-09-13 12:28:02 · 2441 阅读 · 0 评论 -
Educational Codeforces Round 93 (Rated for Div. 2) C. Good Subarrays
Educational Codeforces Round 93 (Rated for Div. 2) C. Good Subarrays题目链接You are given an array a1,a2,…,an consisting of integers from 0 to 9. A subarray al,al+1,al+2,…,ar−1,ar is good if the sum of elements of this subarray is equal to the length of this原创 2020-09-11 21:31:46 · 2507 阅读 · 2 评论 -
Codeforces Round #665 (Div. 2) C. Mere Array
Codeforces Round #665 (Div. 2) C. Mere Array题目链接You are given an array a1,a2,…,an where all ai are integers and greater than 0.In one operation, you can choose two different indices i and j (1≤i,j≤n). If gcd(ai,aj) is equal to the minimum element of the原创 2020-09-05 15:38:06 · 2386 阅读 · 0 评论 -
Educational Codeforces Round 94 (Rated for Div. 2) C. Binary String Reconstruction
Educational Codeforces Round 94 (Rated for Div. 2) C. Binary String Reconstruction题目链接Consider the following process. You have a binary string (a string where each character is either 0 or 1) w of length n and an integer x. You build a new binary string原创 2020-09-04 19:24:15 · 2388 阅读 · 0 评论 -
Codeforces Round #666 (Div. 2) C. Multiples of Length
Codeforces Round #666 (Div. 2) C. Multiples of Length题目链接You are given an array a of n integers.You want to make all elements of a equal to zero by doing the following operation exactly three times:Select a segment, for each number in this segment we c原创 2020-09-02 21:00:04 · 2340 阅读 · 0 评论 -
Codeforces Round #662 (Div. 2) B. Applejack and Storages
Codeforces Round #662 (Div. 2) B. Applejack and Storages题目链接This year in Equestria was a year of plenty, so Applejack has decided to build some new apple storages. According to the advice of the farm designers, she chose to build two storages with non-ze原创 2020-08-08 10:38:38 · 2591 阅读 · 0 评论 -
Codeforces Round #661 (Div. 3) E1. Weights Division (easy version)
Codeforces Round #661 (Div. 3) E1. Weights Division (easy version)题目链接You are given a weighted rooted tree, vertex 1 is the root of this tree.A tree is a connected graph without cycles. A rooted tree has a special vertex called the root. A parent of a v原创 2020-08-07 14:49:22 · 2507 阅读 · 0 评论 -
Codeforces Round #661 (Div. 3) D. Binary String To Subsequences
Codeforces Round #661 (Div. 3) D. Binary String To Subsequences题目链接You are given a binary string s consisting of n zeros and ones.Your task is to divide the given string into the minimum number of subsequences in such a way that each character of the st原创 2020-08-07 14:41:37 · 2546 阅读 · 1 评论 -
Educational Codeforces Round 92 (Rated for Div. 2) C. Good String
Educational Codeforces Round 92 (Rated for Div. 2) C. Good String题目链接Let’s call left cyclic shift of some string t1t2t3…tn−1tn as string t2t3…tn−1tnt1.Analogically, let’s call right cyclic shift of string t as string tnt1t2t3…tn−1.Let’s say string t原创 2020-08-02 10:26:04 · 2652 阅读 · 0 评论 -
Codeforces Round #659 (Div. 1) A.String Transformation 1
Codeforces Round #659 (Div. 1) A.String Transformation 1题目链接Koa the Koala has two strings A and B of the same length n (|A|=|B|=n) consisting of the first 20 lowercase English alphabet letters (ie. from a to t).In one move Koa:selects some subset of po原创 2020-07-31 10:16:21 · 2491 阅读 · 0 评论 -
Codeforces Round #657 (Div. 2) A. Acacius and String
Codeforces Round #657 (Div. 2) A. Acacius and String题目链接Acacius is studying strings theory. Today he came with the following problem.You are given a string s of length n consisting of lowercase English letters and question marks. It is possible to repla原创 2020-07-24 10:46:31 · 2429 阅读 · 0 评论 -
Codeforces Round #653 (Div. 3) E1. Reading Books (easy version)
Codeforces Round #653 (Div. 3) E1. Reading Books (easy version)题目链接Easy and hard versions are actually different problems, so read statements of both problems completely and carefully.Summer vacation has started so Alice and Bob want to play and joy, bu原创 2020-07-24 10:34:16 · 2334 阅读 · 0 评论 -
Codeforces Round #658 (Div. 1) A2. Prefix Flip (Hard Version)
Codeforces Round #658 (Div. 1) A2. Prefix Flip (Hard Version)题目链接There are two binary strings a and b of length n (a binary string is a string consisting of symbols 0 and 1). In an operation, you select a prefix of a, and simultaneously invert the bits i原创 2020-07-23 09:56:23 · 2429 阅读 · 0 评论 -
Codeforces Round #257 (Div. 1) C. Jzzhu and Apples
Codeforces Round #257 (Div. 1) C. Jzzhu and Apples题目链接Jzzhu has picked n apples from his big apple tree. All the apples are numbered from 1 to n. Now he wants to sell them to an apple store.Jzzhu will pack his apples into groups and then sell them. Each原创 2020-07-22 10:56:01 · 2401 阅读 · 0 评论 -
Codeforces Beta Round #7 C. Line
Codeforces Beta Round #7 C. Line题目链接A line on the plane is described by an equation Ax + By + C = 0. You are to find any point on this line, whose coordinates are integer numbers from - 5·1018 to 5·1018 inclusive, or to find out that such points do not原创 2020-07-21 10:15:35 · 2377 阅读 · 0 评论 -
Codeforces Round #656 (Div. 3) D. a-Good String
Codeforces Round #656 (Div. 3) D. a-Good String题目链接You are given a string s[1…n] consisting of lowercase Latin letters. It is guaranteed that n=2k for some integer k≥0.The string s[1…n] is called c-good if at least one of the following three conditions原创 2020-07-20 10:01:10 · 2485 阅读 · 0 评论 -
Codeforces Round #653 (Div. 3) D. Zero Remainder Array
Codeforces Round #653 (Div. 3) D. Zero Remainder Array题目链接You are given an array a consisting of n positive integers.Initially, you have an integer x=0. During one move, you can do one of the following two operations:Choose exactly one i from 1 to n a原创 2020-06-30 09:34:34 · 2562 阅读 · 0 评论 -
Codeforces Round #651 (Div. 2) C. Number Game
Codeforces Round #651 (Div. 2) C. Number Game题目链接Ashishgup and FastestFinger play a game.They start with a number n and play in turns. In each turn, a player can make any one of the following moves:Divide n by any of its odd divisors greater than 1.S原创 2020-06-23 15:36:14 · 2473 阅读 · 0 评论 -
Codeforces Round #638 (Div. 2) D. Phoenix and Science
Codeforces Round #638 (Div. 2) D. Phoenix and Science题目链接Phoenix has decided to become a scientist! He is currently investigating the growth of bacteria.Initially, on day 1, there is one bacterium with mass 1.Every day, some number of bacteria will spl原创 2020-06-18 19:50:47 · 2358 阅读 · 0 评论 -
Codeforces Round #642 (Div. 3) E. K-periodic Garland
Codeforces Round #642 (Div. 3) E. K-periodic Garland题目链接You are given a garland consisting of n lamps. States of the lamps are represented by the string s of length n. The i-th character of the string si equals ‘0’ if the i-th lamp is turned off or ‘1’ i原创 2020-06-18 15:52:30 · 2342 阅读 · 0 评论 -
Codeforces Round #649 (Div. 2) C. Ehab and Prefix MEXs
Codeforces Round #649 (Div. 2) C. Ehab and Prefix MEXs题目链接Given an array a of length n, find another array, b, of length n such that:for each i (1≤i≤n) MEX({b1, b2, …, bi})=ai.The MEX of a set of integers is the smallest non-negative integer that doe原创 2020-06-18 10:47:45 · 2363 阅读 · 0 评论 -
Codeforces Round #650 (Div. 3) C. Social Distance
Codeforces Round #650 (Div. 3) C. Social Distance题目链接Polycarp and his friends want to visit a new restaurant. The restaurant has n tables arranged along a straight line. People are already sitting at some tables. The tables are numbered from 1 to n in th原创 2020-06-18 10:05:57 · 2530 阅读 · 0 评论