会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Kanoon
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
10
11
12
13
14
15
16
17
18
···
23
下一页
2020年6月17日
Codeforces Round #650 (Div. 3) A. Short Substrings
摘要: 题目链接:https://codeforces.com/contest/1367/problem/A 题意 给出一个字符串 $t$,找出原字符串 $s$,$t$ 由 $s$ 从左至右的所有长为 $2$ 的子串构成。 题解 只有 $s$ 的首尾字符会只在 $t$ 中出现一次,其余字符都会重复出现两次。
阅读全文
posted @ 2020-06-17 23:10 Kanoon
阅读(194)
评论(0)
推荐(0)
2020年6月14日
AtCoder Beginner Contest 170
摘要: 比赛链接:https://atcoder.jp/contests/abc170 A - Five Variables 题意 $5$ 个数中有 $1$ 个 $0$,判断是第几个。 代码 #include <bits/stdc++.h> using namespace std; int main() {
阅读全文
posted @ 2020-06-14 22:35 Kanoon
阅读(435)
评论(0)
推荐(1)
Codeforces Round #649 (Div. 2) C. Ehab and Prefix MEXs
摘要: 题目链接:https://codeforces.com/contest/1364/problem/C 题意 给出大小为 $n$ 的非递减数组 $a$,构造同样大小的数组 $b$,使得对于每个 $i$,$b_1, b_2, \ldots, b_i$ 中未出现的最小正整数均为 $a_i$ 。($1 \l
阅读全文
posted @ 2020-06-14 19:05 Kanoon
阅读(285)
评论(0)
推荐(1)
Codeforces Round #649 (Div. 2) B. Most socially-distanced subsequence
摘要: 题目链接:https://codeforces.com/contest/1364/problem/B 题意 给出大小为 $n$ 的一个排列 $p$,找出子序列 $s$,使得 $|s_1-s_2|+|s_2-s_3|+\ldots+|s_{k-1}-s_k|$ 最大的同时 $k$ 尽可能地小。 题解
阅读全文
posted @ 2020-06-14 17:20 Kanoon
阅读(336)
评论(0)
推荐(0)
Codeforces Round #649 (Div. 2) A. XXXXX
摘要: 题目链接:https://codeforces.com/contest/1364/problem/A 题意 找出大小为 $n$ 的数组 $a$ 的最长连续子数组,其元素和不被 $x$ 整除。 题解 如果数组的每个元素都被 $x$ 整除,则不存在不被 $x$ 整除的子数组 如果整个数组之和不被 $x$
阅读全文
posted @ 2020-06-14 17:10 Kanoon
阅读(427)
评论(0)
推荐(1)
2020年6月12日
Educational Codeforces Round 89 (Rated for Div. 2) C. Palindromic Paths(贪心)
摘要: 题目链接:https://codeforces.com/contest/1366/problem/C 题意 有一个 $n \times m$ 的 $01$迷宫,要使从 $(1,1)$ 到 $(n,m)$ 的所有路径均为回文串,至少要变换多少字符。 题解一 用 $bfs$ 得到回文串每个位置可能的 $
阅读全文
posted @ 2020-06-12 11:21 Kanoon
阅读(264)
评论(0)
推荐(0)
Educational Codeforces Round 89 (Rated for Div. 2) B. Shuffle(数学/双指针)
摘要: 题目链接:https://codeforces.com/contest/1366/problem/B 题意 大小为 $n$ 的数组 $a$,除了 $a_x = 1$,其余 $a_i = 0$,依次给出 $m$ 个区间,可以选择区间中的两个元素交换(可相同),问最多有多少个元素可能为 $1$ 。 题解
阅读全文
posted @ 2020-06-12 11:19 Kanoon
阅读(234)
评论(0)
推荐(0)
Educational Codeforces Round 89 (Rated for Div. 2) A. Shovels and Swords(贪心/数学)
摘要: 题目链接:https://codeforces.com/contest/1366/problem/A 题意 有两个数 $a$ 和 $b$,每次可以选择从一个数中取 $2$,另一个数中取 $1$,问最多可以进行多少次这样的操作。 题解一 比较好想的一种模拟的做法: 较多者每次取两个至二者相等 二者每次
阅读全文
posted @ 2020-06-12 11:15 Kanoon
阅读(379)
评论(0)
推荐(1)
2020年6月11日
Codeforces Round #648 (Div. 2) E. Maximum Subsequence Value(鸽巢原理)
摘要: 题目链接:https://codeforces.com/problemset/problem/1365/E 题意 有 $n$ 个元素,定义大小为 $k$ 的集合值为 $\sum2^i$,其中,若集合内至少有 $max(1, k - 2)$ 个数二进制下第 $i$ 位为 $1$,则第 $i$ 位有效,
阅读全文
posted @ 2020-06-11 16:00 Kanoon
阅读(152)
评论(0)
推荐(0)
2020年6月8日
Codeforces Round #648 (Div. 2) D. Solve The Maze
摘要: 这题犯了一个很严重的错误,bfs 应该在入队操作的同时标记访问,而不是每次只标记取出的队首元素。 题目链接:https://codeforces.com/contest/1365/problem/D 题意 有一个 $n \times m$ 的迷宫,迷宫有四种方格: '.' 空方格 '#' 墙 'B'
阅读全文
posted @ 2020-06-08 01:47 Kanoon
阅读(135)
评论(2)
推荐(0)
上一页
1
···
10
11
12
13
14
15
16
17
18
···
23
下一页
公告