1364B. Most socially-distanced subsequence
B. Most socially-distanced subsequence
Description
输入 T(≤2e4) 表示 T 组数据。所有数据的 n 之和 ≤1e5。
每组数据输入 n(2≤n≤1e5) 和一个 1~n 的排列 p。
650D. Zip-line
3181. Maximum Total Reward Using Operations II
3181. Maximum Total Reward Using Operations II
Description
You are given an integer array rewardValues
of length n
, representing the values of rewards.
3180. Maximum Total Reward Using Operations I
3180. Maximum Total Reward Using Operations I
Description
You are given an integer array rewardValues
of length n
, representing the values of rewards.
3179. Find the N-th Value After K Seconds
3178. Find the Child Who Has the Ball After K Seconds
3178. Find the Child Who Has the Ball After K Seconds
Description
You are given two positive integers n
and k
. There are n
children numbered from 0
to n - 1
standing in a queue in order from left to right.
3177. Find the Maximum Length of a Good Subsequence II
3177. Find the Maximum Length of a Good Subsequence II
Description
You are given an integer array nums
and a non-negative integer k
. A sequence of integers seq
is called good if there are at most k
indices i
in the range [0, seq.length - 2]
such that seq[i] != seq[i + 1]
.
3176. Find the Maximum Length of a Good Subsequence I
3176. Find the Maximum Length of a Good Subsequence I
Description
You are given an integer array nums
and a non-negative integer k
. A sequence of integers seq
is called good if there are at most k
indices i
in the range [0, seq.length - 2]
such that seq[i] != seq[i + 1]
.