摘要: 题目链接:https://codeforces.com/contest/1366/problem/C 题意 有一个 $n \times m$ 的 $01$迷宫,要使从 $(1,1)$ 到 $(n,m)$ 的所有路径均为回文串,至少要变换多少字符。 题解一 用 $bfs$ 得到回文串每个位置可能的 $ 阅读全文
posted @ 2020-06-12 11:21 Kanoon 阅读(260) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://codeforces.com/contest/1366/problem/B 题意 大小为 $n$ 的数组 $a$,除了 $a_x = 1$,其余 $a_i = 0$,依次给出 $m$ 个区间,可以选择区间中的两个元素交换(可相同),问最多有多少个元素可能为 $1$ 。 题解 阅读全文
posted @ 2020-06-12 11:19 Kanoon 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://codeforces.com/contest/1366/problem/A 题意 有两个数 $a$ 和 $b$,每次可以选择从一个数中取 $2$,另一个数中取 $1$,问最多可以进行多少次这样的操作。 题解一 比较好想的一种模拟的做法: 较多者每次取两个至二者相等 二者每次 阅读全文
posted @ 2020-06-12 11:15 Kanoon 阅读(369) 评论(0) 推荐(1) 编辑