Loading

摘要: 问题描述 w星球的一个种植园,被分成 m * n 个小格子(东西方向m行,南北方向n列)。每个格子里种了一株合根植物。 这种植物有个特点,它的根可能会沿着南北或东西方向伸展,从而与另一个格子的植物合成为一体。 如果我们告诉你哪些小格子间出现了连根现象,你能说出这个园中一共有多少株合根植物吗? 输入格 阅读全文
posted @ 2020-02-24 20:10 脂环 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 问题描述 小明正在玩一个“翻硬币”的游戏。 桌上放着排成一排的若干硬币。我们用 * 表示正面,用 o 表示反面(是小写字母,不是零)。 比如,可能情形是:**oo***oooo 如果同时翻转左边的两个硬币,则变为:oooo***oooo 现在小明的问题是:如果已知了初始状态和要达到的目标状态,每次只 阅读全文
posted @ 2020-02-24 19:22 脂环 阅读(178) 评论(0) 推荐(0) 编辑
摘要: This is an easier version of the problem. In this version n≤1000n≤1000 The outskirts of the capital are being actively built up in Berland. The compan 阅读全文
posted @ 2020-02-24 15:08 脂环 阅读(426) 评论(0) 推荐(0) 编辑
摘要: Tired of boring office work, Denis decided to open a fast food restaurant. On the first day he made aa portions of dumplings, bb portions of cranberry 阅读全文
posted @ 2020-02-24 14:30 脂环 阅读(360) 评论(0) 推荐(0) 编辑