上一页 1 2 3 4 5 6 7 8 9 ··· 23 下一页
摘要: 比赛链接:https://codeforces.com/contest/1421 #A. XORwice ##题意 给出两个正整数 \(a、b\),计算 \((a \oplus x) + (b \oplus x)\) 的最小值。 ##题解 \(\begin{equation} a+b = a \op 阅读全文
posted @ 2020-10-18 23:50 Kanoon 阅读(329) 评论(0) 推荐(0) 编辑
摘要: #A. 门牌制作 ##答案 624 ##代码 #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int cnt = 0; for (int i = 1 阅读全文
posted @ 2020-10-17 21:00 Kanoon 阅读(1294) 评论(6) 推荐(0) 编辑
摘要: 比赛链接:https://codeforces.com/contest/1427 #A. Avoiding Zero ##题意 将 \(n\) 个数重新排列使得不存在为 $0$ 的前缀和。 ##题解 计算正、负前缀和,如果二者和为 $0$,则不存在满足题意的排列,否则将绝对值较大的一方排在前面即可。 阅读全文
posted @ 2020-10-14 01:15 Kanoon 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://codeforces.com/contest/1427/problem/D #题意 给出一个大小为 \(n\) 的排列,每次操作可以将 \(n\) 个数分为 $1 \sim n$ 个非空连续份,然后将对称的份两两交换,试给出在 \(n\) 次操作内将排列排为升序的操作过程。 阅读全文
posted @ 2020-10-14 00:50 Kanoon 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://codeforces.com/contest/1427/problem/C #题意 \(r\) 行与 \(r\) 列相交形成了 \(r \times r\) 个点,初始时刻记者位于左下角的 \((1,1)\) 处,接下来给出 \(n\) 个名人的出现时间和位置,出现时间严格 阅读全文
posted @ 2020-10-14 00:20 Kanoon 阅读(241) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://codeforces.com/contest/1427/problem/B #题意 给出一个长为 \(n\) 由 W, L 组成的字符串,如果一个 W 左侧为 W,则它提供 2 分,否则为 1 分。最多可以将 \(k\) 个 L 变为 W,问字符串可以得到的最大分值。 #题 阅读全文
posted @ 2020-10-13 23:45 Kanoon 阅读(267) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://codeforces.com/contest/1427/problem/A #题意 将 \(n\) 个数重新排列使得不存在为 $0$ 的前缀和。 #题解 计算正、负前缀和,如果二者和为 $0$,则不存在满足题意的排列,否则将绝对值较大的一方排在前面即可。 #代码 #incl 阅读全文
posted @ 2020-10-13 23:20 Kanoon 阅读(122) 评论(0) 推荐(0) 编辑
摘要: #A. 表达式 ##题意 ##题解 将所有数字替换为A,运算符替换为O,然后不断合并(AOA),判断表达式最后是否为A即可。 注意将数字替换时判断有无前导零。 ##代码 #include <bits/stdc++.h> using namespace std; int main() { ios::s 阅读全文
posted @ 2020-10-11 22:30 Kanoon 阅读(271) 评论(0) 推荐(0) 编辑
摘要: 比赛链接:https://atcoder.jp/contests/hhkb2020/tasks #A - Keyboard ##代码 #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(fal 阅读全文
posted @ 2020-10-10 22:30 Kanoon 阅读(288) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://codeforces.com/contest/1420/problem/D 前言 之前写过这场比赛的题解,不过感觉这一题还可以再单独拿出来好好捋一下思路。 题意 给出 $n$ 个闭区间,问 $k$ 个区间共区间共有多少种情况。 题解一 以区间为单位进行考虑,排序+优先队列。 阅读全文
posted @ 2020-10-06 22:30 Kanoon 阅读(212) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 23 下一页