上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 23 下一页
摘要: 题目链接:https://codeforces.com/contest/1370/problem/C 题意 给出一个正整数 $n$,Ashishgup 和 FastestFinger 依次选择执行以下一个操作: 如果 $n > 1$,使 $n$ 除以一个奇因子 如果 $n > 1$,使 $n$ 减一 阅读全文
posted @ 2020-06-21 18:45 Kanoon 阅读(357) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://codeforces.com/contest/1370/problem/D 题意 给出一个含有 $n$ 个数的数组 $a$,从中选出 $k$ 个数组成子序列 $s$,使得 $min(max(s_1, s_3, s_5, \ldots), max(s_2, s_4, s_6, 阅读全文
posted @ 2020-06-21 18:05 Kanoon 阅读(231) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://codeforces.com/contest/1370/problem/E 题意 给出两个长为 $n$ 的 $01$ 串 $s$ 和 $t$,每次可以选择 $s$ 的一些下标,使字符只在这些下标内循环右移一个单位,问两个字符串相等至少需要循环移动多少次。 题解 无解的情况 阅读全文
posted @ 2020-06-21 13:35 Kanoon 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://codeforces.com/contest/1368/problem/E 题意 给出一个 $n$ 点 $m$ 边的有向图,每条边由编号较小的点通向编号较大的点,每个点的出度不大于 $2$,删掉一些点,使得图中不存在长度大于等于 $2$ 的路径。(最多删掉 $\frac{4 阅读全文
posted @ 2020-06-20 15:20 Kanoon 阅读(343) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://codeforces.com/contest/1368/problem/A 题意 给出 $a,b$,只可以使用 '+=' 运算符,问至少要使用多少次使得 $a$ 或 $b$ 大于 $n$ 。($1 \le a,b \le n \le 10^9$) 题解 每次使较小的数加上较 阅读全文
posted @ 2020-06-19 11:15 Kanoon 阅读(208) 评论(0) 推荐(1) 编辑
摘要: 题目链接:https://codeforces.com/contest/1368/problem/B 题意 构造最短的至少含有 $k$ 个 $codeforces$ 子序列的字符串。 题解 如下表: c o d e f o r c e s 子序列个数 个数 1 1 1 1 1 1 1 1 1 1 $ 阅读全文
posted @ 2020-06-19 11:00 Kanoon 阅读(373) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://codeforces.com/contest/1368/problem/C 题意 构造一个只含有灰、白块的网格,要求: 所有灰块为一个连通块 每个灰块与偶数个灰块相邻 恰有 $n$ 个灰块四周都有灰块 题解 即在 $n = 1$ 网格的基础上更新右上角三个点的坐标即可。 代 阅读全文
posted @ 2020-06-19 10:25 Kanoon 阅读(327) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://codeforces.com/contest/1368/problem/D 题意 给出一个大小为 $n$ 的数组 $a$,每次可以选两个下标不同的元素,一个赋为二者相与的值,同时一个赋为二者相或的值,计算 $\sum_{i=1}^n a_i^2$ 的最大值。 题解 即重新分 阅读全文
posted @ 2020-06-19 10:15 Kanoon 阅读(280) 评论(0) 推荐(1) 编辑
摘要: 题目链接:https://codeforces.com/contest/1367/problem/C 题意 给出一个长为 $n$ 的 $01$字符串,两个相邻 $1$ 间距应大于 $k$,初始序列合法,问最多能再使多少 $0$ 变为 $1$ 。 题解 如果当前字符为 $0$,查找 $k$ 个距离内是 阅读全文
posted @ 2020-06-17 23:30 Kanoon 阅读(305) 评论(2) 推荐(1) 编辑
摘要: 题目链接:https://codeforces.com/contest/1367/problem/B 题意 有一大小为 $n$ 的数组 $a$,问能否经过交换使所有元素与下标奇偶性相同(0 - indexed)。 题解 奇偶性不同的奇数和偶数个数应相等。 代码 #include <bits/stdc 阅读全文
posted @ 2020-06-17 23:12 Kanoon 阅读(255) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 23 下一页