From 4cb7eaba832151653a6a7d27dbc4802aaa463e10 Mon Sep 17 00:00:00 2001 From: Anduin Xue Date: Sat, 18 Sep 2021 01:26:13 +0800 Subject: [PATCH] =?UTF-8?q?Update=20=E5=A6=82=E4=BD=95=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E7=8E=B0=E5=9C=A8=E5=90=83=E4=BB=80=E4=B9=88.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 如何选择现在吃什么.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/如何选择现在吃什么.md b/如何选择现在吃什么.md index cddb7f4e..6b0a4d73 100644 --- a/如何选择现在吃什么.md +++ b/如何选择现在吃什么.md @@ -11,6 +11,20 @@ 由此得到荤菜数量和素菜数量,再在上一步的菜谱中选择即可。 +#### 形式语言描述 + +当 有人数 `N` 时, +设 `素菜数` 为 `a`, `荤菜数`为 `b`。 +`N`, `a`, `b`均为整数。 + +此时有下列不等式组: + +* a + b = N + 1 +* b >= a +* b <= a + 1 + +得到一组关于`a`, `b`的整数解即可。 + ### 菜的选择 * 如果人数超过8人,考虑在荤菜中增加鱼类荤菜。