上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 37 下一页
摘要: 题目链接:http://oj.ecustacm.cn/problem.php?id=1299 题目描述 小明最近在研究压缩算法。他知道,压缩的时候如果能够使得数值很小,就能通过熵编码得到较高的压缩比。然而,要使数值很小是一个挑战。最近,小明需要压缩一些正整数的序列,这些序列的特点是,后面出现的数字很 阅读全文
posted @ 2020-01-31 13:00 _Ackerman 阅读(447) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://oj.ecustacm.cn/problem.php?id=1293 题目描述 X星球日报和我们地球的城市早报是一样的,都是一些单独的纸张叠在一起而已。每张纸印有4版。比如,某张报纸包含的4页是:5,6,11,12,可以确定它应该是最上边的第2张报纸。我们在太空中捡到了一张X 阅读全文
posted @ 2020-01-30 11:30 _Ackerman 阅读(623) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://ac.nowcoder.com/acm/contest/3570/H #include <iostream> #include <algorithm> #include <string> #include <string.h> #include <vector> #incl 阅读全文
posted @ 2020-01-29 21:02 _Ackerman 阅读(445) 评论(0) 推荐(1) 编辑
摘要: 题目链接:http://oj.ecustacm.cn/problem.php?id=1254 题目描述 小明有3颗红珊瑚,4颗白珊瑚,5颗黄玛瑙。他想用它们串成一圈作为手链,送给女朋友。现在小明想知道:如果考虑手链可以随意转动或翻转,一共有多少不同的组合样式? 输出 请你输出该整数。不要输出任何多余 阅读全文
posted @ 2020-01-29 20:56 _Ackerman 阅读(647) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://oj.ecustacm.cn/problem.php?id=1284 题目描述 如下的10个格子,填入0~9的数字。要求:连续的两个数字不能相邻。(左右、上下、对角都算相邻)一共有多少种可能的填数方案? 输出 请填写表示方案数目的整数。 思路: 采取 DFS 的方法去遍历每个 阅读全文
posted @ 2020-01-29 20:45 _Ackerman 阅读(921) 评论(3) 推荐(0) 编辑
摘要: 题目链接:http://oj.ecustacm.cn/problem.php?id=1285 题目描述 现在小学的数学题目也不是那么好玩的。看看这个寒假作业:每个方块代表1~13中的某一个数字,但不能重复。比如: 6 + 7 = 139 - 8 = 13 * 4 = 1210 / 2 = 5 以及: 阅读全文
posted @ 2020-01-29 20:34 _Ackerman 阅读(706) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://oj.ecustacm.cn/problem.php?id=1286 题目描述 如下图, 有12张连在一起的12生肖的邮票。现在你要从中剪下5张来,要求必须是连着的。(仅仅连接一个角不算相连)比如,下面两张图中,粉红色所示部分就是合格的剪取。请你计算,一共有多少种不同的剪取方 阅读全文
posted @ 2020-01-29 20:29 _Ackerman 阅读(665) 评论(0) 推荐(1) 编辑
摘要: 题目链接:http://oj.ecustacm.cn/problem.php?id=1288 X星球的考古学家发现了一批古代留下来的密码。这些密码是由A、B、C、D 四种植物的种子串成的序列。仔细分析发现,这些密码串当初应该是前后对称的(也就是我们说的镜像串)。由于年代久远,其中许多种子脱落了,因而 阅读全文
posted @ 2020-01-29 20:22 _Ackerman 阅读(694) 评论(0) 推荐(1) 编辑
摘要: 既然是“暴力杯”,那么就采取暴力的解法。 我们从下往上递归去找点就好了 dfs无根树转有根树,递归找最优。注意开LL 1 #include <iostream> 2 #include <algorithm> 3 #include <string> 4 #include <string.h> 5 #i 阅读全文
posted @ 2020-01-22 13:11 _Ackerman 阅读(489) 评论(0) 推荐(0) 编辑
摘要: std::vector<int> tree[maxn]; int fa[maxn]; void dfs(int u,int father) { int len = tree[u].size(); for (int i = 0;i < len;i++) { int v = tree[u][i]; if 阅读全文
posted @ 2020-01-22 12:56 _Ackerman 阅读(229) 评论(0) 推荐(0) 编辑
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 37 下一页