12 2024 档案
摘要:2024.12.29 周日 Q1. 1100 You are given a number in binary representation consisting of exactly bits, possibly, with leading zeroes. For example, for
阅读全文
摘要:2024.12.28 周六 Q1. 1100 You are given two integers . You need to find positive integers and such that the following conditions are sim
阅读全文
摘要:2024.12.27 周五 Q1. 1100 Alex is participating in the filming of another video of BrMeast, and BrMeast asked Alex to prepare 250 thousand tons of TNT, b
阅读全文
摘要:2024.12.26 周四 Q1. 1100 There is a ribbon divided into cells, numbered from to from left to right. Initially, an integer is written in
阅读全文
摘要:2024.12.25 周三 Q1. 1100 A subarray is a continuous part of array. Yarik recently found an array of elements and became very interested in findi
阅读全文
摘要:2024.12.24 周四 Q1. 1100 You are given an array of positive integers and a score. If your score is greater than or equal to , then you can
阅读全文
摘要:2024.12.23 周一 Q1. 1100 Alice and Bob are playing a game. They have an array . The game consists of two steps: First, Alice will r
阅读全文
摘要:2024.12.22 周日 Q1. 1100 You are playing a computer game. The current level of this game can be modeled as a straight line. Your character is in point $
阅读全文
摘要:2024.12.21 周六 Q1. 1000 Lottery "Three Sevens" was held for days. On day , people with the numbers particip
阅读全文
摘要:2024.12.20 周五 Q1. 1000 Ethan runs a vaccination station to help people combat the seasonal flu. He analyses the historical data in order to develop an
阅读全文
摘要:2024.12.19 周四 Q1. 1000 Consider a grid, where is an even integer. You may place the integers on the grid, using ea
阅读全文
摘要:2024.12.18 周三 Q1. 1000 You have an array of zeros of length . You can perform two types of operations on it: Choose an inde
阅读全文
摘要:2024.12.17 周二 Q1. 1000 Jonathan is fighting against minions. There are of them with strengths . Denote as the group
阅读全文
摘要:2024.12.16 周一 Q1. 1000 Monocarp is playing yet another computer game. And yet again, his character is killing some monsters. There are monsters, n
阅读全文
摘要:Codeforces Round 993 (Div. 4) 2024.12.15 rank289 +123:1381->1504 A Cube is given an integer . She wants to know how many ordered pairs of positive
阅读全文
摘要:2024.12.14 周六 Q1. 1000 You are given two strings and of equal length, consisting of only characters 0 and/or 1; both strings start with charac
阅读全文
摘要:2024.12.13 周五 Q1. 1000 Polycarp has a problem — his laptop keyboard is broken. Now, when he presses the 'b' key, it acts like an unusual backspace: it
阅读全文
摘要:2024.12.12 周四 Q1. 1000 You have an array of integers. You can no more than once apply the following operation: select three integers , ,
阅读全文
摘要:2024.12.11 周三 Q1. 1100 给定一长度为 的数组,你需要执行 次操作:每次选择一连续子数组(可为空),将和作为一元素放到到数组的任意位置。问最后数组和的最大值。 Q2. 1100 给你一长度为 的数组 , ~ 各出现2次。让你找出两个大小为
阅读全文
摘要:2024.12.10 周二 Q1. 1100 给你一个序列,你可以对这个序列中的每个数(0<=ai<100)进行拆分,使得最后整个序列单调不递减,询问是否有解。 Q2. 1200 给定一数组,可任意改变顺序,问是否可使a1%a2%a3%...%an!=0。 Q3. 1300 给定数组a,数字x,y。
阅读全文
摘要:牛客周赛 Round 69 2024.11.24 rank373 B long long格式化输入%d wa一发 C 空间反射 几何关系 D 爆搜 读错题意调一个小时 dfs/数位状压 爆搜每个子方案选不选,判断是否冲突,记录最优方案。 E 将一个数组分为3份,每份和相等且至少有一个正数。问方案数。
阅读全文
摘要:2024.12.9 周一 Q1. 1000 问是否可以用给定的n^2个数构造出已定n*n的矩阵。 Q2. 1200 给定2行n列数组,从(1,1)走到(2,n),只能向右/下走。你可以任意交换2列,问经过元素的和的最大值。 Q3. 1200 你有任意张面值为1,3,6,10,15的纸币。给定n,问凑
阅读全文
摘要:2024.12.8 周日 Q1. 1100 给定n,k。构造长度为n的数组,元素之和为k,且按位或和的值在二进制下1最多。 Q2. 1300 给定两行01串,从(1,1)走到(2,n),每次只能向右或向下走。问路径经过的最小字符串以及方案数。 Q3. 1200 将一个数组分为连续的k>1段,使每段的
阅读全文
摘要:2024.12.7 周六 Q1. 1000 给定01字符串,n,m,k。任意操作将区间长度为k的子串字符全变为1。问保证字符串任意区间没有长度大于等于m的子串字符全为0的最少操作次数。 Q2. 1300 有一个正 n 边形,给定x 个关键点,在关键点两两之间任意连互相不交叉的对角线,使得整个图形被划
阅读全文
摘要:Codeforces Round 991 (Div. 3) 2024.12.6 rank 1559 rating 1314->1381 A 模拟 B 给定一数组,你可以任意操作:a[i-1]+1&&a[i+1]-1 或者 a[i-1]-1&&a[i+1]+1。问是否可以使数组全为相同的数字。 C 给
阅读全文
摘要:牛客练习赛132 2024.11.29 rank137 A 在坐标轴1到n每个点有一根高度为a[i]的木棒,相邻2根木棒最高点相连同坐标轴会构成一个梯形/矩形,你可以多次交换不同相邻的木棒,问所有图形面积和的最大值。 B 有n(1e5)张牌和k(1e9)张任意牌,组成不超过m(1e9)的最大长度顺子
阅读全文
摘要:牛客小白月赛105 2024.11.22 C. 大力讨论,写了一个小时挂了4发,应该一开始想一个好写的方法再动键盘的(早点重写的)。 D. 并查集板题 E. Q.给定一括号序列,你可任意安排匹配的'()'由里向外删除顺序,问每对括号删除之前最多可以删除多少对括号。 括号匹配+反向答案:res[i]=
阅读全文
摘要:2024.12.5 周四 Q1. 1000 给定x2~xn(<=500),构造a1~an,满足i:2~n,x[i]==a[i]%a[i-1]。 Q2. 1200 n户人家在一条线上,现在在某两户i,i+1之间/两端修建一条公路,给定一01串:0代表希望在公路左边,1则相反。 要求两侧都要有至少一半人
阅读全文
摘要:数据结构实验一 2024.12.5 采用递增有序的顺序表表示集合,求解两个集合的交集、并集和差集 (1)定义顺序表的存储结构; (2)实现存储递增有序集合的顺序表的建立、求交集、并集和差集等运算; (3)要求算法的时间性能在线性时间复杂度内; (4)和采用无序顺序表所表示的集合的有关运算的时间性能进
阅读全文
摘要:2024.12.4 周三 Q1. 1000 给定01串,操作:选择l,r,将s[r]放到s[l]前:s[l]s[l+1]...s[r-1]s[r]->s[r]s[l]s[l+1]...s[r-1],代价为r-l+1/区间长度。 问最小代价将01串由小到大排序。 Q2. 1300 给定2行'<''>'
阅读全文
摘要:2024.12.3 周二 Q1. 1100 给定两个长度为n和n+1的数组a,b。每次操作:选择a的任意一个数 +1/-1/复制到末尾。 问将a变成b的最小操作次数。 Q2. 1200 设定一个数组是美丽的:当其可以通过任意次操作将数组里的数变成同一个数字,操作:如果a[i-1]==a[i+1],则
阅读全文
摘要:2024.12.2 周一 Q1. 1100 给定一个数字(32位以内),使用1,0,-1构造二进制数位,同时保证不能有相邻的非0数存在。 Q2. 1200 给定2个相同数位的数(<=1e100),任意操作:交换2数中相同位的数字使两数之积最大。 Q3. 1300 前缀后缀板题 Q4. 1400 给定
阅读全文
摘要:2024.12.1 周日 Q1. 1000 对于字符串p,对定义f(p):p的所有连续子串中去重后的数量。 给定字符串s,问其是否存在一个子串t满足f(t)为偶数。 Q2. 1200 给定一数组,操作:选择一区间[l,r],将此区间的所有数变成所有数的中位数。 问最终数组变成相同数的最大值。 Q3.
阅读全文