![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
CodeForces
文章平均质量分 94
zeng_jun_yv
title:
退役小曾
展开
-
Codeforces Round #719 (Div. 3)/ Codeforces Round #720 (Div. 2)
A. Do Not Be Distracted!题意:一件事情一但开始,只能做完才能做别的事,当出现一件事不连续出现时,教师会怀疑题目:Polycarp has 26 tasks. Each task is designated by a capital letter of the Latin alphabet.The teacher asked Polycarp to solve tasks in the following way: if Polycarp began to solve som原创 2021-05-12 22:02:07 · 540 阅读 · 0 评论 -
Division CodeForces - 1445C(数论因子相关)
题意:找一个最大的数X,使p%x==0且x%q!=0,题目保证至少有一个答案满足题意。题目:Oleg’s favorite subjects are History and Math, and his favorite branch of mathematics is division.To improve his division skills, Oleg came up with t pairs of integers pi and qi and for each pair decided to原创 2020-11-17 21:35:54 · 240 阅读 · 0 评论 -
Buying Shovels CodeForces - 1360D(数论+找因子)
题意:想买n个铲子,一共有k种包装,第i种包装里有i个铲子(1<=i<=k),问如何才能正好买n个铲子,要求买相同包装的,而且买的包书数最少题目:Polycarp wants to buy exactly n shovels. The shop sells packages with shovels. The store has k types of packages: the package of the i-th type consists of exactly i shovels (原创 2020-06-06 22:03:42 · 261 阅读 · 0 评论 -
Similar Pairs CodeForces - 1360C(图匹配+简单贪心)
题意:现有一个定义:(1)两个数的奇偶性相同(2)两个数的差的绝对值为1 ,即|a-b|=1满足以上两个条件之一,就可以说两个数是相似的先给你一个数组,让你将数组内分成多组,每组两个元素是否都相似。题目:We call two numbers x and y similar if they have the same parity (the same remainder when divided by 2), or if |x−y|=1. For example, in each of the原创 2020-06-06 21:52:26 · 358 阅读 · 0 评论 -
Honest Coach CodeForces - 1360B(简单贪心)
题目:题意:There are n athletes in front of you. Athletes are numbered from 1 to n from left to right. You know the strength of each athlete — the athlete number i has the strength si.You want to split all athletes into two teams. Each team must have at leas原创 2020-06-06 21:37:45 · 338 阅读 · 0 评论 -
Minimal Square CodeForces - 1360A(简单思维和图形判断)
题意:给你两个大小一样的,边长为a,b的矩形将其放入一个正方形里,问怎样放可以使正方形面积最小(要求正方形边和矩形边平行)题目:Find the minimum area of a square land on which you can place two identical rectangular a×b houses. The sides of the houses should be parallel to the sides of the desired square land.Forma原创 2020-06-06 20:51:44 · 368 阅读 · 0 评论 -
Sequence with Digits CodeForces - 1355A(暴力+数学)
题意:定义: an+1=an+minDigit(an)×maxDigit(an)。给定 a1 和 k,求 ak ?题目:Let’s define the following recurrence:an+1=an+minDigit(an)⋅maxDigit(an).Here minDigit(x) and maxDigit(x) are the minimal and maximal digits in the decimal representation of x without leading原创 2020-05-23 22:00:42 · 279 阅读 · 0 评论 -
K-periodic Garland CodeForces - 1353E(暴力+贪心+dp)
题意:给定长为 n 的 0, 1 字符串,你可以通过一次操作改变一个字符(0 变 1 or 1 变 0),问最少几次操作可以使任意相邻两个 1 之间的距离为 k ?题目: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-原创 2020-05-22 21:59:51 · 570 阅读 · 0 评论 -
Constructing the Array CodeForces - 1353D(数据结构+分类+建设性算法)
题意:有长度为 n 的数组 a ,全为 0,接下来循环 n 次,每次选出一段最长的连续区间 [l, r](全为 0 ,如果一样长,就选最左边的)。如果 r−l+1 是奇数,那么 a[l+r2]=ia[\frac{l+r}{2}]=ia[2l+r]=i;否则,a[l+r−12]=ia[\frac{l+r-1}{2}]=ia[2l+r−1]=i;(i 是第几轮循环)。输出最终的数组 a。题目:You are given an array a of length n consisting of z原创 2020-05-22 21:35:33 · 382 阅读 · 0 评论 -
Board Moves CodeForces - 1353C(数学)
题意:有一个 n×n 的矩阵(n 为奇数),每个矩阵单元有一个物品,每次操作你可将一个单元里的一个物品移动到该单元周围的八个单元里,问最后只有一个单元有物品的情况下,最少要多少次操作?题目:You are given a board of size n×n, where n is odd (not divisible by 2). Initially, each cell of the board contains one figure.In one move, you can select exa原创 2020-05-21 21:58:51 · 172 阅读 · 0 评论 -
Two Arrays And Swaps CodeForces - 1353B(贪心+分类)
题意:给定两个数组,你可以交换 k 次 两个数组的元素,问最后 a 数组的和最大可以是多少?题目:You are given two arrays a and b both consisting of n positive (greater than zero) integers. You are also given an integer k.In one move, you can choose two indices i and j (1≤i,j≤n) and swap ai and bj (原创 2020-05-21 21:50:59 · 355 阅读 · 0 评论 -
Most Unstable Array CodeForces - 1353A(数学+贪心+建设性算法)
题意:给定 n, m,构造出一个长度为 n 的数组 a,使得数组的和为 m,在此条件下∑i=1n−1∣ai−ai−1∣\sum_{i=1}^{n-1}|a_{i}−a_{i-1}|i=1∑n−1∣ai−ai−1∣ 最大是多少?题目:You are given two integers n and m. You have to construct the array a of length n consisting of non-negative integers (i.e. integers g原创 2020-05-21 21:44:48 · 376 阅读 · 0 评论 -
Dreamoon and Ranking Collection CodeForces - 1330A (贪心)
题意:大意就是给一个序列,可能有重复数字,有x次机会为这个序列填上一个数字,问最终从里面获得的1~v连续子序列的v最大是多少。题目:Dreamoon is a big fan of the Codeforces contests.One day, he claimed that he will collect all the places from 1 to 54 after two mo...原创 2020-04-06 20:18:08 · 351 阅读 · 0 评论