CCF GESP C++四级上机编程分类练习推荐题单

以下为各分类推荐编程练习题的完整表格信息

① 二维数组与矩阵(高频考点,推荐20题)

题号 题目 难度 练习要点 链接
P2615 神奇的幻方 普及- 幻方生成规律、二维数组填充 https://www.luogu.com.cn/problem/P2615
P2670 扫雷游戏 普及- 二维数组八方向遍历 https://www.luogu.com.cn/problem/P2670
P2258 子矩阵 普及+/提高 子矩阵枚举、二维数组组合优化 https://www.luogu.com.cn/problem/P2258
P2239 螺旋矩阵 普及- 矩阵螺旋遍历规律 https://www.luogu.com.cn/problem/P2239
B2103 图像相似度 入门 二维数组遍历、像素比较 https://www.luogu.com.cn/problem/B2103
P1056 排座椅 普及- 二维数组+贪心策略 https://www.luogu.com.cn/problem/P1056
P1614 爱与愁的心痛 入门 二维数组/多维数组应用 https://www.luogu.com.cn/problem/P1614
P1129 矩阵游戏 普及+/提高 矩阵变换、二分图匹配 https://www.luogu.com.cn/problem/P1129
P2199 最后的迷宫 普及/提高- 二维数组BFS、方向处理 https://www.luogu.com.cn/problem/P2199
P10061 蛇形矩阵 普及- 二维数组蛇形填充 https://www.luogu.com.cn/problem/P10061
P10474 矩阵加法 入门 二维数组对应元素相加 https://www.luogu.com.cn/problem/P10474
B4345 矩阵转置 入门 矩阵行列互换 https://www.luogu.com.cn/problem/B4345
B4264 二阶矩阵 入门 二阶矩阵运算 https://www.luogu.com.cn/problem/B4264
P1406 方格填数 普及+/提高 矩阵填数、回溯搜索 https://www.luogu.com.cn/problem/P1406
U567311 走迷宫(BFS) 普及- 二维数组BFS最短路 https://www.luogu.com.cn/problem/U567311
P5735 【深基7.例1】距离函数 入门 二维坐标计算、函数封装 https://www.luogu.com.cn/problem/P5735
P2550 彩票摇奖 入门 一维桶数组、概率统计 https://www.luogu.com.cn/problem/P2550
P1563 玩具谜题 普及- 模拟、数组环形处理 https://www.luogu.com.cn/problem/P1563
P1320 压缩技术(续集版) 入门 二维数据压缩存储 https://www.luogu.com.cn/problem/P1320
P1319 压缩技术 入门 二维数据压缩与还原 https://www.luogu.com.cn/problem/P1319

② 排序算法与应用(高频考点,推荐18题)

题号 题目 难度 练习要点 链接
P1093 奖学金 普及- 结构体多关键字排序 https://www.luogu.com.cn/problem/P1093
P1177 【模板】快速排序 普及- 排序算法模板 https://www.luogu.com.cn/problem/P1177
P1059 明明的随机数 入门 排序+去重 https://www.luogu.com.cn/problem/P1059
P1781 宇宙总统 普及- 结构体排序、大数比较 https://www.luogu.com.cn/problem/P1781
P1068 分数线划定 普及- 结构体多关键字+比例计算 https://www.luogu.com.cn/problem/P1068
P1309 瑞士轮 普及/提高- 排序稳定性、归并思想 https://www.luogu.com.cn/problem/P1309
P1104 生日 入门 结构体多级排序 https://www.luogu.com.cn/problem/P1104
P1583 魔法照片 普及- 排序+额外权重 https://www.luogu.com.cn/problem/P1583
P1051 谁拿了最多奖学金 普及/提高- 结构体复杂条件排序 https://www.luogu.com.cn/problem/P1051
P5740 【深基7.例9】最厉害的学生 入门 结构体基础排序 https://www.luogu.com.cn/problem/P5740
P5742 【深基7.例11】评等级 入门 结构体+条件判断 https://www.luogu.com.cn/problem/P5742
P1786 帮贡排序 普及- 多关键字复杂排序 https://www.luogu.com.cn/problem/P1786
P1923 【深基9.例4】求第 k 小的数 普及- 快速选择、排序应用 https://www.luogu.com.cn/problem/P1923
P1271 【深基9.例1】选举学生会 入门 计数排序、桶排序 https://www.luogu.com.cn/problem/P1271
P1097 统计数字 普及- 排序后统计频次 https://www.luogu.com.cn/problem/P1097
P5143 攀爬者 普及- 结构体排序+距离计算 https://www.luogu.com.cn/problem/P5143
P1223 排队接水 普及- 贪心排序 https://www.luogu.com.cn/problem/P1223
P1803 凌乱的yyy / 线段覆盖 普及- 区间排序+贪心 https://www.luogu.com.cn/problem/P1803

