09 2021 档案

摘要:目录 Description State Input Output Solution Code Description 有一个单调栈,栈顶最大,记 \(b[i]\) 为 \(a[i]\) 放入栈中后,栈的大小,给出 \(m\) 个 \(b[i]\) ,构造一个 \(a\) 数组使得 \(b\) 数组 阅读全文
posted @ 2021-09-30 13:08 Bcoi 阅读(46) 评论(0) 推荐(0)
摘要:目录 Description State Input Output Solution Code Description 要求构造一个有 \(n\) 个节点的树,每个度数都有对应的价值,求最大价值 State \(1<=n<=10^4\) \(1<=a[i]<=10^9\) Input 4 5 1 4 阅读全文
posted @ 2021-09-30 10:32 Bcoi 阅读(61) 评论(0) 推荐(0)
摘要:目录 Description State Input Output Solution Code Description 有 \(n\) 个数,有两种操作 1.删除前面两个数,然后在前面插入这两个数的和 2.删除前面两个数,然后在前面插入这两个数的积 最后会剩下一个数,问 \(0\ 1\ ...\ 9 阅读全文
posted @ 2021-09-28 14:19 Bcoi 阅读(271) 评论(0) 推荐(0)
摘要:目录 Description State Input Output Solution Code Description 有 \(n\) 种卡片,每种卡片选一张,有 \(m\) 种选择是不可以被选的,输出卡片总和最大的选择 State \(1<=n<=10\) \(1<=ci<=2*10^5\) \( 阅读全文
posted @ 2021-09-25 12:48 Bcoi 阅读(64) 评论(0) 推荐(0)
摘要:目录 Description State Input Output Solution Code Description 有两个数组,必须在 \(A\) 数组中交换 \(k\) 次,求 \(\sum|a[i]-b[i]|\) 的最大值 State \(1<=n<=5*10^5\) \(10^{-8}< 阅读全文
posted @ 2021-09-24 11:47 Bcoi 阅读(55) 评论(0) 推荐(0)
摘要:目录 Description State Input Output Solution Code Description 有两个数组,数组 \(a\) 中的每个数都可以与 \(b\) 中的数相加,求这 \(mn\) 个数中有多少数为质数 State \(1<=n,m<=10^5\) \(1<=a[i] 阅读全文
posted @ 2021-09-24 10:50 Bcoi 阅读(54) 评论(0) 推荐(0)
摘要:目录 Description State Input Output Solution Code Description 有三种操作 $1\ l\ r: $ 区间查询和值 $2\ l\ r: $ 将区间上的每个数都减去其 \(lowbit\) $3\ l\ r: $ 将区间上的每个数都加上其 \(up 阅读全文
posted @ 2021-09-24 08:22 Bcoi 阅读(52) 评论(0) 推荐(0)
摘要:目录 Description State Input Output Solution Code Description 将所有属于 \([l,r]\) 上的数 \(x\) 变为 \(k\) 进制,每一个 \(x\) 都可以变为 \(1\) 位数,其花费为 \(\sum{a[i]*dis}\) ,\( 阅读全文
posted @ 2021-09-23 19:17 Bcoi 阅读(49) 评论(0) 推荐(0)
摘要:目录 Description State Input Output Solution Code Description \(f(x)=Ax^2g(x)+Bx^2+Cxg^2(x)+Dxg(x)\), 其中 \(g(x)\) 为 \(x\) 的数位之和,求 \(f(x)\) 的最小值(\(1<=x<= 阅读全文
posted @ 2021-09-23 09:57 Bcoi 阅读(57) 评论(0) 推荐(0)
摘要:目录 Description State Input Output Solution Code Description 有三种操作: \(1 \ x \ :\) 在队列尾部添加一个元素 \(x\) \(2\ :\) 删除队头元素,并输出 \(3\ :\) 将队列元素排序 State \(1<=n<= 阅读全文
posted @ 2021-09-23 08:40 Bcoi 阅读(76) 评论(0) 推荐(0)
摘要:目录 Description State Input Output Solution Code Description 有一个包含 \(+-\) 的字符串,其中 \(+\) 表示 \(1\),\(-\) 表示 \(-1\), 给出 \(m\) 个区间,求删掉最少的字符,区间和为零,其中 \(a[i] 阅读全文
posted @ 2021-09-23 08:09 Bcoi 阅读(95) 评论(0) 推荐(0)
摘要:目录 Description State Input Output Solution Code Description 有 \(n\) 个数,每个数可以加到答案当中,但是之后需要做减一操作,问经过 \(k\) 次操作之后,所获得的最大值是多少 State \(1<=n<=10^5\) \(1<=k< 阅读全文
posted @ 2021-09-21 20:42 Bcoi 阅读(127) 评论(0) 推荐(1)
摘要:目录 Description State Input Output Solution Code Description 有 \(n\) 个骑士,都有一个能力值 \(a[i]\), 有 \(m\) 个怪物,怪物有两个属性 \(x, y\) ,你可以花费 \(1\) 个金币使得任意一个骑士的能力值 \( 阅读全文
posted @ 2021-09-21 18:55 Bcoi 阅读(333) 评论(2) 推荐(0)
摘要:目录 Description State Input Output Solution Code Description 有 \(m\) 个区间,给出每个区间的和,构造一个 \(01\) 字串 State \(1<=n,m<=2*10^5\) \(1<=l<=r<=n\) \(1<=x<=r-l+1\ 阅读全文
posted @ 2021-09-20 22:33 Bcoi 阅读(86) 评论(0) 推荐(0)
摘要:目录 Description State Input Output Solution Code Description 有 \(n\) 本书,每一本书都有一本先导书,从 \(1\) 到 \(n\) 顺序阅读这些书,想要理解一本书,就必须将先导书看完,求阅读这 \(n\) 本书最少多少遍才可以完全理解 阅读全文
posted @ 2021-09-20 15:21 Bcoi 阅读(101) 评论(0) 推荐(0)
摘要:目录 Description State Input Output Solution Code Description 有 \(n\) 个小球,每个小球要放在对应的区间 \([l_i, r_i]\),问是否可以满足所有小球的条件 State \(1<=T<=2*10^5\) \(1<=N<=2*10 阅读全文
posted @ 2021-09-19 08:55 Bcoi 阅读(108) 评论(0) 推荐(0)
摘要:目录 Description State Input Output Solution Code Description 有 \(n\) 条纵向街道, \(m\) 条横向街道,\(k\) 个人在这些街道上,求有几对人相遇所走的路程大于其曼哈顿距离 State \(2<=n,m<=2*10^5\) \( 阅读全文
posted @ 2021-09-14 19:09 Bcoi 阅读(77) 评论(0) 推荐(1)
摘要:目录 Description State Input Output Solution Code Description 将一个数分解成多个数之和,使得这些数的乘积最大 State \(10<=n<=31000\) Input 13 Output 3 108 Solution 前置结论:将数 \(x\ 阅读全文
posted @ 2021-09-12 17:02 Bcoi 阅读(94) 评论(0) 推荐(0)
摘要:目录 Description State Input Output Solution Code Description 从一个长度为 \(n\) 的序列中,找到只出现一次的子序列,输出总个数 State \(1<=n<=2*10^{5}\) \(1<=a[i]<=n\) Input 12 1 2 3 阅读全文
posted @ 2021-09-11 09:05 Bcoi 阅读(163) 评论(0) 推荐(0)
摘要:目录 Description State Input Output Solution Code Description 要求构造一个长度为 \(n\) 的排列,已知排列中最长上升子序列为 \(k\) ,求字典序最小的排列方式 State \(1<=n,k<=2*10^{5}\) \(1<=a[i]< 阅读全文
posted @ 2021-09-10 16:19 Bcoi 阅读(133) 评论(0) 推荐(0)
摘要:目录 Description State Input Output Solution Code Description 计算 \(x^2-y=a\) ,其中 \(a\) 为任意平方数,\(1<=x,y<=n\), 输出答案有多少种 State \(1<=n<=10^{12}\) Input 10 1 阅读全文
posted @ 2021-09-10 14:17 Bcoi 阅读(89) 评论(0) 推荐(0)
摘要:目录 Description State Input Output Solution Code Description 有 \(n\) 个字符串,第 \(i\) 次操作,可以将这 \(n\) 个字符串的第 \(i\%|s|\) 个字符依次发送形成一个新的无限长字符串,在这个新字符串上找到最短区间包含 阅读全文
posted @ 2021-09-09 11:47 Bcoi 阅读(69) 评论(0) 推荐(0)
摘要:目录 Description State Input Output Solution Code Description 从 \(n\) 个数中找到两个数,使得 \(|a[i]+a[j]|\) 最小,若有多个最小值,\(i+j\) 最小优先(\(i!=j\)),输出这两个值 State \(1<=n< 阅读全文
posted @ 2021-09-09 10:02 Bcoi 阅读(41) 评论(0) 推荐(0)
摘要:目录 Description State Input Output Solution Code Description 有两种操作: \(1 \ L\ R\):对于每个数 \(a[i]=a[i]+lowbit(a[i])\) \(2 \ L\ R\):查询区间 \([L,R]\) 的值 State 阅读全文
posted @ 2021-09-08 16:35 Bcoi 阅读(89) 评论(0) 推荐(0)
摘要:目录 Description State Input Output Solution Code Description 有 \(n\) 个城市,\(m\) 条无向边,每条边都有一个权值 \(k\); 之后 \(Q\) 次强盗来袭,只有边权大于等于 \(x\) ,这条边才可以不受伤害,求每次强盗来袭可 阅读全文
posted @ 2021-09-08 08:24 Bcoi 阅读(139) 评论(0) 推荐(0)
摘要:目录 Description State Input Output Solution Code Description 由 \(n\) 行 \(01\) 串, 其中有 \(m\) 个区间 \([l,r]\) 内的字符为 \(1\); 如果两行之中有任意一个位置 \(x\), 都为 \(1\), 那么 阅读全文
posted @ 2021-09-03 19:45 Bcoi 阅读(60) 评论(0) 推荐(0)
摘要:目录 Description State Input Output Solution Code Description 有一棵树,计算 \(\sum_{i=1}^{n-1}\sum_{j=i+1}^{n}f(i,j)\), 其中 \(f(i,j)\) 代表 \(i,j\) 两个节点之间最短路径上的最 阅读全文
posted @ 2021-09-01 15:22 Bcoi 阅读(107) 评论(0) 推荐(0)