2024-09-18 06:09:17 +00:00
|
|
|
|
# CCF 2019 CSP-S 初赛题目
|
|
|
|
|
|
|
|
|
|
## 单项选择
|
|
|
|
|
|
|
|
|
|
### 1.D
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
3.5f
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### 2.C
|
|
|
|
|
|
2024-09-18 06:45:36 +00:00
|
|
|
|
### 3.D
|
2024-09-18 06:09:17 +00:00
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
11101110010111
|
|
|
|
|
01011011101011
|
|
|
|
|
|
|
|
|
|
11111111111111
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### 4.B
|
|
|
|
|
|
|
|
|
|
### 5.B
|
|
|
|
|
|
|
|
|
|
### 6.B
|
|
|
|
|
|
|
|
|
|
#### 一,1,2,4,8 = $P^4_4 = $ 24
|
|
|
|
|
|
|
|
|
|
#### 二,1,1,8,8 = ${P^4_4\over P^2_2 \times P^2_2}=6 $
|
|
|
|
|
|
|
|
|
|
#### 三,1,1,X,X (x=2,4,8) = $C_3^2\times{P^4_4\over P^2_2} = 36$
|
|
|
|
|
|
|
|
|
|
#### 四,8,8,X,X (x=1,2,4) = 36
|
|
|
|
|
|
|
|
|
|
求和得 102
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### 7.C
|
|
|
|
|
|
|
|
|
|
插入,归并,冒泡是稳定的
|
|
|
|
|
|
|
|
|
|
### 8.B
|
|
|
|
|
|
|
|
|
|
将一个点排除在外
|
|
|
|
|
|
|
|
|
|
其他的点求完全图
|
|
|
|
|
|
|
|
|
|
完全图有n个点时
|
|
|
|
|
|
|
|
|
|
边数 = $n\times(n-1)\over 2$
|
|
|
|
|
|
|
|
|
|
ans=n+1
|
|
|
|
|
|
|
|
|
|
$$
|
|
|
|
|
{n\times(n-1)\over2} = 28
|
|
|
|
|
$$
|
|
|
|
|
|
|
|
|
|
得n=8
|
|
|
|
|
|
|
|
|
|
ans=9
|
|
|
|
|
|
|
|
|
|
### 9.B
|
|
|
|
|
|
|
|
|
|
只考虑前三个数,后两个数是自然推出来的
|
|
|
|
|
|
|
|
|
|
先考虑第三个数是什么
|
|
|
|
|
|
|
|
|
|
中间这个数必须正反相同
|
|
|
|
|
|
|
|
|
|
只有0,1,8是正反相同的
|
|
|
|
|
|
|
|
|
|
能被3整除的数各位上的和能被3整除
|
|
|
|
|
|
|
|
|
|
1. 中间的数是0,11种
|
|
|
|
|
|
|
|
|
|
1. 第一位+第二位是三的倍数
|
|
|
|
|
|
|
|
|
|
2. 00,18,81,06,60,96,69,90,09,66,99
|
|
|
|
|
|
|
|
|
|
2. 中间的数是1,7
|
|
|
|
|
1. (第一位+第二位)%3=1
|
|
|
|
|
2. A*10+B,(A+B)%3=1
|
|
|
|
|
3. 10,01,16,61,19,91,88
|
|
|
|
|
3. 中间的数是2,7
|
|
|
|
|
1. 80,08,86,68,89,98,11
|
|
|
|
|
4. 求和得25种
|
|
|
|
|
|
|
|
|
|
### 10.A
|
|
|
|
|
|
|
|
|
|
15+12-4 = 23
|
|
|
|
|
|
|
|
|
|
### 11.D
|
|
|
|
|
|
|
|
|
|
1,3,5
|
|
|
|
|
|
|
|
|
|
2,4,6
|
|
|
|
|
|
|
|
|
|
1,2 2,3 3,4 4,5 5,6
|
|
|
|
|
|
|
|
|
|
2n-1
|
|
|
|
|
|
|
|
|
|
### 12.D
|
|
|
|
|
|
|
|
|
|
储存图的两种方式,最普遍
|
|
|
|
|
|
|
|
|
|
1. 邻接表(动态扩容的vector)
|
|
|
|
|
2. 邻接矩阵(二维数组)
|
|
|
|
|
|
|
|
|
|
### 13.B
|
|
|
|
|
|
|
|
|
|
迪杰斯特拉:用来求由**起始点**到任意一点的距离:未优化的时间复杂度:O(n^2)贪心
|
|
|
|
|
|
|
|
|
|
弗洛伊德:**任意两点**间的最短路径 : O(n^3) ,动态规划
|
|
|
|
|
|
|
|
|
|
Prim:最小生成树算法(贪心)枚举每个点来找到最小生成树
|
|
|
|
|
|
|
|
|
|
Kruskal:最小生成树算法(贪心) 枚举每个边
|
|
|
|
|
|
|
|
|
|
### 14.B
|
|
|
|
|
|
|
|
|
|
等比数列
|
|
|
|
|
|
|
|
|
|
$$
|
|
|
|
|
a_n = a_1\times r^{n-1}
|
|
|
|
|
$$
|
|
|
|
|
|
|
|
|
|
a1 = 2
|
|
|
|
|
|
|
|
|
|
$a_n=a_1\times r^{n-1}$ = 118098
|
|
|
|
|
|
|
|
|
|
$a_{b+1\over 2} = a_1 \times r^{{b+1\over 2}-1} = 486$
|
|
|
|
|
|
|
|
|
|
$r^{n-1}=118098/2 = 59049$
|
|
|
|
|
|
|
|
|
|
$r^{{b+1\over 2}-1}=243$
|
|
|
|
|
|
|
|
|
|
$r^{{b+1\over 2}}=243$
|
|
|
|
|
|
|
|
|
|
三的倍数 $3^5$=243
|
|
|
|
|
|
|
|
|
|
### 15. A
|