摘要: Problem link->https://www.luogu.com.cn/problem/P8251。 Solution 这道题我考场上最后 $10$ 分钟想出正解,然而在考试完后的 $10$ 分钟才打出代码。。。 可以发现,无论什么情况,下标大的二元组总是在下标小的二元组的上面,也就是说,如果 阅读全文
posted @ 2022-08-01 14:12 lsj2009 阅读(30) 评论(0) 推荐(0)
摘要: Problem 给定序列 ${a_n}$,找出一个数对 $(i,j)$ 满足 $i,j\le n$ 且对于任意一个 $1\le k\le n$ 的 $k$ 有 $|a_i-a_k|+|a_k-a_j|=|a_i-a_j|$。如有多解,输出任意一个即可。 link->https://codeforce 阅读全文
posted @ 2022-08-01 14:09 lsj2009 阅读(40) 评论(0) 推荐(0)
摘要: Problem 给定序列 ${a_n}$,求是否有一种顺序依次进行 $n-1$ 次操作(每次将其中一个 $a_i$ 从序列中删去,然后将剩下的每个 $a_j$ 都减去 $a_i$),满足最后留下的数 $=k$。 link->https://codeforces.com/contest/1656/pr 阅读全文
posted @ 2022-08-01 14:07 lsj2009 阅读(35) 评论(0) 推荐(0)
摘要: Problem 给定 $n$ 个区间 $[l_i,r_i]$,找到一个点,使之包含它的区间最多。 link->https://www.luogu.com.cn/problem/P3028 Solution 我们将题目换一种方法来理解:给定 $n$ 个区间 $[l_i,r_i]$ 将其中的每个元素都给 阅读全文
posted @ 2022-08-01 14:04 lsj2009 阅读(32) 评论(0) 推荐(0)
摘要: Problem link->https://www.luogu.com.cn/problem/P8267 Solution 约定的数据分别为 $opt_i,p_i$。 设 $f_{0,x}$ 为 $opt_i=\texttt{L}$ 且 $x\le p_i$ 的 $i$ 的数量。 设 $f_{1,x 阅读全文
posted @ 2022-08-01 14:02 lsj2009 阅读(21) 评论(0) 推荐(0)
摘要: Problem link->https://www.luogu.com.cn/problem/P8268 Solution 在我看来,这是一道递归好题。 我们来考虑怎样查询 $x$ 金属是否能够生产(或者已经有 $x$ 金属): 如果本身就有 $x$ 金属,将 $x$ 金属个数 $-1$,返回 tr 阅读全文
posted @ 2022-08-01 12:15 lsj2009 阅读(29) 评论(0) 推荐(0)
摘要: Problem 给定一个正整数 $n$。 找到 $4$ 个正整数 $a,b,c,d$ 使得 $a+b+c+d=n$ 且 $\gcd(a,b) = \operatorname{lcm}(c,d)$。 如有多组解,输出任意一组即可。 link->https://codeforces.com/contes 阅读全文
posted @ 2022-08-01 12:13 lsj2009 阅读(28) 评论(0) 推荐(0)
摘要: Problem link->https://www.luogu.com.cn/problem/P8284 Solution 在此之前,先让我们看一个显然成立的柿子: $$\gcd(\underbrace{a,a,\cdot\cdot\cdot,a,a}_{\texttt{若干个相同的正整数} a}) 阅读全文
posted @ 2022-08-01 12:11 lsj2009 阅读(16) 评论(0) 推荐(0)
摘要: Problem 给定序列 ${a_n}$,对于每个 $a_i$ 你可以将他变成 $a_i-1$ 或 $a_i$ 或 $a_i+1$,是否有一种操作方法可以使该序列满足对于任意一个 $i(1<i\le n)$ 满足 $a_i=a_{i-1}+1$。 link->https://codeforces.c 阅读全文
posted @ 2022-08-01 12:09 lsj2009 阅读(29) 评论(0) 推荐(0)
摘要: Problem 给定一字符串 $s$,问是否有对于一个 $s$ 的子串 $t$ 而言,对于有 $a$ 在 $t$ 中的出现次数与 $b$ 在 $t$ 中的出现次数之差大于 $1$,其中 $a,b\in s$。 link->https://codeforces.com/contest/1673/pro 阅读全文
posted @ 2022-08-01 12:07 lsj2009 阅读(30) 评论(0) 推荐(0)