- 博客(4)
- 收藏
- 关注
原创 G - 数字转换 LibreOJ - 10155
LibreOJ - 10155 题目描述如果一个数 x 的约数(不包括他本身)的和 y 比他本身小,那么 x 可以变成 y,y 也可以变成 x。例如 4 可以变为 3,1 可以变为 7。限定所有数字变换在不超过 n 的正整数范围内进行,求不断进行数字变换且不出现重复数字的最多变换步数。输入格式输入一个正整数 nn。输出格式输出不断进行数字变换且不出现重复数字的最多变换步数。样例 7 3 一种方案为 4→3→1→7。数据范围与提示对于100% 的数据,1≤n≤50
2022-07-11 16:52:52
124
原创 【无标题】
HDU - 2196 A school bought the first computer some time ago(so this computer's id is 1). During the recent years the school bought N-1 new computers. Each new computer was connected to one of settled earlier. Managers of school are anxious about slow funct
2022-07-11 06:48:07
100
原创 Cow Marathon POJ - 1985
After hearing about the epidemic of obesity in the USA, Farmer John wants his cows to get more exercise, so he has committed to create a bovine marathon for his cows to run. The marathon route will include a pair of farms and a path comprised of a sequence
2022-07-08 23:01:31
183
原创 P2015 二叉苹果树
# 二叉苹果树## 题目描述有一棵苹果树,如果树枝有分叉,一定是分二叉(就是说没有只有一个儿子的结点)这棵树共有 N个结点(叶子点或者树枝分叉点),编号为 1 ~ N,树根编号一定是 1。我们用一根树枝两端连接的结点的编号来描述一根树枝的位置。下面是一颗有 4 个树枝的树:``` 2 5 \ / 3 4 \ / 1 ```现在这颗树枝条太多了,需要剪枝。但是一些树枝上长有苹果。给定需要保留的树枝数量,求出最多能留住多少苹果。## 输入格式第一行 2个整数 N 和 Q,分别表示表
2022-07-07 17:33:12
216
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人