AcWing
  • 首页
  • 课程
  • 题库
  • 更多
    • 竞赛
    • 题解
    • 分享
    • 问答
    • 应用
    • 校园
  • 关闭
    历史记录
    清除记录
    猜你想搜
    AcWing热点
  • App
  • 登录/注册

做题的时候可以思考的几点

作者: 作者的头像   2790249197 ,  2025-06-06 21:34:22 · 中国澳门 ,  所有人可见 ,  阅读 1


0


Here is a non-exhaustive list of techniques that are useful to keep in mind. These are internalized by most experienced participants already but maybe it helps you.
Figuring out the Nature of an Optimal Solution. One of the most important thing in problems imo.
Solving subtasks of the original problem and then trying to extend/generalize your solution.
Fixing a parameter and then trying to maximise the result with respect to that fixed parameter.
Finding necessary and sufficient conditions. Sometimes, your necessary conditions themselves become sufficient, or vice versa.
Identifying Lower and Upper bounds, and constructing them.
Reducing a problem into smaller subproblems, commonly used with Dynamic Programming or Inductive Proofs.
Considering the Decision Version of the Problem instead. Especially useful in Counting problems, where you need to count number of good subsequences for example.
Formalizing the Problem

先formalizing the problem
你可以固定某些东西,让问题变简单

在动态规划问题中,我使用的方法不仅仅是随机猜测正确的状态,而是查看我们需要存储哪些足以计算答案的信息。
把问题分成几个小部分
当我们被要求找到一个最佳的 “可能” 序列时,首先将问题转化为决策问题是有帮助的。之后编写 dp 变得更加容易。
简单来说就是如果你要构造一个东西,你可以思考你是否可以缩小范围,让这个问题变成一个选择题,那样就会比较好dp

Let’s look at what information we need to store. Consider the subproblem till i−1
and we want to check if we can add i
to Bob’s sequence x
or not. We need 2
pieces of information

可以假设答案长这样,那答案需要满足什么条件
例如就是
Now, consider the case when Bob wants to deny the sequence x1,x2,…,xm
from Alice. What is Bob’s strategy and when is it possible? Both are very important questions.

可以缩小答案范围,然后枚举

用数学条件代替流程

可以把很多问题变成判断性问题,例如问你有多少个符合条件,你可以变成[…]符不符合条件

0 评论

App 内打开
你确定删除吗?
1024
x

© 2018-2025 AcWing 版权所有  |  京ICP备2021015969号-2
用户协议  |  隐私政策  |  常见问题  |  联系我们
AcWing
请输入登录信息
更多登录方式: 微信图标 qq图标 qq图标
请输入绑定的邮箱地址
请输入注册信息