OJ练习
文章平均质量分 82
Thexu323
这个作者很懒,什么都没留下…
展开
-
CF 1332B. Composite Coloring
A positive integer is called composite if it can be represented as a product of two positive integers, both greater than 1. For example, the following numbers are composite: 6, 4, 120, 27. The following numbers aren’t: 1, 2, 3, 17, 97.Alice is given a seq原创 2021-10-12 18:07:11 · 101 阅读 · 0 评论 -
CF 1438B. Valerii Against Everyone
You’re given an array b of length n. Let’s define another array a, also of length n, for which ai=2bi (1≤i≤n).Valerii says that every two non-intersecting subarrays of a have different sums of elements. You want to determine if he is wrong. More formally,原创 2021-10-02 15:33:53 · 119 阅读 · 0 评论 -
CF 1368B Codeforces Subsequences
Karl likes Codeforces and subsequences. He wants to find a string of lowercase English letters that contains at least k subsequences codeforces. Out of all possible strings, Karl wants to find a shortest one.Formally, a codeforces subsequence of a string原创 2021-10-02 14:17:48 · 209 阅读 · 0 评论 -
CF 1375C Element Extermination
You are given an array a of length n, which initially is a permutation of numbers from 1 to n. In one operation, you can choose an index i (1≤i<n) such that ai<ai+1, and remove either ai or ai+1 from the array (after the removal, the remaining parts原创 2021-09-29 23:19:26 · 104 阅读 · 0 评论 -
CF 1455B Jumps
You are standing on the OX-axis at point 0 and you want to move to an integer point x>0.You can make several jumps. Suppose you’re currently at point y (y may be negative) and jump for the k-th time. You can:either jump to the point y+kor jump to the原创 2021-09-26 16:43:39 · 100 阅读 · 0 评论 -
CF 1511B. GCD Length
You are given three integers a, b and c.Find two positive integers x and y (x>0, y>0) such that:the decimal representation of x without leading zeroes consists of a digits;the decimal representation of y without leading zeroes consists of b digits原创 2021-09-24 19:12:24 · 177 阅读 · 0 评论 -
CF 1381A1. Prefix Flip (Easy Version)
A1. Prefix Flip (Easy Version)time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThis is the easy version of the problem. The difference between the versions is the constraint on n and the required num原创 2021-09-24 15:19:11 · 91 阅读 · 0 评论 -
CF1430A Number of Apartments
Recently a new building with a new layout was constructed in Monocarp’s hometown. According to this new layout, the building consists of three types of apartments: three-room, five-room, and seven-room apartments. It’s also known that each room of each apa原创 2021-09-21 14:26:38 · 70 阅读 · 0 评论 -
CF 1401C
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 whole array a, you can swap ai and aj. gcd(x,y) d原创 2021-09-17 18:03:05 · 56 阅读 · 0 评论 -
CF 1474B Different Divisors
Positive integer x is called divisor of positive integer y, if y is divisible by x without remainder. For example, 1 is a divisor of 7 and 3 is not divisor of 8.We gave you an integer d and asked you to find the smallest positive integer a, such thata ha原创 2021-09-14 18:36:59 · 156 阅读 · 0 评论 -
CF 1348B Phoenix and Beauty
Phoenix loves beautiful arrays. An array is beautiful if all its subarrays of length k have the same sum. A subarray of an array is any sequence of consecutive elements.Phoenix currently has an array a of length n. He wants to insert some number of intege原创 2021-09-14 16:24:01 · 94 阅读 · 0 评论 -
CF 1370B GCD Compression
Ashish has an array a of consisting of 2n positive integers. He wants to compress a into an array b of size n−1. To do this, he first discards exactly 2 (any two) elements from a. He then performs the following operation until there are no elements left in原创 2021-09-12 14:40:27 · 94 阅读 · 0 评论 -
CF 766B Mahmoud and a Triangle
Mahmoud has n line segments, the i-th of them has length ai. Ehab challenged him to use exactly 3 line segments to form a non-degenerate triangle. Mahmoud doesn’t accept challenges unless he is sure he can win, so he asked you to tell him if he should acce原创 2021-09-12 14:01:03 · 193 阅读 · 0 评论 -
CF 1365B Trouble Sort
B. Trouble SortThese elements are represented by two integers ai — the value of the element and bi — the type of the element (there are only two possible types: 0 and 1). He wants to sort the elements in non-decreasing values of ai.He can perform the fol原创 2021-09-12 13:01:40 · 78 阅读 · 0 评论 -
CF 1490B Balanced Remainders
You are given a number n (divisible by 3) and an array a[1…n]. In one move, you can increase any of the array elements by one. Formally, you choose the index i (1≤i≤n) and replace ai with ai+1. You can choose the same index i multiple times for different m原创 2021-09-12 12:09:24 · 132 阅读 · 0 评论 -
CF 1352C
You are given two positive integers n and k. Print the k-th positive integer that is not divisible by n.For example, if n=3, and k=7, then all numbers that are not divisible by 3 are: 1,2,4,5,7,8,10,11,13…. The 7-th number among them is 10.InputThe firs原创 2021-08-31 20:13:54 · 129 阅读 · 0 评论