③ 递推与模拟(高频考点,推荐16题)

题号 题目 难度 练习要点 链接
P1002 过河卒 普及- 递推、障碍处理 https://www.luogu.com.cn/problem/P1002
P1044 普及/提高- 卡特兰数递推 https://www.luogu.com.cn/problem/P1044
P1028 数的计算 普及- 递推、记忆化搜索 https://www.luogu.com.cn/problem/P1028
P1096 Hanoi双塔问题 普及/提高- 汉诺塔递推、高精度 https://www.luogu.com.cn/problem/P1096
P1192 台阶问题 入门 递推、模运算 https://www.luogu.com.cn/problem/P1192
P1255 数楼梯 普及- 斐波那契递推、高精度 https://www.luogu.com.cn/problem/P1255
P2437 蜜蜂路线 普及- 递推、高精度加法 https://www.luogu.com.cn/problem/P2437
P4994 终于结束的起点 普及- 递推数列、循环终止 https://www.luogu.com.cn/problem/P4994
P1011 车站 普及/提高- 递推模拟 https://www.luogu.com.cn/problem/P1011
P5461 赦免战俘 普及- 递推+分治、矩阵填充 https://www.luogu.com.cn/problem/P5461
P5743 【深基7.习8】猴子吃桃 入门 逆推递推 https://www.luogu.com.cn/problem/P5743
P1003 铺地毯 普及- 递推覆盖、最后覆盖判断 https://www.luogu.com.cn/problem/P1003
P1328 生活大爆炸版石头剪刀布 普及- 循环模拟 https://www.luogu.com.cn/problem/P1328
P1518 两只塔姆沃斯牛 普及- 二维模拟、状态标记 https://www.luogu.com.cn/problem/P1518
P1563 玩具谜题 普及- 模拟、数组环形处理 https://www.luogu.com.cn/problem/P1563
P5019 铺设道路 普及/提高- 贪心递推 https://www.luogu.com.cn/problem/P5019

④ 字符串处理(中频考点,推荐12题)

题号 题目 难度 练习要点 链接
P1308 统计单词数 普及- 字符串查找、大小写转换 https://www.luogu.com.cn/problem/P1308
P5734 【深基6.例6】文字处理软件 普及- 字符串基本操作 https://www.luogu.com.cn/problem/P5734
P1071 潜伏者 普及- 字符映射与替换 https://www.luogu.com.cn/problem/P1071
P1098 字符串的展开 普及/提高- 字符串解析与重复展开 https://www.luogu.com.cn/problem/P1098
P1957 口算练习题 普及- 字符串与数值混合处理 https://www.luogu.com.cn/problem/P1957
P1598 垂直柱状图 普及- 字符频率统计、输出格式 https://www.luogu.com.cn/problem/P1598
P5015 标题统计 入门 基础字符串遍历 https://www.luogu.com.cn/problem/P5015
P1603 斯诺登的密码 普及- 字符串映射、排序 https://www.luogu.com.cn/problem/P1603
P1012 拼数 普及- 字符串排序、自定义比较 https://www.luogu.com.cn/problem/P1012
P1538 迎春舞会之数字舞蹈 普及/提高- 字符串图案输出 https://www.luogu.com.cn/problem/P1538
B3683 字符串反转 入门 字符串逆序输出 https://www.luogu.com.cn/problem/B3683
B4119 字符串加密 入门 字符移位加密 https://www.luogu.com.cn/problem/B4119

⑤ 函数与指针基础(低频考点,推荐10题)

题号 题目 难度 练习要点 链接
P5735 【深基7.例1】距离函数 入门 函数定义、数学计算 https://www.luogu.com.cn/problem/P5735
P5740 【深基7.例9】最厉害的学生 入门 结构体+函数封装 https://www.luogu.com.cn/problem/P5740
P5742 【深基7.例11】评等级 入门 多函数协作、条件判断 https://www.luogu.com.cn/problem/P5742
P1307 数字反转 入门 函数封装数位处理 https://www.luogu.com.cn/problem/P1307
P1553 数字反转(升级版) 普及- 字符串/指针处理边界 https://www.luogu.com.cn/problem/P1553
P1428 小鱼比可爱 入门 数组遍历、比较计数 https://www.luogu.com.cn/problem/P1428
P5717 【深基3.习8】三角形分类 入门 函数判断三角形类型 https://www.luogu.com.cn/problem/P5717
P5719 【深基4.例3】分类平均 入门 函数计算平均值 https://www.luogu.com.cn/problem/P5719
P5723 【深基4.例13】质数口袋 入门 函数判断质数 https://www.luogu.com.cn/problem/P5723
P5727 【深基5.例3】冰雹猜想 入门 函数递归/循环 https://www.luogu.com.cn/problem/P5727

