打了 Comet OJ 的三道题 A是Comet OJ - Contest #1 C B是Comet OJ - Contest #7 D C是Comet OJ - Contest #8 F A是一个超级恶心的状压题,但是有一个不会证明的结论可以水过去 B一眼看出得到极值的A和B一定可以是在某个$x_ ...
分类:
其他好文 时间:
2020-07-28 14:23:34
阅读次数:
57
题目来源:http://codeforces.com/contest/158/problem/B After the lessons n groups of schoolchildren went outside and decided to visit Polycarpus to celebrat ...
分类:
其他好文 时间:
2020-07-27 16:07:20
阅读次数:
89
##题面 Problem Description There are n cities and m bidirectional roads in Byteland. These cities are labeled by 1,2,…,n, the brightness of the i-th cit ...
分类:
其他好文 时间:
2020-07-27 09:21:33
阅读次数:
88
在区间范围内统计奇数数目 给你两个非负整数 low 和 high 。请你返回 low 和 high 之间(包括二者)奇数的数目。 示例 1: 输入:low = 3, high = 7 输出:3 解释:3 到 7 之间奇数数字为 [3,5,7] 。 示例 2: 输入:low = 8, high = 1 ...
分类:
其他好文 时间:
2020-07-26 15:14:52
阅读次数:
62
题目链接:https://ac.nowcoder.com/acm/contest/5670/D 分析: 将整个数组放在一个圆上去看,可以发现,\(Invert\) 操作只相当于把圆旋转了一个单位,而数字之间的相对位置并没有发生变化,并不会有影响排序的进行。因此要想排序,只有依靠 \(Drop-2\) ...
分类:
其他好文 时间:
2020-07-26 02:00:01
阅读次数:
69
这次比赛远比上次 AIsing Programming Contest 2020 题解 简单,大家都6题全a了。。 我放一下代码,应该看一下就懂了。我的代码有很长的模板,不要介意。。。 代码下载 ...
分类:
其他好文 时间:
2020-07-26 01:43:27
阅读次数:
86
http://acm.hdu.edu.cn/showproblem.php?pid=6754 题意: 字符串由小写字母构成 求 长度为N的 回文子串数量最少的 字符串的个数 思路: 长度为1的串 回文子串最少1个 形式:a 长度为2的串 回文子串最少2个 形式:aa / ab 长度为3的串 回文子串 ...
分类:
其他好文 时间:
2020-07-26 00:24:53
阅读次数:
55
https://codeforces.com/contest/1372 A 众所周知,$1+1\neq 1$。 所以输出 \(n\) 个 $1$ 即可。 时间复杂度 \(O(tn)\)。 #include <bits/stdc++.h> using namespace std; int t; int ...
分类:
其他好文 时间:
2020-07-26 00:22:51
阅读次数:
52
地址:http://codeforces.com/contest/1384/problem/A 题意: 输出n+1个字符串,si和si+1的公共前缀长为ai 解析: 一个一个补的话,会很麻烦。 看范围:ai<=50,就是说前缀最长为50,那么考虑把所有字符串长度都构造为长度>50,那么对于每一个ai ...
分类:
其他好文 时间:
2020-07-26 00:02:58
阅读次数:
54
比赛链接:https://codeforces.com/contest/1390 A. 123-sequence 题意 给出一个只含有 $1,2,3$ 的数组,问使所有元素相同至少要替换多少元素。 题解 统计数组中出现次数最多的元素即可。 代码 #include <bits/stdc++.h> us ...
分类:
其他好文 时间:
2020-07-24 21:43:12
阅读次数:
67