菜狗补题
文章平均质量分 68
sea and star
菜狗
展开
-
AcWing-3493(思维+双指针)
题目传送门 最大的和 题目描述: 给定一个长度为 n 的正整数数列 a1,a2,…,an。 初始时,数列中的每个元素要么处于可选状态,要么处于不可选状态。 你可以选择一个长度恰好为 k 的区间 [i,i+k−1],使得 ai∼ai+k−1 这 k 个元素的状态全部变为可选。 请问,在经过此操作后,所有处于可选状态的元素之和最大是多少。 输入格式 第一行包含两个整数 n 和 k。 第二行包含 n 个整数 ai。 第三行包含一个长度为 n 的 01 序列,如果第 i 个数为 1,表示 ai 的初始状态为可选,如原创 2021-05-15 00:54:22 · 74 阅读 · 1 评论 -
CodeForces - 804B Minimum number of steps(思维)
Minimum number of steps https://vjudge.net/problem/CodeForces-804B) We have a string of letters ‘a’ and ‘b’. We want to perform some operations on it. On each step we choose one of substrings “ab” in the string and replace it with the string “bba”. If we h转载 2020-11-24 12:15:27 · 125 阅读 · 0 评论 -
菜狗补题
CodeForce #题目 Mr. Funt now lives in a country with a very specific tax laws. The total income of mr. Funt during this year is equal to n (n ≥ 2) burles and the amount of tax he has to pay is calculated as the maximum divisor of n (not equal to n, of course原创 2020-10-26 12:33:22 · 111 阅读 · 0 评论