⑥ 进制转换与位运算(低频考点,推荐8题)

题号 题目 难度 练习要点 链接
P1143 进制转换 普及- 任意进制转换 https://www.luogu.com.cn/problem/P1143
P2084 进制转换 入门 十进制转M进制 https://www.luogu.com.cn/problem/P2084
P1017 进制转换 普及/提高- 负进制转换 https://www.luogu.com.cn/problem/P1017
P1100 高低位交换 普及- 位运算、高低位交换 https://www.luogu.com.cn/problem/P1100
P5657 格雷码 普及/提高- 二进制递推、位运算 https://www.luogu.com.cn/problem/P5657
P1062 数列 普及/提高- 进制分解 https://www.luogu.com.cn/problem/P1062
P1010 幂次方 普及/提高- 二进制拆分 https://www.luogu.com.cn/problem/P1010
P1255 数楼梯 普及- 高精度加法(辅助进制理解) https://www.luogu.com.cn/problem/P1255

⑦ 贪心算法(中频考点,推荐12题)

题号 题目 难度 练习要点 链接
P4995 跳跳! 普及- 排序+贪心 https://www.luogu.com.cn/problem/P4995
P1204 挤牛奶 普及- 区间排序+贪心合并 https://www.luogu.com.cn/problem/P1204
P1049 装箱问题 普及/提高- 贪心/动态规划入门 https://www.luogu.com.cn/problem/P1049
P1090 合并果子 普及/提高- 贪心+优先队列 https://www.luogu.com.cn/problem/P1090
P1181 数列分段Section I 普及- 贪心分段 https://www.luogu.com.cn/problem/P1181
P1208 混合牛奶 普及- 结构体排序+贪心 https://www.luogu.com.cn/problem/P1208
P1223 排队接水 普及- 排序贪心 https://www.luogu.com.cn/problem/P1223
P1094 纪念品分组 普及- 排序+双指针贪心 https://www.luogu.com.cn/problem/P1094
P1803 凌乱的yyy / 线段覆盖 普及- 区间排序贪心 https://www.luogu.com.cn/problem/P1803
P1031 均分纸牌 普及/提高- 贪心模拟 https://www.luogu.com.cn/problem/P1031
P1080 国王游戏 普及/提高- 排序贪心、高精度 https://www.luogu.com.cn/problem/P1080
P5019 铺设道路 普及/提高- 贪心递推 https://www.luogu.com.cn/problem/P5019

三、练习建议

  1. 优先级顺序

    • 高频考点(二维数组、排序、递推)优先练习,每类至少完成10题
    • 中频考点(字符串、贪心)次之,每类完成6-8题
    • 低频考点(函数指针、进制转换)最后,每类完成4-6题
  2. 练习方法

    • 先完成GESP四级真题(题单554中的26题)
    • 按分类选择上述推荐题目进行专项训练
    • 每类题目从易到难,先完成入门/普及-难度,再挑战更高难度
  3. 时间分配

    • 二维数组与矩阵:建议2-3周,每天2-3题
    • 排序算法与应用:建议2周,每天2-3题
    • 递推与模拟:建议2周,每天2-3题
    • 其他分类:各1周,每天1-2题
  4. 常见误区与避坑指南

    • 二维数组(如P2670扫雷):循环时注意八方向边界检查,避免数组越界
    • 结构体排序(如P1093奖学金):cmp函数中建议使用><明确比较逻辑,注意顺序一致性(总分高→语文高→学号小)
    • 递推(如P1002过河卒):递推数组初始值不能随意设为0或1,马的控制点需单独标记,防止走不通的点被累加
    • 字符串(如P1321单词覆盖还原):覆盖字符时用if(s[i]=='b')s.substr(i,3)=="boy"判断,注意边界长度防止越界
    • 贪心(如P1094纪念品分组):先排序,用双指针双向移动策略,避免单指针漏掉最优组合
    • 进制转换(如P1017负进制转换):除法的余数必须为正,如果余数为负需要调整商和余数
    • 测试建议:每道题提交前用题目提供的样例测试;若样例通过但提交WA,检查边界值(n=1n=0、最大值)是否正确处理

这套练习体系覆盖了GESP C++四级所有考点,通过系统训练可以有效提升编程能力和应试水平。

posted @ 2026-05-01 06:36  kkman2000  阅读(102)  评论(0)    收藏  举报