/Lecture

王道考研机试指南(第二版) 例题代码

Primary LanguageC++

王道考研机试指南(第二版) 例题代码

大家好,我是王道考研机试指南(第二版)的作者炉灰。

我将本书所有的例题代码都提交到GitHub上进行托管,大家可以自行查看、学习和下载。

点击Star进行收藏,以方便之后进行查看。

点击Watch保持关注,如代码有后续更新,会第一时间收到通知。

点击Fork克隆到自己的GitHub下,如有bug,请使用Issues和我进行讨论;如有修改意见,请使用Pull requests提交你的修改意见。

如出现书中代码与GitHub代码不一致的情况,以GitHub的代码为准。

祝各位考生考上自己心仪的院校!!!

题目以及链接

题目编号 题目名称 题目链接 参考代码
例题1.1 A+B (HDU 1089) http://acm.hdu.edu.cn/showproblem.php?pid=1089 https://github.com/BenedictYoung/Lecture/blob/master/Chapter1/1.1.cpp
例题2.1 abc (清华大学复试上机题) http://t.cn/E9WMRTE https://github.com/BenedictYoung/Lecture/blob/master/Chapter2/2.1.cpp
例题2.2 反序数 (清华大学复试上机题) http://t.cn/E9WBrut https://github.com/BenedictYoung/Lecture/blob/master/Chapter2/2.2.cpp
例题2.3 对称平方数1 (清华大学复试上机题) http://t.cn/E9lUYRn https://github.com/BenedictYoung/Lecture/blob/master/Chapter2/2.3.cpp
例题2.4 输出梯形 (清华大学复试上机题) https://github.com/BenedictYoung/Lecture/blob/master/Chapter2/2.4.cpp
例题2.5 叠筐 (HDU 2074) http://acm.hdu.edu.cn/showproblem.php?pid=2074 https://github.com/BenedictYoung/Lecture/blob/master/Chapter2/2.5.cpp
例题2.6 今年的第几天? (清华大学复试上机题) http://t.cn/E9jXK5A https://github.com/BenedictYoung/Lecture/blob/master/Chapter2/2.6.cpp
例题2.7 打印日期 (华中科技大学复试上机题) http://t.cn/E9YP2a8 https://github.com/BenedictYoung/Lecture/blob/master/Chapter2/2.7.cpp
例题2.8 日期累加 (北京理工大学复试上机题) http://t.cn/E9Yw0Cr https://github.com/BenedictYoung/Lecture/blob/master/Chapter2/2.8.cpp
例题2.9 剩下的树 (清华大学复试上机题) http://t.cn/E9ufYo5 https://github.com/BenedictYoung/Lecture/blob/master/Chapter2/2.9.cpp
例题2.10 手机键盘 (清华大学复试上机题) http://t.cn/E9ulcIc https://github.com/BenedictYoung/Lecture/blob/master/Chapter2/2.10.cpp
例题2.11 XXX定律 (浙江大学复试上机题) http://t.cn/E937wDs https://github.com/BenedictYoung/Lecture/blob/master/Chapter2/2.11.cpp
例题3.1 排序 (清华大学复试上机题) http://t.cn/E9dLx5K https://github.com/BenedictYoung/Lecture/blob/master/Chapter3/3.1.cpp
例题3.2 成绩排序 (清华大学复试上机题) http://t.cn/E9d3ysv https://github.com/BenedictYoung/Lecture/blob/master/Chapter3/3.2.cpp
例题3.3 成绩排序2 (清华大学复试上机题) http://t.cn/E9gyHM1 https://github.com/BenedictYoung/Lecture/blob/master/Chapter3/3.3.cpp
例题3.4 找x (哈尔滨工业大学复试上机题) http://t.cn/E9gHFnS https://github.com/BenedictYoung/Lecture/blob/master/Chapter3/3.4.cpp
例题3.5 查找 (北京邮电大学复试上机题) http://t.cn/E9g8aaR https://github.com/BenedictYoung/Lecture/blob/master/Chapter3/3.5.cpp
例题4.1 特殊乘法 (清华大学复试上机题) http://t.cn/Ai8by9vW https://github.com/BenedictYoung/Lecture/blob/master/Chapter4/4.1.cpp
例题4.2 密码翻译 (北京大学复试上机题) http://t.cn/Ai8bGaIx https://github.com/BenedictYoung/Lecture/blob/master/Chapter4/4.2.cpp
例题4.3 简单密码 (北京大学复试上机题) http://t.cn/Ai8bih2z https://github.com/BenedictYoung/Lecture/blob/master/Chapter4/4.3.cpp
例题4.4 统计字符 (浙江大学复试上机题) http://t.cn/Ai8fvq4I https://github.com/BenedictYoung/Lecture/blob/master/Chapter4/4.4.cpp
例题4.5 字母统计 (上海交通大学复试上机题) http://t.cn/Ai8VB72e https://github.com/BenedictYoung/Lecture/blob/master/Chapter4/4.5.cpp
例题4.6 Number Sequence (HDU 1711) http://acm.hdu.edu.cn/showproblem.php?pid=1711 https://github.com/BenedictYoung/Lecture/blob/master/Chapter4/4.6.cpp
例题4.7 Oulipo (POJ 3461) http://poj.org/problem?id=3461 https://github.com/BenedictYoung/Lecture/blob/master/Chapter4/4.7.cpp
例题5.1 完数与盈数 (清华大学复试上机题) http://t.cn/AiKEyQWW https://github.com/BenedictYoung/Lecture/blob/master/Chapter5/5.1.cpp
例题5.2 约瑟夫问题NO.2 (Bailian 3254) http://bailian.openjudge.cn/practice/3254 https://github.com/BenedictYoung/Lecture/blob/master/Chapter5/5.2.cpp
例题5.3 猫狗收容所 https://github.com/BenedictYoung/Lecture/blob/master/Chapter5/5.3.cpp
例题5.4 Zero-complexity Transposition (上海交通大学复试上机题) http://t.cn/AiKa20bt https://github.com/BenedictYoung/Lecture/blob/master/Chapter5/5.4.cpp
例题5.5 括号匹配问题 (CCNU 1978) http://ccnu.openjudge.cn/practice/1978/ https://github.com/BenedictYoung/Lecture/blob/master/Chapter5/5.5.cpp
例题5.6 简单计算器 (浙江大学复试上机题) http://t.cn/AiKoGS94 https://github.com/BenedictYoung/Lecture/blob/master/Chapter5/5.6.cpp
例题6.1 二进制数 (北京邮电大学复试上机题) http://t.cn/AiCuKTOv https://github.com/BenedictYoung/Lecture/blob/master/Chapter6/6.1.cpp
例题6.2 进制转换 (清华大学复试上机题) http://t.cn/AiCuoPRO https://github.com/BenedictYoung/Lecture/blob/master/Chapter6/6.2.cpp
例题6.3 十进制与二进制 (清华大学复试上机题) http://t.cn/AiCuoHKg https://github.com/BenedictYoung/Lecture/blob/master/Chapter6/6.3.cpp
例题6.4 进制转换2 (清华大学复试上机题) http://t.cn/AiCuKG7E https://github.com/BenedictYoung/Lecture/blob/master/Chapter6/6.4.cpp
例题6.5 最大公约数 (哈尔滨工业大学复试上机题) http://t.cn/AiCuWLTS https://github.com/BenedictYoung/Lecture/blob/master/Chapter6/6.5.cpp
例题6.6 最小公倍数 (HDU 1108) http://acm.hdu.edu.cn/showproblem.php?pid=1108 https://github.com/BenedictYoung/Lecture/blob/master/Chapter6/6.6.cpp
例题6.7 素数判定 (哈尔滨工业大学复试上机题) http://t.cn/AiCuWE0Q https://github.com/BenedictYoung/Lecture/blob/master/Chapter6/6.7.cpp
例题6.8 素数 (北京航空航天大学复试上机题) http://t.cn/AiCulqtW https://github.com/BenedictYoung/Lecture/blob/master/Chapter6/6.8.cpp
例题6.9 质因数的个数 (清华大学复试上机题) http://t.cn/Aip7J0Oo https://github.com/BenedictYoung/Lecture/blob/master/Chapter6/6.9.cpp
例题6.10 人见人爱A^B (HDU 2035) http://acm.hdu.edu.cn/showproblem.php?pid=2035 https://github.com/BenedictYoung/Lecture/blob/master/Chapter6/6.10.cpp
例题6.11 计算两个矩阵的乘积 (哈尔滨工业大学复试上机题) http://t.cn/Aip450PJ https://github.com/BenedictYoung/Lecture/blob/master/Chapter6/6.11.cpp
例题6.12 矩阵幂 (北京邮电大学复试上机题) http://t.cn/Aip4T3HX https://github.com/BenedictYoung/Lecture/blob/master/Chapter6/6.12.cpp
例题6.13 a+b (华中科技大学复试上机题) http://t.cn/AipaWiSG https://github.com/BenedictYoung/Lecture/blob/master/Chapter6/6.13.cpp
例题6.14 N的阶乘 (清华大学复试上机题) http://t.cn/AipaBKQJ https://github.com/BenedictYoung/Lecture/blob/master/Chapter6/6.14.cpp
例题7.1 鸡兔同笼 (北京大学复试上机题) http://t.cn/E9ewERU https://github.com/BenedictYoung/Lecture/blob/master/Chapter7/7.1.cpp
例题7.2 FatMouse' Trade (HDU 1009) http://acm.hdu.edu.cn/showproblem.php?pid=1009 https://github.com/BenedictYoung/Lecture/blob/master/Chapter7/7.2.cpp
例题7.3 Senior's Gun (HDU 5281) http://acm.hdu.edu.cn/showproblem.php?pid=5281 https://github.com/BenedictYoung/Lecture/blob/master/Chapter7/7.3.cpp
例题7.4 今年暑假不AC (HDU 2037) http://acm.hdu.edu.cn/showproblem.php?pid=2037 https://github.com/BenedictYoung/Lecture/blob/master/Chapter7/7.4.cpp
例题7.5 Case of Fugitive (Codeforces 555B) http://codeforces.com/problemset/problem/555/B https://github.com/BenedictYoung/Lecture/blob/master/Chapter7/7.5.cpp
例题8.1 n的阶乘 (清华大学复试上机题) http://t.cn/Ai0ocOUY https://github.com/BenedictYoung/Lecture/blob/master/Chapter8/8.1.cpp
例题8.2 汉诺塔Ⅲ (HDU 2064) http://acm.hdu.edu.cn/showproblem.php?pid=2064 https://github.com/BenedictYoung/Lecture/blob/master/Chapter8/8.2.cpp
例题8.3 Fibonacci (上海交通大学复试上机题) http://t.cn/Ai0K3tU5 https://github.com/BenedictYoung/Lecture/blob/master/Chapter8/8.3.cpp
例题8.4 二叉树 (北京大学复试上机题 ) http://t.cn/Ai0Ke6I0 https://github.com/BenedictYoung/Lecture/blob/master/Chapter8/8.4.cpp
例题9.1 Catch That Cow (POJ 3278) http://poj.org/problem?id=3278 https://github.com/BenedictYoung/Lecture/blob/master/Chapter9/9.1.cpp
例题9.2 Find The Multiple (POJ 1426) http://poj.org/problem?id=1426 https://github.com/BenedictYoung/Lecture/blob/master/Chapter9/9.2.cpp
例题9.3 A Knights's Journey (POJ 2488) http://poj.org/problem?id=2488 https://github.com/BenedictYoung/Lecture/blob/master/Chapter9/9.3.cpp
例题9.4 Square (POJ 2362) http://poj.org/problem?id=2362 https://github.com/BenedictYoung/Lecture/blob/master/Chapter9/9.4.cpp
例题10.1 二叉树遍历 (清华大学复试上机题) http://t.cn/AiKuUTlX https://github.com/BenedictYoung/Lecture/blob/master/Chapter10/10.1.cpp
例题10.2 二叉树遍历 (华中科技大学复试上机题) http://t.cn/AiKgDfLU https://github.com/BenedictYoung/Lecture/blob/master/Chapter10/10.2.cpp
例题10.3 二叉排序树 (华中科技大学复试上机题) http://t.cn/Ai9PAkkv https://github.com/BenedictYoung/Lecture/blob/master/Chapter10/10.3.cpp
例题10.4 二叉排序树 (华中科技大学复试上机题) http://t.cn/AiKD0L5V https://github.com/BenedictYoung/Lecture/blob/master/Chapter10/10.4.cpp
例题10.5 复数集合 (北京邮电大学复试上机题) http://t.cn/Ai98yYlt https://github.com/BenedictYoung/Lecture/blob/master/Chapter10/10.5.cpp
例题10.6 哈夫曼树 (北京邮电大学复试上机题) http://t.cn/AiCuGMki https://github.com/BenedictYoung/Lecture/blob/master/Chapter10/10.6.cpp
例题10.7 查找学生信息 (清华大学复试上机题) http://t.cn/AiCuVIuY https://github.com/BenedictYoung/Lecture/blob/master/Chapter10/10.7.cpp
例题10.8 魔咒词典 (浙江大学复试上机题) http://t.cn/AiCufczt https://github.com/BenedictYoung/Lecture/blob/master/Chapter10/10.8.cpp
例题10.9 字串计算 (北京大学复试上机题) http://t.cn/AiCuJtI5 https://github.com/BenedictYoung/Lecture/blob/master/Chapter10/10.9.cpp
例题11.1 畅通工程 (浙江大学复试上机题) http://t.cn/AiOvBHj9 https://github.com/BenedictYoung/Lecture/blob/master/Chapter11/11.1.cpp
例题11.2 连通图 (吉林大学复试上机题) http://t.cn/AiO77VoA https://github.com/BenedictYoung/Lecture/blob/master/Chapter11/11.2.cpp
例题11.3 Is It A Tree? (北京大学复试上机题) http://t.cn/AiO7FyDO https://github.com/BenedictYoung/Lecture/blob/master/Chapter11/11.3.cpp
例题11.4 还是畅通工程 (浙江大学复试上机题) http://t.cn/AiWud0C6 https://github.com/BenedictYoung/Lecture/blob/master/Chapter11/11.4.cpp
例题11.5 继续畅通工程 (浙江大学复试上机题) http://t.cn/AiW3fcfp https://github.com/BenedictYoung/Lecture/blob/master/Chapter11/11.5.cpp
例题11.6 畅通工程续 (浙江大学复试上机题) http://acm.hdu.edu.cn/showproblem.php?pid=1874 https://github.com/BenedictYoung/Lecture/blob/master/Chapter11/11.6.cpp
例题11.7 最短路径问题 (浙江大学复试上机题) http://t.cn/AilPbME2 https://github.com/BenedictYoung/Lecture/blob/master/Chapter11/11.7.cpp
例题11.8 Legal or Not (HDU 3342) http://acm.hdu.edu.cn/showproblem.php?pid=3342 https://github.com/BenedictYoung/Lecture/blob/master/Chapter11/11.8.cpp
例题11.9 确定比赛名次 (HUD 1285) http://acm.hdu.edu.cn/showproblem.php?pid=1285 https://github.com/BenedictYoung/Lecture/blob/master/Chapter11/11.9.cpp
例题11.10 Instructions Arrangement (HDU 4109) http://acm.hdu.edu.cn/showproblem.php?pid=4109 https://github.com/BenedictYoung/Lecture/blob/master/Chapter11/11.10.cpp
例题11.11 p3 (清华大学复试上机题) https://github.com/BenedictYoung/Lecture/blob/master/Chapter11/11.11.cpp
例题12.1 N阶楼梯上楼问题 (华中科技大学复试上机题) http://t.cn/Aij9Fr3V https://github.com/BenedictYoung/Lecture/blob/master/Chapter12/12.1.cpp
例题12.2 最大序列和 (清华大学复试上机题) http://t.cn/AiYSlQMU https://github.com/BenedictYoung/Lecture/blob/master/Chapter12/12.2.cpp
例题12.3 最大子矩阵 (北京大学复试上机题) http://t.cn/AiYSemJz https://github.com/BenedictYoung/Lecture/blob/master/Chapter12/12.3.cpp
例题12.4 拦截导弹 (北京大学复试上机题) http://t.cn/AiYCeV3m https://github.com/BenedictYoung/Lecture/blob/master/Chapter12/12.4.cpp
例题12.5 最长上升子序列和 (北京大学复试上机题) http://t.cn/AiYNAGD3 https://github.com/BenedictYoung/Lecture/blob/master/Chapter12/12.5.cpp
例题12.6 Common Subsequence (HDU 1159) http://acm.hdu.edu.cn/showproblem.php?pid=1159 https://github.com/BenedictYoung/Lecture/blob/master/Chapter12/12.6.cpp
例题12.7 点菜问题 (北京大学复试上机题) http://t.cn/AiYOrkXr https://github.com/BenedictYoung/Lecture/blob/master/Chapter12/12.7.cpp
例题12.8 Piggy-Bank (HDU 1114) http://acm.hdu.edu.cn/showproblem.php?pid=1114 https://github.com/BenedictYoung/Lecture/blob/master/Chapter12/12.8.cpp
例题12.9 珍惜现在,感恩生活 (HDU 2191) http://acm.hdu.edu.cn/showproblem.php?pid=2191 https://github.com/BenedictYoung/Lecture/blob/master/Chapter12/12.9.cpp
例题12.10 The Triangle (POJ 1163) http://poj.org/problem?id=1163 https://github.com/BenedictYoung/Lecture/blob/master/Chapter12/12.10.cpp
例题12.11 Monkey Banana problemset (LightOJ 1104) http://lightoj.com/volume_showproblem.php?problem=1004 https://github.com/BenedictYoung/Lecture/blob/master/Chapter12/12.11.cpp