├── README.md ├── why-ustc.md ├── 机试历年真题 ├── 2006 │ ├── 2.cpp │ ├── 3.cpp │ ├── 4.cpp │ ├── 5.cpp │ ├── 6.cpp │ ├── expr.in │ ├── graph.in │ ├── number.in │ └── number.out ├── 2007 │ ├── 1.cpp │ ├── 2.cpp │ ├── 3.cpp │ ├── 3.in │ ├── 4.cpp │ └── 4.in ├── 2008 │ ├── 1.cpp │ ├── 3.in │ ├── 4.cpp │ └── 4.in ├── 2009 │ ├── 1.cpp │ ├── 2.cpp │ ├── 3.cpp │ └── tree.in ├── 2010 │ ├── 1.cpp │ ├── 3.cpp │ └── input.txt ├── 2011 │ ├── 1.cpp │ ├── 2.cpp │ ├── 3.cpp │ ├── 3.txt │ ├── 4.cpp │ ├── 4.out │ └── 4.txt ├── 2012 │ ├── 1.cpp │ ├── 2.cpp │ ├── 3.cpp │ ├── 4.cpp │ ├── 5.cpp │ ├── number.in │ ├── road.in │ ├── string.in │ ├── task.in │ └── ticket.in ├── 2013 │ ├── 1.cpp │ ├── 1.in │ ├── 2.cpp │ ├── 2.in │ ├── 3.cpp │ ├── 3.in │ ├── 4.cpp │ ├── 4.in │ ├── 5.cpp │ ├── 5.in │ ├── 6.cpp │ ├── 6.in │ ├── 7.cpp │ └── 7.in ├── 2014 │ ├── 1.cpp │ ├── 2.cpp │ ├── 4.cpp │ └── graph.in ├── 2015 │ ├── 1.cpp │ ├── 2.cpp │ ├── 3.cpp │ ├── 4.cpp │ ├── input_3.txt │ └── input_4.txt ├── 2016 │ ├── 1.cpp │ ├── 2.cpp │ ├── 3.cpp │ ├── 4.cpp │ └── 4.in ├── 2017 │ ├── 1.cpp │ ├── 2.cpp │ ├── 3.cpp │ ├── 4.cpp │ ├── input1.txt │ ├── input3.txt │ └── input4.txt ├── 2018 │ ├── 1.cpp │ ├── 2.cpp │ ├── 3.cpp │ ├── 4.cpp │ ├── 4_2.cpp │ ├── input2.txt │ ├── input3.txt │ └── input4.txt ├── 2019 │ ├── 1.cpp │ ├── 2.cpp │ ├── 3.cpp │ ├── 4.cpp │ ├── 5.cpp │ ├── 5_2.cpp │ ├── pre.in │ ├── set.in │ └── tree.in ├── 2020 │ ├── 1.cpp │ ├── 2.cpp │ ├── 3.cpp │ ├── array.in │ └── number.in └── 2021 │ ├── 1.cpp │ ├── 2.cpp │ ├── 3.cpp │ └── 4.cpp ├── 笔试历年真题 ├── .DS_Store ├── 2003.doc ├── 2004.doc ├── 2005.doc ├── 2006.doc ├── 2007.doc ├── 2008.doc ├── 2009-2012年中科大计算机考研复试笔试试题.pdf ├── 2009.doc ├── 2010.doc ├── 2013.pdf ├── 2015科大(中国科技大学)复试真题.doc ├── 2016复试.docx ├── 2018复试考试范围.docx └── 笔试整理.docx └── 面试经验 └── 面试经验.docx /README.md: -------------------------------------------------------------------------------- 1 | # 中科大计算机复试详解 2 | 3 | + [一. 介绍](#一-介绍) 4 | + [二. 机试部分](#二-机试部分) 5 | + [1.1 机试介绍](#11-机试介绍) 6 | + [1.2 历年机试题详解](#12-历年机试题详解) 7 | + [1.3 如何准备机试](#13-如何准备机试) 8 | + [三. 笔试部分](#三-笔试部分) 9 | + [3.1 笔试介绍](#31-笔试介绍) 10 | + [3.2 如何准备笔试](#32-如何准备笔试) 11 | + [四. 面试部分](#四-面试部分) 12 | + [4.1 面试介绍](#41-面试介绍) 13 | + [4.2 如何准备面试](#42-如何准备面试) 14 | + [五. 后记](#五-后记) 15 | + [六. 帮助](#六-帮助) 16 | 17 | ## 一. 介绍 18 | 19 | 中国科学技术大学计算机专业考研复试主要包含三个方面:机试、笔试和面试,接下来会从这三个方向进行介绍。 20 | 21 | 本仓库中包含4个文件夹,文件夹的内容如下所示: 22 | 23 | ``` 24 | ├── 机试历年真题 # 2006~2021年的我的机试代码 25 | ├── 笔试历年真题 # 可以搜集到的历年笔试真题 26 | ├── 面试经验 # 上岸学长学姐的面试经验总结 27 | ``` 28 | 29 | **注**:本文只包含对于**中科大计算机**中**考研复试**内容的介绍,不包含考研初试。 30 | 31 | ## 二. 机试部分 32 | 33 | ### 1.1 机试介绍 34 | 35 | 科大的机试部分一般是在复试时到科大的机房中上机考试,学校会在考试时给你上机的电脑中发送一个文件夹,文件夹中有题目描述,完成所有题目后将所有代码压缩打包后上交。代码要求用`C/C++`编写,上机环境的可以是`CodeBlocks`、`Dev C++`或`Visual Studio`。 36 | 37 | 但是由于疫情原因,在2020年和2021年复试采用了线上的方式,所以形式就改为了复试网络平台中(zoom或腾讯会议)中将题目发给你,在摄像头面前手写所有代码,完成后将代码拍照并且转为pdf文件上交。 38 | 39 | 机试的风格类似OJ,但是题目描述一般比较简短(不会像有的oj那样让你做阅读理解的),题目数量因年而异,一般是四道题,难度一般不会太简单(2020年和2021年由于采用了线上所以比较白给)。 40 | 41 | ### 1.2 历年机试题详解 42 | 43 | 笔者在备考的过程中完成了历年所有的机试题目,并且编写了机试详解,包含试题、代码和解析,文章链接如下所示,其中所有的代码都用`C++`编写。 44 | 45 | 文章存储在`github pages`上,没有`科学上网`的同学可能访问比较慢,请耐心等待。 46 | 47 | + [2006年机试题详解](https://zdszero.github.io/ustc-graduate-guide/posts/ustc-test-2006/) 48 | + [2007年机试题详解](https://zdszero.github.io/ustc-graduate-guide/posts/ustc-test-2007/) 49 | + [2008年机试题详解](https://zdszero.github.io/ustc-graduate-guide/posts/ustc-test-2008/) 50 | + [2009年机试题详解](https://zdszero.github.io/ustc-graduate-guide/posts/ustc-test-2009/) 51 | + [2010年机试题详解](https://zdszero.github.io/ustc-graduate-guide/posts/ustc-test-2010/) 52 | + [2011年机试题详解](https://zdszero.github.io/ustc-graduate-guide/posts/ustc-test-2011/) 53 | + [2012年机试题详解](https://zdszero.github.io/ustc-graduate-guide/posts/ustc-test-2012/) 54 | + [2013年机试题详解](https://zdszero.github.io/ustc-graduate-guide/posts/ustc-test-2013/) 55 | + [2014年机试题详解](https://zdszero.github.io/ustc-graduate-guide/posts/ustc-test-2014/) 56 | + [2015年机试题详解](https://zdszero.github.io/ustc-graduate-guide/posts/ustc-test-2015/) 57 | + [2016年机试题详解](https://zdszero.github.io/ustc-graduate-guide/posts/ustc-test-2016/) 58 | + [2017年机试题详解](https://zdszero.github.io/ustc-graduate-guide/posts/ustc-test-2017/) 59 | + [2018年机试题详解](https://zdszero.github.io/ustc-graduate-guide/posts/ustc-test-2018/) 60 | + [2019年机试题详解](https://zdszero.github.io/ustc-graduate-guide/posts/ustc-test-2019/) 61 | + [2020年机试题详解](https://zdszero.github.io/ustc-graduate-guide/posts/ustc-test-2020/) 62 | + [2021年机试题详解](https://zdszero.github.io/ustc-graduate-guide/posts/ustc-test-2021/) 63 | 64 | ### 1.3 如何准备机试 65 | 66 | 如果你看完上述所有的机试详解,你就会发现有些年份题目并不简单,但仔细观察也会发现如下特点: 67 | + 试题会考察数据结构书中所提到的经典算法。 68 | + 试题会考察常见的算法思想。 69 | + 试题常常会有文件I/O的部分,并且有时会涉及比较麻烦的输入输出处理。 70 | 71 | 所以你需要熟练掌握`数据结构`书中的以下的**算法原理**和**代码实现**: 72 | + 队列和栈相关 73 | + 前缀、中缀、后缀表达式求值 74 | + 中缀转前缀、中缀转后缀 75 | + 树相关 76 | + 根据前序、中序、后序遍历序列中的两个构建二叉树 77 | + 根据完整的遍历序列(包含空结点)构建二叉树 78 | + 哈夫曼树的构建,如何得到哈夫曼编码 79 | + 图相关 80 | + 深度优先遍历、广度优先遍历 81 | + 最小生成树的算法 82 | + 最短路径 83 | + 拓朴排序 84 | + 搜索和排序相关 85 | + 快速排序 86 | 87 | 同时学习以下**算法思想**: 88 | + 熟练掌握典型的`回溯`算法,历年试题有考察到如八皇后、子集划分等算法。 89 | + 了解基本的`动态规划`思想,历年试题有考察到如最长递增子序列、最大连续子序列等算法。 90 | 91 | 并且熟悉`C/C++`中的**I/O用法**,能够: 92 | + 根据根据给定的文件构建二叉树、图的数据结构 93 | + 按照指定的要求将结果输出到文件或控制台 94 | 95 | ## 三. 笔试部分 96 | 97 | ### 3.1 笔试介绍 98 | 99 | `科计`的笔试一直是复试中难度最大的点之一,也是众多考生放弃报考科大计算机的重要原因。其中包含对以下四门课的考察:计算机体系结构、编译原理、数据库、离散数学。从初试408的四门专业课,到复试笔试中难度更大的四门,科计考生在整个考研过程中几乎将整个大学的专业课全部以更高的难度重考了一遍,可以说是**太扎实了!** 100 | 101 | 但是2020年和2021年由于疫情原因采取线上复试,笔试直接取消,复试难度直线下降。 102 | 103 | ### 3.2 如何准备笔试 104 | 105 | 首先你需要确定你报考的当年是否有笔试,如果没有的话就不需要大废工夫准备了,关于复试具体安排请参考当年的[招生简章](https://yz.ustc.edu.cn/zsjz_index/index.htm)。 106 | 107 | 笔试部分的参考书籍如下所示,建议在考完研的寒假认真阅读书籍并完成历年笔试真题(如果要考笔试的话寒假千万不要摸鱼,不然寒假过后准备时间肯定不够),如果还有空的话可以参考网上的答案完成参考书籍的课后习题。建议优先掌握离散数学、数据库、计算机体系结构的知识,相比编译原理更为简单,编译原理如果没空的话只阅读词法分析和语法分析章节即可,可以覆盖笔试考察的大部分内容。 108 | 109 | ``` 110 | 1)方世昌,离散数学(第三版),西安电子科技大学出版,2009年版。 111 | 2)陈意云、张昱,编译原理(第2版),高等教育出版社,2008年版(或2003年版)。 112 | 3)陈火旺、刘春林、谭庆平、赵克佳、刘越,程序设计语言编译原理(第3版),国防工业出版社,2006年版。 113 | 4)王珊,萨师煊,数据库系统概论(第五版),高等教育出版社,2014年版。 114 | 5)张晨曦、王志英、沈立、刘侬编著,计算机系统结构教程,清华大学出版社2009年版。 115 | ``` 116 | 117 | 最后,在复习的过程中不要只看书,不做题,看书的同时一定要完成章节内的相关习题以及真题中的相关试题。 118 | 119 | ## 四. 面试部分 120 | 121 | ### 4.1 面试介绍 122 | 123 | 面试的流程一般是这样: 124 | + 英文自我介绍 125 | + 用英文解释常见的计算机专业词汇 126 | + 老师向你提问(专业问题) 127 | 128 | ### 4.2 如何准备面试 129 | 130 | 英语介绍怎么写这里就不多讲了,网上一找一大堆,就是注意不要用太华丽的辞藻,能逻辑清晰地介绍自己就可以。 131 | 132 | 关于计算机专业词汇的英文,掌握常用的即可,包含一般的计算机方向以及课程内的一些词汇。比如笔者在面试时被问答如下几个问题:编译器-`compiler`,分布式计算-`distributed computation`,物联网-`Internet of things`。 133 | 134 | 专业面试的范畴就比较广了,一般老师会先问你擅长哪些科目,然后会提问你擅长科目的一些问题。具体会问哪种风格问题可以参考项目目录`面试经验`中的经验总结,其中有各式各样的问题,面试问题前些年考过的之后也往往会考,可以选择一些科目认真准备一下。 135 | 136 | 还有一个有技巧的点是你可以引着老师问特定方向的问题,比如老师问你最喜欢什么科目,笔者当时的回答是最`喜欢编译原理,并且我毕业设计也是做得相关内容`,这时候老师就很有可能问你毕业设计中的内容,就可以趁机多讲一讲毕业设计的内容。总体的面试时间不会太长,一般是15~20分钟,多准备一些话题和老师闲扯一下,老师问的`干货问题`也就会少很多了,大家可以把握一下。 137 | 138 | ## 五. 后记 139 | 140 | [为什么报考科大](./why-ustc.md) 141 | 142 | ## 六. 帮助 143 | 144 | 如果这个项目对你有帮助的话,请给它一个**star**,并且将它推荐给你周围报考科大计算机的人! 145 | 146 | 另外如果你有其他复试资料的话,可以向这个仓库提交**PR**,这样可以帮助到更多的人。 147 | -------------------------------------------------------------------------------- /why-ustc.md: -------------------------------------------------------------------------------- 1 | # 为什么报考科大? 2 | 3 | 关于科大多么优秀,笔者在这里就不详细讲了,`科吹`人数不少,建议大家去找他们聊一聊。 4 | 5 | 笔者一直非常尊敬[方励之](https://program-think.blogspot.com/2012/04/fang-lizhi-and-fang-binxing.html)校长,在仔细了解那些年的历史和阅读了方励之的文章之后,更是佩服得不行,在此过程中也对科大建立起憧憬。除此之外,科大初试成绩不计政治(达到国家线即可)、复试不需要政审表,也与笔者的价值观一致,因此就决定了报考科大。 6 | 7 | 有人说科计的考研难度太大,所以更愿意报考那些难度更低的院校。这个问题其实可以从另一个角度看,当考试考察得很全面时,如果你的基础更为扎实,付出的努力更多,你上岸的机会和**稳定性**也就越大。另外,当周围的同学都是基础扎实的大佬时,你可以学习对象也就更多,也肯定更有利于你的进一步成长。 8 | 9 | 笔者在写下这篇文章时,刚刚学习计算机两年三个月,从一个迷茫且不爱学习的土木狗,到找到感兴趣的方向并成功上岸科计,其中的努力和汗水必不可少。 10 | 11 | 最后引用方励之先生的一句话,希望与各位报考科大的研友共同努力,去努力实现自己的目标。 12 | 13 | > 人生的价值在不断的追求之中。追求自然的和谐,追求身心的完美,追求思想的超越。 14 | -------------------------------------------------------------------------------- /机试历年真题/2006/2.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | // [_a-zA-Z][_a-zA-Z0-9]* 5 | bool isValid(const string &s) { 6 | int i = 0; 7 | if (!(isalpha(s[i]) || s[i] == '_')) 8 | return false; 9 | for (++i; i < s.length(); i++) { 10 | if (!(isalpha(s[i]) || isdigit(s[i]) || s[i] == '_')) 11 | return false; 12 | } 13 | return true; 14 | } 15 | 16 | int main(int argc, char *argv[]) { 17 | string s; 18 | cin >> s; 19 | cout << isValid(s) << endl; 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /机试历年真题/2006/3.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | using namespace std; 6 | 7 | int main(int argc, char *argv[]) { 8 | ifstream ifs("./expr.in"); 9 | ofstream ofs("./expr.out"); 10 | vector v; 11 | stack opStk; 12 | unordered_map priority; 13 | priority['('] = 0; 14 | priority['+'] = priority['-'] = 1; 15 | priority['*'] = priority['/'] = 2; 16 | char c; 17 | while (ifs >> c) 18 | v.push_back(c); 19 | for (char c : v) { 20 | if (isalpha(c)) { 21 | ofs << c; 22 | continue; 23 | } 24 | if (c == '(') { 25 | opStk.push('('); 26 | continue; 27 | } 28 | if (c == ')') { 29 | char ch; 30 | while (1) { 31 | ch = opStk.top(); 32 | opStk.pop(); 33 | if (ch == '(') 34 | break; 35 | ofs << ch; 36 | }; 37 | continue; 38 | } 39 | while (!opStk.empty() && priority[c] < priority[opStk.top()]) { 40 | char op = opStk.top(); 41 | opStk.pop(); 42 | ofs << op; 43 | } 44 | opStk.push(c); 45 | } 46 | while (!opStk.empty()) { 47 | char ch = opStk.top(); 48 | opStk.pop(); 49 | ofs << ch; 50 | } 51 | return 0; 52 | } 53 | -------------------------------------------------------------------------------- /机试历年真题/2006/4.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main(int argc, char *argv[]) { 5 | int m, n; 6 | cin >> m >> n; 7 | for (int i = 1; i <= n-2; i++) { 8 | for (int j = i+1; j <= n-1; j++) { 9 | for (int k = j+1; k <= n; k++) { 10 | printf("%d %d %d\n", i, j, k); 11 | } 12 | } 13 | } 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /机试历年真题/2006/5.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | using namespace std; 4 | 5 | int dfs(vector> &g, vector &vis, vector &tmp, int idx, 6 | int n) { 7 | if (vis[idx]) 8 | return 0; 9 | vis[idx] = 1; 10 | tmp.push_back(idx); 11 | int ans = 1; 12 | for (int i = 0; i < n; i++) { 13 | if (g[idx][i]) { 14 | ans += dfs(g, vis, tmp, i, n); 15 | } 16 | } 17 | return ans; 18 | } 19 | 20 | int main(int argc, char *argv[]) { 21 | ifstream ifs("./graph.in"); 22 | ofstream ofs("./graph.out"); 23 | int n, m; 24 | ifs >> n >> m; 25 | vector> g(n, vector(n, 0)); 26 | vector vis(n, 0); 27 | vector ans, tmp; 28 | int maxval = 0; 29 | for (int i = 0; i < m; i++) { 30 | int a, b; 31 | ifs >> a >> b; 32 | g[a][b] = g[b][a] = 1; 33 | } 34 | for (int i = 0; i < n; i++) { 35 | if (vis[i]) 36 | continue; 37 | int tmpval = dfs(g, vis, tmp, i, n); 38 | if (tmpval > maxval) { 39 | maxval = tmpval; 40 | ans = tmp; 41 | } 42 | tmp.clear(); 43 | } 44 | for (int i = 0; i < ans.size(); i++) { 45 | if (i) 46 | ofs << " "; 47 | ofs << ans[i]; 48 | } 49 | return 0; 50 | } 51 | -------------------------------------------------------------------------------- /机试历年真题/2006/6.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | using namespace std; 4 | 5 | int main(int argc, char *argv[]) { 6 | ifstream ifs("./number.in"); 7 | ofstream ofs("./number.out"); 8 | vector nums; 9 | int num; 10 | while (ifs >> num) nums.push_back(num); 11 | int ans = nums[0]; 12 | for (int i = 1; i < nums.size(); i++) { 13 | nums[i] += max(nums[i-1], 0); 14 | ans = max(ans, nums[i]); 15 | } 16 | ofs << ans; 17 | } 18 | -------------------------------------------------------------------------------- /机试历年真题/2006/expr.in: -------------------------------------------------------------------------------- 1 | a-b*(c+d) 2 | -------------------------------------------------------------------------------- /机试历年真题/2006/graph.in: -------------------------------------------------------------------------------- 1 | 10 6 2 | 0 1 3 | 0 2 4 | 4 5 5 | 4 6 6 | 5 7 7 | 8 9 8 | -------------------------------------------------------------------------------- /机试历年真题/2006/number.in: -------------------------------------------------------------------------------- 1 | -2 1 -3 4 -1 2 1 -5 4 2 | -------------------------------------------------------------------------------- /机试历年真题/2006/number.out: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /机试历年真题/2007/1.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | bool isPalindrome(const string &s) { 5 | int i = 0, j = s.length()-1; 6 | while (i < j) { 7 | if (s[i++] != s[j--]) 8 | return false; 9 | } 10 | return true; 11 | } 12 | 13 | int main(int argc, char *argv[]) { 14 | string tmp; 15 | while (cin >> tmp) { 16 | if (isPalindrome(tmp)) 17 | cout << "Y" << endl; 18 | else 19 | cout << "N" << endl; 20 | } 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /机试历年真题/2007/2.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | using namespace std; 4 | 5 | int main(int argc, char *argv[]) { 6 | int n; 7 | cin >> n; 8 | queue q; 9 | for (int i = 1; i <= n; i++) q.push(i); 10 | int cnt = 1, flag = 0; 11 | while (!q.empty()) { 12 | if (cnt == 1) { 13 | if (flag) cout << " "; 14 | flag = 1; 15 | cout << q.front(); 16 | q.pop(); 17 | cnt = 2; 18 | } else { 19 | q.push(q.front()); 20 | q.pop(); 21 | cnt = 1; 22 | } 23 | } 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /机试历年真题/2007/3.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | using namespace std; 6 | 7 | struct Edge { 8 | int src, dst, weight; 9 | Edge(int src, int dst, int weight) : src(src), dst(dst), weight(weight) {} 10 | }; 11 | 12 | struct Cmp { 13 | bool operator()(const Edge &lhs, const Edge &rhs) { 14 | return lhs.weight > rhs.weight; 15 | } 16 | }; 17 | 18 | int main(int argc, char *argv[]) { 19 | ifstream ifs("./3.in"); 20 | int n; 21 | ifs >> n; 22 | vector subset(n+1, 0); 23 | int MaxIdx = 1; 24 | priority_queue, Cmp> edges; 25 | vector mst; 26 | int a, b, c; 27 | while (ifs >> a >> b >> c) { 28 | edges.push(Edge(a, b, c)); 29 | } 30 | while (!edges.empty() && mst.size() < n-1) { 31 | Edge e = edges.top(); 32 | edges.pop(); 33 | int set1 = subset[e.src], set2 = subset[e.dst]; 34 | if (!set1 && !set2) { 35 | subset[e.src] = subset[e.dst] = MaxIdx++; 36 | } else if (set1 && set2) { 37 | if (set1 == set2) 38 | continue; 39 | for (auto &s : subset) 40 | if (s == set2) 41 | s = set1; 42 | } else { 43 | if (!set1) subset[e.src] = set2; 44 | if (!set2) subset[e.dst] = set1; 45 | } 46 | mst.push_back(e); 47 | } 48 | for (auto &e : mst) { 49 | printf("%d -- %d : %d\n", e.src, e.dst, e.weight); 50 | } 51 | return 0; 52 | } 53 | -------------------------------------------------------------------------------- /机试历年真题/2007/3.in: -------------------------------------------------------------------------------- 1 | 9 2 | 7 6 1 3 | 8 2 2 4 | 6 5 2 5 | 0 1 4 6 | 2 5 4 7 | 8 6 6 8 | 2 3 7 9 | 7 8 7 10 | 0 7 8 11 | 1 2 8 12 | 3 4 9 13 | 5 4 10 14 | 1 7 11 15 | 3 5 14 16 | -------------------------------------------------------------------------------- /机试历年真题/2007/4.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | using namespace std; 4 | 5 | int flag = 0; 6 | 7 | struct TreeNode { 8 | TreeNode *lchild, *rchild; 9 | char val; 10 | TreeNode(char val) : val(val) {} 11 | }; 12 | 13 | TreeNode *buildTree(vector &in, vector &post) { 14 | auto make = [&](auto &&self, int l1, int r1, int l2, int r2) -> TreeNode *{ 15 | if (l1 > r1) 16 | return nullptr; 17 | TreeNode *t = new TreeNode(post[r2]); 18 | int i; 19 | for (i = l1; i <= r1; i++) 20 | if (in[i] == post[r2]) 21 | break; 22 | t->lchild = self(self, l1, i-1, l2, l2+i-1-l1); 23 | t->rchild = self(self, i+1, r1, l2+i-l1, r2-1); 24 | return t; 25 | }; 26 | return make(make, 0, in.size()-1, 0, post.size()-1); 27 | } 28 | 29 | void inOrder(TreeNode *t, ostream &os) { 30 | if (!t) 31 | return; 32 | inOrder(t->lchild, os); 33 | if (flag) os << " "; 34 | os << t->val; 35 | flag = 1; 36 | inOrder(t->rchild, os); 37 | } 38 | 39 | int main(int argc, char *argv[]) { 40 | ifstream ifs("./4.in"); 41 | ofstream ofs("./4.out"); 42 | int n; 43 | ifs >> n; 44 | vector in(n); 45 | vector post(n); 46 | for (int i = 0; i < n; i++) ifs >> in[i]; 47 | for (int i = 0; i < n; i++) ifs >> post[i]; 48 | TreeNode *root = buildTree(in, post); 49 | inOrder(root, ofs); 50 | return 0; 51 | } 52 | -------------------------------------------------------------------------------- /机试历年真题/2007/4.in: -------------------------------------------------------------------------------- 1 | 5 2 | D B A C E 3 | D B E C A 4 | -------------------------------------------------------------------------------- /机试历年真题/2008/1.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main(int argc, char *argv[]) { 5 | int num, cnt = 0; 6 | cin >> num; 7 | for (int i = 0; i < 32; i++) { 8 | cnt += (num & 1); 9 | num >>= 1; 10 | } 11 | cout << cnt; 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /机试历年真题/2008/3.in: -------------------------------------------------------------------------------- 1 | 3 3 3 2 2 | 2 3 2 3 | 3 1 2 4 | 1 2 1 5 | 1 1 6 | 2 2 7 | 3 3 8 | -------------------------------------------------------------------------------- /机试历年真题/2008/4.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | using namespace std; 5 | 6 | int main(int argc, char *argv[]) { 7 | ifstream ifs("./4.in"); 8 | map occMap; 9 | string tmp; 10 | while (ifs >> tmp) { 11 | occMap[tmp]++; 12 | } 13 | for (auto it : occMap) { 14 | cout << it.first << " " << it.second << endl; 15 | } 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /机试历年真题/2008/4.in: -------------------------------------------------------------------------------- 1 | I am 2 | a student from china 3 | china 4 | am student 5 | -------------------------------------------------------------------------------- /机试历年真题/2009/1.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main(int argc, char *argv[]) { 5 | int16_t num; 6 | cin >> num; 7 | num = (num ^ (num >> 4) ^ (num >> 8) ^ (num >> 12)) & 0x000f; 8 | cout << num << endl; 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /机试历年真题/2009/2.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | using namespace std; 5 | 6 | int main(int argc, char *argv[]) { 7 | int n; 8 | cin >> n; 9 | vector a(n); 10 | for (int i = 0; i < n; i++) { 11 | cin >> a[i]; 12 | } 13 | sort(a.begin(), a.end()); 14 | cout << a[n/2] << endl; 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /机试历年真题/2009/3.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | using namespace std; 5 | 6 | int depth; 7 | int flag = 0; 8 | 9 | struct TreeNode { 10 | TreeNode *lchild, *rchild; 11 | char val; 12 | TreeNode(char val) : val(val) {} 13 | }; 14 | 15 | TreeNode *buildTree(vector &v, int &idx) { 16 | if (v[idx] == '0') return nullptr; 17 | TreeNode *t = new TreeNode(v[idx]); 18 | t->lchild = buildTree(v, ++idx); 19 | t->rchild = buildTree(v, ++idx); 20 | return t; 21 | } 22 | 23 | int getDepth(TreeNode *t) { 24 | if (!t) return 0; 25 | return max(getDepth(t->lchild), getDepth(t->rchild)) + 1; 26 | } 27 | 28 | void postOrder(TreeNode *t, int dep) { 29 | if (!t) return; 30 | postOrder(t->lchild, dep + 1); 31 | if (dep <= depth / 2) { 32 | if (flag) cout << " "; 33 | flag = 1; 34 | cout << t->val; 35 | } 36 | postOrder(t->rchild, dep + 1); 37 | } 38 | 39 | int main(int argc, char *argv[]) { 40 | ifstream ifs("./tree.in"); 41 | char c; 42 | vector v; 43 | while (ifs >> c) v.push_back(c); 44 | int idx = 0; 45 | TreeNode *root = buildTree(v, idx); 46 | depth = getDepth(root); 47 | postOrder(root, 1); 48 | return 0; 49 | } 50 | -------------------------------------------------------------------------------- /机试历年真题/2009/tree.in: -------------------------------------------------------------------------------- 1 | ABC00DE0000 2 | -------------------------------------------------------------------------------- /机试历年真题/2010/1.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | using namespace std; 5 | 6 | int main(int argc, char *argv[]) { 7 | list lines; 8 | string tmp; 9 | ifstream ifs("./input.txt"); 10 | while (getline(ifs, tmp)) 11 | lines.push_back(tmp); 12 | for (auto it = lines.begin(); it != lines.end(); it++) { 13 | for (int i = 0; i < it->length(); i++) { 14 | if (it->at(i) == '!' && i > 0) 15 | (*it)[i-1] = '0'; 16 | else if (it->at(i) == '*') 17 | lines.erase(prev(it)); 18 | else if (it->at(i) == '>') { 19 | int j; 20 | for (j = i-1; j >= 0 && it->at(j) != ' '; j--); 21 | for (; j >= 0 && it->at(j) == ' '; j--); 22 | if (j < 0) 23 | continue; 24 | for (; j >= 0 && it->at(j) != ' '; j--); 25 | (*it)[j+1] = toupper((*it)[j+1]); 26 | } 27 | } 28 | } 29 | for (auto &s : lines) { 30 | for (auto c : s) { 31 | if (isalpha(c) || c == ' ') 32 | cout << c; 33 | } 34 | cout << endl; 35 | } 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /机试历年真题/2010/3.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | struct TreeNode { 5 | TreeNode *lchild, *rchild; 6 | int val; 7 | TreeNode(int val) : lchild(nullptr), rchild(nullptr), val(val) {} 8 | }; 9 | 10 | TreeNode *root = nullptr; 11 | int flag = 0; 12 | 13 | void insertNode(int val) { 14 | if (!root) { 15 | root = new TreeNode(val); 16 | return; 17 | } 18 | TreeNode *t = root; 19 | TreeNode *pre; 20 | while (t) { 21 | pre = t; 22 | if (val >= t->val) 23 | t = t->rchild; 24 | else 25 | t = t->lchild; 26 | } 27 | if (val >= pre->val) 28 | pre->rchild = new TreeNode(val); 29 | else 30 | pre->lchild = new TreeNode(val); 31 | } 32 | 33 | void postOrder(TreeNode *t) { 34 | if (!t) return; 35 | postOrder(t->lchild); 36 | postOrder(t->rchild); 37 | if (flag) cout << " "; 38 | cout << t->val; 39 | flag = 1; 40 | } 41 | 42 | int main(int argc, char *argv[]) { 43 | int num; 44 | while (cin >> num) { 45 | if (num == 0) break; 46 | insertNode(num); 47 | } 48 | postOrder(root); 49 | return 0; 50 | } 51 | -------------------------------------------------------------------------------- /机试历年真题/2010/input.txt: -------------------------------------------------------------------------------- 1 | this is some > text! 2 | one plus one eqs 2 3 | this line should be deleted 4 | prev line sh*ould be deleted 5 | -------------------------------------------------------------------------------- /机试历年真题/2011/1.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main(int argc, char *argv[]) { 5 | int a, b, c; 6 | cin >> a >> b; 7 | c = a ^ b; 8 | int bits[32]; 9 | int N = 0; 10 | if (c == 0) 11 | cout << 0; 12 | while (c) { 13 | bits[N++] = c & 1; 14 | c >>= 1; 15 | } 16 | for (int i = N-1; i >= 0; i--) 17 | cout << bits[i]; 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /机试历年真题/2011/2.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main(int argc, char *argv[]) { 5 | int x, y, k; 6 | cin >> x >> y >> k; 7 | int cnt = 0; 8 | for (int i = 0; i <= 8 && i <= x; i++) { 9 | for (int j = 0; j <= 8 - i && j <= y; j++) { 10 | if (8 - i - j <= k) { 11 | printf("%2d. %d红球,%d黄球,%d黑球\n", ++cnt, i, j, 8 - i - j); 12 | } 13 | } 14 | } 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /机试历年真题/2011/3.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | using namespace std; 5 | 6 | string readFile(string filename) { 7 | ifstream ifs(filename); 8 | ostringstream oss; 9 | char c; 10 | while (ifs >> c) { 11 | oss.put(c); 12 | } 13 | return oss.str(); 14 | } 15 | 16 | /* abc*d?e */ 17 | bool check(const string &s, int idx) { 18 | int len = s.length(); 19 | if (idx >= len || s[idx++] != 'a') return false; 20 | if (idx >= len || s[idx++] != 'b') return false; 21 | while (idx < len && s[idx++] == 'c'); 22 | if (idx < len && s[idx] == 'e') return true; 23 | if (idx >= len || s[idx++] != 'd') return false; 24 | if (idx >= len || s[idx] != 'e') return false; 25 | return true; 26 | } 27 | 28 | int main(int argc, char *argv[]) { 29 | string s = readFile("./3.txt"); 30 | int flag = 0; 31 | for (int i = 0; i < s.length(); i++) { 32 | if (check(s, i)) { 33 | cout << "找到abc*d?e匹配" << endl; 34 | return 0; 35 | } 36 | } 37 | cout << "没找到abc*d?e匹配" << endl; 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /机试历年真题/2011/3.txt: -------------------------------------------------------------------------------- 1 | fjkd 2 | fjsdkfldsklf 3 | 2jkrn jdk fjfdsf 4 | jdk 5 | abccccdde 6 | abccccccce 7 | -------------------------------------------------------------------------------- /机试历年真题/2011/4.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | using namespace std; 4 | 5 | int flag = 0; 6 | ifstream ifs("./4.txt"); 7 | ofstream ofs("./4.out"); 8 | 9 | struct TreeNode { 10 | TreeNode *lchild, *rchild; 11 | int val; 12 | TreeNode(int val): val(val) {} 13 | }; 14 | 15 | void postOrder(TreeNode *t) { 16 | if (!t) 17 | return; 18 | postOrder(t->lchild); 19 | postOrder(t->rchild); 20 | if (flag) 21 | ofs << " "; 22 | flag = 1; 23 | ofs << t->val; 24 | } 25 | 26 | int main(int argc, char *argv[]) { 27 | int n, rootIdx; 28 | int a, b, c; 29 | ifs >> n >> rootIdx; 30 | vector nodes(n+1, nullptr); 31 | ifs.putback(rootIdx+'0'); 32 | while (ifs >> a >> b >> c) { 33 | if (!nodes[a]) nodes[a] = new TreeNode(a); 34 | if (!nodes[b] && b != 0) nodes[b] = new TreeNode(b); 35 | if (!nodes[c] && c != 0) nodes[c] = new TreeNode(c); 36 | nodes[a]->lchild = nodes[b]; 37 | nodes[a]->rchild = nodes[c]; 38 | } 39 | TreeNode *root = nodes[rootIdx]; 40 | postOrder(root); 41 | return 0; 42 | } 43 | -------------------------------------------------------------------------------- /机试历年真题/2011/4.out: -------------------------------------------------------------------------------- 1 | 3 2 4 1 -------------------------------------------------------------------------------- /机试历年真题/2011/4.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 1 2 4 3 | 2 0 3 4 | 3 0 0 5 | 4 0 0 6 | -------------------------------------------------------------------------------- /机试历年真题/2012/1.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main(int argc, char *argv[]) { 5 | double a, b; 6 | char buf[128]; 7 | FILE *infile = fopen("./string.in", "r"); 8 | FILE *outfile = fopen("./string.out", "w"); 9 | if (!infile || !outfile) exit(1); 10 | fscanf(infile, "%lf", &a); 11 | fscanf(infile, "%lf", &b); 12 | sprintf(buf, "%.10e", a+b); 13 | int i, j; 14 | for (i = 0; buf[i] != '\0'; i++) 15 | if (buf[i] == 'e') 16 | break; 17 | for (j = i-1; buf[j] == '0'; j--); 18 | for (int k = 0; k <= j; k++) 19 | fputc(buf[k], outfile); 20 | fputc('e', outfile); 21 | for (j = i+1; buf[j] != '\0'; j++) 22 | fputc(buf[j], outfile); 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /机试历年真题/2012/2.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | using namespace std; 4 | 5 | int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); } 6 | 7 | int main(int argc, char *argv[]) { 8 | ifstream ifs("./number.in"); 9 | ofstream ofs("./number.out"); 10 | int n; 11 | ifs >> n; 12 | vector a(n); 13 | for (int i = 0; i < n; i++) 14 | ifs >> a[i]; 15 | int minVal, maxVal; 16 | minVal = maxVal = a[0]; 17 | for (int i = 1; i < n; i++) { 18 | if (a[i] < minVal) 19 | minVal = a[i]; 20 | if (a[i] > maxVal) 21 | maxVal = a[i]; 22 | } 23 | ofs << minVal << " " << maxVal << " " << gcd(maxVal, minVal); 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /机试历年真题/2012/3.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | using namespace std; 5 | 6 | unordered_map idxMap; 7 | unordered_map nameMap; 8 | unordered_map> adjMap; 9 | vector q; 10 | int curIdx = 0; 11 | 12 | void parseLine(const string &line) { 13 | string tmp; 14 | int i, j; 15 | for (i = 0; i < line.length(); i++) 16 | if (line[i] == '(') 17 | break; 18 | tmp = line.substr(0, i); 19 | if (!idxMap.count(tmp)) { 20 | nameMap[curIdx] = tmp; 21 | idxMap[tmp] = curIdx++; 22 | } 23 | int src = idxMap[tmp]; 24 | for (j = ++i; j <= line.length(); j++) { 25 | if (line[j] == ',' || line[j] == ')') { 26 | tmp = line.substr(i, j - i); 27 | if (!idxMap.count(tmp)) { 28 | nameMap[curIdx] = tmp; 29 | idxMap[tmp] = curIdx++; 30 | } 31 | adjMap[src].push_back(idxMap[tmp]); 32 | i = ++j; 33 | } 34 | } 35 | } 36 | 37 | void dfs(vector &vis, int src) { 38 | vis[src] = 1; 39 | for (int next : adjMap[src]) { 40 | if (next == -1) 41 | break; 42 | if (vis[next]) 43 | continue; 44 | dfs(vis, next); 45 | } 46 | q.push_back(src); 47 | } 48 | 49 | int main(int argc, char *argv[]) { 50 | ifstream ifs("./task.in"); 51 | ofstream ofs("./task.out"); 52 | idxMap["NULL"] = -1; 53 | string line; 54 | while (getline(ifs, line)) { 55 | parseLine(line); 56 | } 57 | int size = curIdx; 58 | vector vis(size, 0); 59 | for (int i = 0; i < size; i++) { 60 | if (vis[i]) 61 | continue; 62 | dfs(vis, i); 63 | } 64 | for (int i = q.size() - 1; i >= 0; i--) { 65 | if (i != q.size()-1) 66 | ofs << " "; 67 | ofs << nameMap[q[i]]; 68 | } 69 | return 0; 70 | } 71 | -------------------------------------------------------------------------------- /机试历年真题/2012/4.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | using namespace std; 5 | 6 | int main(int argc, char *argv[]) { 7 | ifstream ifs("./ticket.in"); 8 | ofstream ofs("./ticket.out"); 9 | int nums[10000]; 10 | memset(nums, 0, 10000); 11 | int n, m; 12 | ifs >> n >> m; 13 | int a, b, c, flag; 14 | for (int i = 0; i < n; i++) { 15 | ifs >> a >> b >> c; 16 | flag = 1; 17 | for (int j = a; j < b; j++) { 18 | if (nums[j] + c > m) { 19 | flag = 0; 20 | break; 21 | } 22 | } 23 | if (flag) { 24 | for (int j = a; j < b; j++) { 25 | nums[j] += c; 26 | } 27 | } 28 | ofs << flag << endl; 29 | } 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /机试历年真题/2012/5.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | using namespace std; 4 | 5 | #define INF 0x7fffffff 6 | 7 | int main(int argc, char *argv[]) { 8 | ifstream ifs("./road.in"); 9 | ofstream ofs("./road.out"); 10 | int cityCnt, roadCnt, src, dst; 11 | ifs >> cityCnt >> roadCnt >> src >> dst; 12 | vector> road(cityCnt+1, vector (cityCnt+1, INF)); 13 | vector> next(cityCnt+1, vector (cityCnt+1, -1)); 14 | for (int i = 0; i < roadCnt; i++) { 15 | int a, b, c; 16 | ifs >> a >> b >> c; 17 | road[a][b] = c; 18 | next[a][b] = b; 19 | } 20 | // floyed-warshall 21 | for (int k = 1; k <= cityCnt; k++) { 22 | for (int i = 1; i <= cityCnt; i++) { 23 | for (int j = 1; j <= cityCnt; j++) { 24 | if (road[i][k] != INF && road[k][j] != INF && road[i][k] + road[k][j] < road[i][j]) { 25 | road[i][j] = road[i][k] + road[k][j]; 26 | next[i][j] = k; 27 | } 28 | } 29 | } 30 | } 31 | ofs << road[src][dst] << endl; 32 | int i = src; 33 | while (i != dst) { 34 | ofs << i << " "; 35 | i = next[i][dst]; 36 | } 37 | ofs << dst; 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /机试历年真题/2012/number.in: -------------------------------------------------------------------------------- 1 | 3 2 | 4 8 6 3 | -------------------------------------------------------------------------------- /机试历年真题/2012/road.in: -------------------------------------------------------------------------------- 1 | 3 3 1 3 2 | 1 3 3 3 | 1 2 1 4 | 2 3 1 5 | -------------------------------------------------------------------------------- /机试历年真题/2012/string.in: -------------------------------------------------------------------------------- 1 | 34.56 2 | 2.45e2 3 | -------------------------------------------------------------------------------- /机试历年真题/2012/task.in: -------------------------------------------------------------------------------- 1 | Task0(Task1,Task2) 2 | Task1(Task3) 3 | Task2(NULL) 4 | Task3(NULL) 5 | -------------------------------------------------------------------------------- /机试历年真题/2012/ticket.in: -------------------------------------------------------------------------------- 1 | 5 10 2 | 4 10 9 3 | 8 12 2 4 | 8 12 1 5 | 14 20 8 6 | 30 300 15 7 | -------------------------------------------------------------------------------- /机试历年真题/2013/1.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() { 5 | ifstream ifs("./1.in"); 6 | ofstream ofs("./1.out"); 7 | int num, maxv = 0; 8 | while (ifs >> num) 9 | if (num > maxv) 10 | maxv = num; 11 | ofs << maxv; 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /机试历年真题/2013/1.in: -------------------------------------------------------------------------------- 1 | 23 3 64 103 26 42 55 2 | -------------------------------------------------------------------------------- /机试历年真题/2013/2.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() { 5 | ifstream ifs("./2.in"); 6 | ofstream ofs("./2.out"); 7 | int sum = 0, num; 8 | while (ifs >> num) 9 | sum += num; 10 | ofs << sum; 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /机试历年真题/2013/2.in: -------------------------------------------------------------------------------- 1 | 23 3 64 103 26 42 55 2 | -------------------------------------------------------------------------------- /机试历年真题/2013/3.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main(int argc, char *argv[]) { 5 | ifstream ifs("./3.in"); 6 | ofstream ofs("./3.out"); 7 | int a[32]; 8 | int N = 0; 9 | int num; 10 | ifs >> num; 11 | while (num) { 12 | a[N++] = num%2; 13 | num /= 2; 14 | } 15 | for (int i = N-1; i >= 0; i--) { 16 | ofs << a[i]; 17 | } 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /机试历年真题/2013/3.in: -------------------------------------------------------------------------------- 1 | 100 2 | -------------------------------------------------------------------------------- /机试历年真题/2013/4.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | using namespace std; 4 | 5 | bool isOdd(int num) { 6 | for (int i = 2; i < sqrt(num); i++) 7 | if (num % i == 0) 8 | return false; 9 | return true; 10 | } 11 | 12 | int main(int argc, char *argv[]) { 13 | ifstream ifs("./4.in"); 14 | ofstream ofs("./4.out"); 15 | int num, ans = 0; 16 | ifs >> num; 17 | for (int i = 2; i <= num / 2; i++) 18 | if (isOdd(i) && isOdd(num - i)) 19 | ans++; 20 | ofs << ans; 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /机试历年真题/2013/4.in: -------------------------------------------------------------------------------- 1 | 10 2 | -------------------------------------------------------------------------------- /机试历年真题/2013/5.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | using namespace std; 4 | 5 | int main(int argc, char *argv[]) { 6 | ifstream ifs("./5.in"); 7 | ofstream ofs("./5.out"); 8 | int n; 9 | ifs >> n; 10 | int cnt = 0; 11 | vector> b(n, vector (n, 0)); 12 | vector> loc; 13 | loc.reserve(n); 14 | auto dfs = [&](auto &&self, int i) -> void { 15 | auto isValid = [&](int i, int j) { 16 | for (auto &p : loc) 17 | if (p.first == i || p.second == j || abs(p.first - i) == abs(p.second - j)) 18 | return false; 19 | return true; 20 | }; 21 | if (i == n) { 22 | cnt++; 23 | return; 24 | } 25 | for (int j = 0; j < n; j++) { 26 | if (!isValid(i, j)) 27 | continue; 28 | b[i][j] = 1; 29 | loc.push_back(make_pair(i, j)); 30 | self(self, i+1); 31 | b[i][j] = 0; 32 | loc.pop_back(); 33 | } 34 | }; 35 | dfs(dfs, 0); 36 | ofs << cnt << endl; 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /机试历年真题/2013/5.in: -------------------------------------------------------------------------------- 1 | 4 2 | -------------------------------------------------------------------------------- /机试历年真题/2013/6.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | using namespace std; 4 | 5 | int kmp(string &main, string &sub) { 6 | int len1 = main.length(), len2 = sub.length(); 7 | // getNext 8 | vector next(len2, 0); 9 | for (int i = 1; i < len2; i++) { 10 | if (sub[i] == sub[next[i-1]]) 11 | next[i] = next[i-1]+1; 12 | else if (sub[i] == sub[0]) 13 | next[i] = 1; 14 | else 15 | next[i] = 0; 16 | } 17 | for (int i = len2-1; i >= 1; i--) { 18 | next[i] = next[i-1]; 19 | } 20 | next[0] = -1; 21 | int i = 0, j = 0; 22 | while (i < len1 && j < len2) { 23 | if (main[i] == sub[j]) { 24 | i++; 25 | j++; 26 | } else { 27 | if (next[j] == -1) 28 | i++; 29 | else 30 | j = next[j]; 31 | } 32 | } 33 | if (j == len2) 34 | return i-j; 35 | return -1; 36 | } 37 | 38 | int main(int argc, char *argv[]) { 39 | ifstream ifs("./6.in"); 40 | ofstream ofs("./6.out"); 41 | string s1, s2; 42 | getline(ifs, s1); 43 | getline(ifs, s2); 44 | int ans = kmp(s1, s2); 45 | if (ans == -1) { 46 | ofs << 0 << endl; 47 | } else { 48 | ofs << ans+1 << " " << ans+s2.length() << endl; 49 | } 50 | return 0; 51 | } 52 | -------------------------------------------------------------------------------- /机试历年真题/2013/6.in: -------------------------------------------------------------------------------- 1 | abcdefgdrefege 2 | cdef 3 | -------------------------------------------------------------------------------- /机试历年真题/2013/7.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | using namespace std; 6 | 7 | struct TreeNode { 8 | TreeNode *lchild, *rchild; 9 | float val; 10 | TreeNode(float val) : lchild(nullptr), rchild(nullptr), val(val) {} 11 | }; 12 | 13 | struct Cmp { 14 | bool operator()(TreeNode *l, TreeNode *r) { 15 | return l->val > r->val; 16 | } 17 | }; 18 | 19 | unordered_map idxMap; 20 | vector ans; 21 | string tmp; 22 | 23 | void preOrder(TreeNode *root) { 24 | if (!root) 25 | return; 26 | if (!root->lchild && !root->rchild) { 27 | ans[idxMap[root]] = tmp; 28 | return; 29 | } 30 | tmp += "0"; 31 | preOrder(root->lchild); 32 | tmp.pop_back(); 33 | tmp += "1"; 34 | preOrder(root->rchild); 35 | tmp.pop_back(); 36 | } 37 | 38 | int main(int argc, char *argv[]) { 39 | ifstream ifs("./7.in"); 40 | ofstream ofs("./7.out"); 41 | float num; 42 | priority_queue, Cmp> pq; 43 | int idx = 0; 44 | while (ifs >> num) { 45 | TreeNode *t = new TreeNode(num); 46 | pq.push(t); 47 | idxMap[t] = idx++; 48 | } 49 | ans.resize(pq.size()); 50 | while (pq.size() != 1) { 51 | TreeNode *t1 = pq.top(); 52 | pq.pop(); 53 | TreeNode *t2 = pq.top(); 54 | pq.pop(); 55 | TreeNode *t = new TreeNode(t1->val + t2->val); 56 | t->lchild = t1; 57 | t->rchild = t2; 58 | pq.push(t); 59 | } 60 | TreeNode *root = pq.top(); 61 | preOrder(root); 62 | for (string &s : ans) { 63 | ofs << s << endl; 64 | } 65 | return 0; 66 | } 67 | -------------------------------------------------------------------------------- /机试历年真题/2013/7.in: -------------------------------------------------------------------------------- 1 | 0.1 0.15 0.2 0.25 0.3 2 | -------------------------------------------------------------------------------- /机试历年真题/2014/1.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main(int argc, char *argv[]) { 5 | string s; 6 | cin >> s; 7 | int digitCnt = 0, alphaCnt = 0, spaceCnt = 0, elseCnt = 0; 8 | for (char c : s) { 9 | if (isdigit(c)) 10 | digitCnt++; 11 | else if (isalpha(c)) 12 | alphaCnt++; 13 | else if (c == ' ') 14 | spaceCnt++; 15 | else 16 | elseCnt++; 17 | } 18 | printf("数字: %d\n", digitCnt); 19 | printf("字母: %d\n", alphaCnt); 20 | printf("空格: %d\n", spaceCnt); 21 | printf("其他字符: %d\n", elseCnt); 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /机试历年真题/2014/2.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | bool isPalindrome(const string &s) { 5 | int i = 0, j = s.size()-1; 6 | while (i < j) 7 | if (s[i++] != s[j--]) 8 | return false; 9 | return true; 10 | } 11 | 12 | string add(const string &s1, const string &s2) { 13 | int maxlen = max(s1.length(), s2.length()); 14 | string ans(maxlen, '0'); 15 | int i = s1.length()-1, j = s2.length()-1, k = maxlen-1; 16 | int carry = 0; 17 | while (i >= 0 && j >= 0) { 18 | int sum = s1[i--] - '0' + s2[j--] - '0' + carry; 19 | carry = sum / 10; 20 | ans[k--] = (sum % 10) + '0'; 21 | } 22 | while (i >= 0) { 23 | int sum = s1[i] - '0' + carry; 24 | carry = sum / 10; 25 | ans[i--] = (sum % 10) + '0'; 26 | } 27 | while (j >= 0) { 28 | int sum = s2[j] - '0' + carry; 29 | carry = sum / 10; 30 | ans[j--] = (sum % 10) + '0'; 31 | } 32 | if (carry == 1) 33 | ans = "1" + ans; 34 | return ans; 35 | } 36 | 37 | string reverse(const string &s) { 38 | return string(s.rbegin(), s.rend()); 39 | } 40 | 41 | int main(int argc, char *argv[]) { 42 | string s; 43 | cin >> s; 44 | int cnt = 0; 45 | while (!isPalindrome(s)) { 46 | s = add(s, reverse(s)); 47 | cnt++; 48 | } 49 | cout << cnt; 50 | return 0; 51 | } 52 | -------------------------------------------------------------------------------- /机试历年真题/2014/4.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | using namespace std; 6 | 7 | int main(int argc, char *argv[]) { 8 | ifstream ifs("./graph.in"); 9 | int n; 10 | ifs >> n; 11 | vector> g(n + 1, vector(n + 1, 0)); 12 | vector vis(n + 1, 0); 13 | queue q; 14 | int s, d; 15 | while (ifs >> s >> d && s != 0 && d != 0) { 16 | g[s][d] = g[d][s] = 1; 17 | } 18 | q.push(1); 19 | vis[1] = 1; 20 | int flag = 0; 21 | while (!q.empty()) { 22 | int tmp = q.front(); 23 | q.pop(); 24 | if (flag) cout << " "; 25 | flag = 1; 26 | cout << tmp; 27 | for (int i = 1; i <= n; i++) { 28 | if (g[tmp][i] && !vis[i]) { 29 | q.push(i); 30 | vis[i] = 1; 31 | } 32 | } 33 | } 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /机试历年真题/2014/graph.in: -------------------------------------------------------------------------------- 1 | 4 2 | 1 2 3 | 1 4 4 | 2 3 5 | 2 4 6 | 3 4 7 | 0 0 8 | -------------------------------------------------------------------------------- /机试历年真题/2015/1.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | string s = "abcdefg"; 5 | int cnt = 1; 6 | int size = 0; 7 | char comb[5]; 8 | 9 | void solve(int idx) { 10 | if (size == 5) { 11 | printf("第%d种组合: %c, %c, %c, %c, %c\n", cnt++, comb[0], comb[1], comb[2], 12 | comb[3], comb[4]); 13 | return; 14 | } 15 | for (int i = idx; i < s.length(); i++) { 16 | comb[size++] = s[i]; 17 | solve(i + 1); 18 | size--; 19 | } 20 | } 21 | 22 | int main(int argc, char *argv[]) { 23 | solve(0); 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /机试历年真题/2015/2.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main(int argc, char *argv[]) { 5 | int score = 0; 6 | for (int i = 0; i < 10; i++) { 7 | int a = rand() % 51, b = rand() % 51, c = rand() % 2; 8 | int guess, ans; 9 | char op; 10 | if (c == 0) { 11 | op = '+'; 12 | ans = a + b; 13 | } else { 14 | op = '-'; 15 | ans = a - b; 16 | } 17 | for (int j = 0; j < 2; j++) { 18 | printf("%d %c %d = ", a, op, b); 19 | scanf("%d", &guess); 20 | if (guess == ans) { 21 | cout << "right" << endl; 22 | score += (10 - j*5); 23 | break; 24 | } else { 25 | cout << "wrong" << endl; 26 | } 27 | } 28 | } 29 | printf("score = %d\n", score); 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /机试历年真题/2015/3.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | using namespace std; 6 | 7 | struct TreeNode { 8 | TreeNode *lchlid, *rchild; 9 | char val; 10 | TreeNode(char val) : lchlid(nullptr), rchild(nullptr), val(val) {} 11 | }; 12 | 13 | int main(int argc, char *argv[]) { 14 | ifstream ifs("./input_3.txt"); 15 | ofstream ofs("./output_3.txt"); 16 | unordered_map nodeMap; 17 | char a, b, c; 18 | string line; 19 | TreeNode *root, *t, *l, *r; 20 | ifs >> a; 21 | root = new TreeNode(a); 22 | nodeMap[a] = root; 23 | ifs.putback(a); 24 | while (getline(ifs, line)) { 25 | istringstream iss(line); 26 | iss >> a >> b; 27 | if (!nodeMap[a]) { 28 | nodeMap[a] = new TreeNode(a); 29 | } 30 | if (!nodeMap[b]) { 31 | nodeMap[b] = new TreeNode(b); 32 | } 33 | t = nodeMap[a]; 34 | l = nodeMap[b]; 35 | t->lchlid = l; 36 | if (iss >> c && !nodeMap[c]) { 37 | r = new TreeNode(c); 38 | nodeMap[c] = r; 39 | t->rchild = r; 40 | } 41 | } 42 | int size = 1, level = 1; 43 | queue q; 44 | q.push(root); 45 | while (!q.empty()) { 46 | int newSize = 0; 47 | int flag = level % 2; 48 | if (flag) ofs << level << ": "; 49 | for (int i = 0; i < size; i++) { 50 | if (flag && i != 0) ofs << " "; 51 | t = q.front(); 52 | q.pop(); 53 | if (flag) ofs << t->val; 54 | if (t->lchlid) { 55 | q.push(t->lchlid); 56 | newSize++; 57 | } 58 | if (t->rchild) { 59 | q.push(t->rchild); 60 | newSize++; 61 | } 62 | } 63 | if (flag) ofs << endl; 64 | size = newSize; 65 | level++; 66 | } 67 | return 0; 68 | } 69 | -------------------------------------------------------------------------------- /机试历年真题/2015/4.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | using namespace std; 6 | 7 | int main(int argc, char *argv[]) { 8 | ifstream ifs("./input_4.txt"); 9 | ofstream ofs("./output_4.txt"); 10 | int n, k; 11 | ifs.ignore(2); 12 | ifs >> n; 13 | ifs.ignore(3); 14 | ifs >> k; 15 | ifs.ignore(1); 16 | vector> g(n+1, vector(n+1, INT_MAX)); 17 | vector> next(n+1, vector(n+1, 0)); 18 | for (int i = 0; i < n; i++) { 19 | g[i][i] = 0; 20 | next[i][i] = i; 21 | } 22 | string line; 23 | while (getline(ifs, line)) { 24 | istringstream iss(line); 25 | int src, dst, distance; 26 | iss >> src; 27 | while (iss >> dst >> distance) { 28 | g[src][dst] = distance; 29 | next[src][dst] = dst; 30 | } 31 | } 32 | for (int x = 0; x < n; x++) { 33 | for (int i = 0; i < n; i++) { 34 | for (int j = 0; j < n; j++) { 35 | if (g[i][x] == INT_MAX || g[x][j] == INT_MAX) 36 | continue; 37 | int sum = g[i][x] + g[x][j]; 38 | if (sum < g[i][j]) { 39 | g[i][j] = sum; 40 | next[i][j] = x; 41 | } 42 | } 43 | } 44 | } 45 | int cur = 1; 46 | ofs << cur; 47 | while (cur != k) { 48 | cur = next[cur][k]; 49 | ofs << " " << cur; 50 | } 51 | while (cur != n) { 52 | cur = next[cur][n]; 53 | ofs << " " << cur; 54 | } 55 | return 0; 56 | } 57 | -------------------------------------------------------------------------------- /机试历年真题/2015/input_3.txt: -------------------------------------------------------------------------------- 1 | A B C 2 | B E 3 | C F G 4 | -------------------------------------------------------------------------------- /机试历年真题/2015/input_4.txt: -------------------------------------------------------------------------------- 1 | n=5 2 | k=3 3 | 1 2 10 5 30 4 | 2 3 20 5 | 3 4 60 5 10 6 | 4 5 20 7 | 5 8 | -------------------------------------------------------------------------------- /机试历年真题/2016/1.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | char hexchar[] = {'0', '1', '2', '3', '4', '5', '6', '7', 5 | '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; 6 | 7 | int main(int argc, char *argv[]) { 8 | int num; 9 | cin >> num; 10 | int st[32]; 11 | int i = 0; 12 | while (num) { 13 | st[i++] = num % 16; 14 | num /= 16; 15 | } 16 | while (--i >= 0) { 17 | cout << hexchar[st[i]]; 18 | } 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /机试历年真题/2016/2.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | using namespace std; 4 | 5 | int main(int argc, char *argv[]) { 6 | float X; 7 | int N; 8 | cin >> X >> N; 9 | int Y = X * 100; 10 | map occ; 11 | occ[0] = occ[Y] = 1; 12 | for (int i = 0; i < N - 1; i++) { 13 | int div; 14 | do { 15 | div = rand() % (Y - 1) + 1; 16 | } while (occ.count(div)); 17 | occ[div] = 1; 18 | } 19 | auto prev = occ.begin(); 20 | for (auto it = next(occ.begin()); it != occ.end(); it++) { 21 | printf("%.2f ", (float)(it->first - prev->first) / 100); 22 | prev++; 23 | } 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /机试历年真题/2016/3.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | using namespace std; 4 | 5 | double func(double x) { 6 | return 2 * pow(x, 11) - 3 * pow(x, 8) - 5 * pow(x, 3) - 1; 7 | } 8 | 9 | double solve(double (*func) (double), double l, double r) { 10 | if (r - l < 0.00000001) 11 | return l; 12 | double mid = (r + l) / 2; 13 | double tmp = func(mid); 14 | if (tmp > 0) return solve(func, l, mid); 15 | else if (tmp < 0) return solve(func, mid, r); 16 | else return mid; 17 | } 18 | 19 | int main(int argc, char *argv[]) { 20 | printf("%.9f\n", solve(func, 1, 2)); 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /机试历年真题/2016/4.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | using namespace std; 4 | 5 | ifstream ifs("./4.in"); 6 | ofstream ofs("./4.out"); 7 | 8 | struct TreeNode { 9 | TreeNode *lchild, *rchild; 10 | char val; 11 | TreeNode(char val) : lchild(nullptr), rchild(nullptr), val(val) {} 12 | }; 13 | 14 | void inOrder(TreeNode *t) { 15 | if (!t) return; 16 | inOrder(t->lchild); 17 | ofs << t->val << " "; 18 | inOrder(t->rchild); 19 | } 20 | 21 | TreeNode *buildTree(vector &pre, vector &post) { 22 | auto make = [&](auto &&self, int l1, int r1, int l2, int r2) -> TreeNode * { 23 | if (l1 > r1) return nullptr; 24 | TreeNode *t = new TreeNode(pre[l1]); 25 | if (l1 != r1) { 26 | int i; 27 | for (i = l2; i <= r2; i++) 28 | if (pre[l1 + 1] == post[i]) break; 29 | t->lchild = self(self, l1 + 1, l1 + 1 + i - l2, l2, i); 30 | t->rchild = self(self, l1 + 2 + i - l2, r1, i + 1, r2 - 1); 31 | } 32 | return t; 33 | }; 34 | return make(make, 0, pre.size() - 1, 0, post.size() - 1); 35 | } 36 | 37 | int main(int argc, char *argv[]) { 38 | int n; 39 | ifs >> n; 40 | vector pre(n), post(n); 41 | for (int i = 0; i < n; i++) { 42 | ifs >> pre[i]; 43 | } 44 | for (int i = 0; i < n; i++) { 45 | ifs >> post[i]; 46 | } 47 | TreeNode *root = buildTree(pre, post); 48 | inOrder(root); 49 | return 0; 50 | } 51 | -------------------------------------------------------------------------------- /机试历年真题/2016/4.in: -------------------------------------------------------------------------------- 1 | 5 2 | A B D C E 3 | D B E C A 4 | -------------------------------------------------------------------------------- /机试历年真题/2017/1.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | using namespace std; 4 | 5 | int main(int argc, char *argv[]) { 6 | string tmp; 7 | int flag = 0; 8 | ifstream ifs("./input1.txt"); 9 | while (ifs >> tmp) { 10 | if (flag) { 11 | cout << " "; 12 | } 13 | flag = 1; 14 | tmp[0] = toupper(tmp[0]); 15 | cout << tmp; 16 | } 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /机试历年真题/2017/2.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | using namespace std; 5 | 6 | bool isOk(int num) { 7 | int sum = 1, tmp = num, i = 2; 8 | while (i <= sqrt(tmp)) { 9 | if (tmp % i != 0) { 10 | i++; 11 | continue; 12 | } 13 | tmp /= i; 14 | sum += i; 15 | i = 2; 16 | } 17 | if (tmp != num) 18 | sum += tmp; 19 | return sum >= num; 20 | } 21 | 22 | int main(int argc, char *argv[]) { 23 | int flag = 0; 24 | for (int i = 2; i <= 1000; i++) { 25 | if (isOk(i)) { 26 | if (flag) cout << " "; 27 | cout << i; 28 | flag = 1; 29 | } 30 | } 31 | cout << endl; 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /机试历年真题/2017/3.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | using namespace std; 6 | 7 | int main(int argc, char *argv[]) { 8 | ifstream ifs("./input3.txt"); 9 | int num; 10 | vector v(1, 0); 11 | while (ifs >> num) 12 | v.push_back(num); 13 | int n = v.size() - 1; 14 | int maxv = 0; 15 | map> dp; 16 | for (int i = 1; i <= n; i++) { 17 | for (int j = 0; j < i; j++) { 18 | int diff = v[i] - v[j]; 19 | if (!dp.count(diff)) 20 | dp[diff] = vector(n+1, 1); 21 | int tmp = dp[diff][j] + 1; 22 | dp[diff][i] = tmp; 23 | if (tmp > maxv) 24 | maxv = tmp; 25 | } 26 | } 27 | cout << maxv << endl; 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /机试历年真题/2017/4.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | using namespace std; 5 | 6 | int main(int argc, char *argv[]) { 7 | ifstream ifs("./input4.txt"); 8 | int n; 9 | ifs >> n; 10 | vector> g(n + 1, vector(n + 1, 0)); 11 | int a, b; 12 | while (ifs >> a >> b) { 13 | g[a][b] = g[b][a] = 1; 14 | } 15 | auto keyVertex = [&]() -> int { 16 | auto isConnected = [&](int idx) -> bool { 17 | vector vis(n + 1, 0); 18 | vis[idx] = 1; 19 | auto dfs = [&](auto &&self, int idx) -> void { 20 | vis[idx] = 1; 21 | for (int i = 1; i <= n; i++) 22 | if (g[idx][i] && !vis[i]) 23 | self(self, i); 24 | }; 25 | dfs(dfs, idx == n ? 1 : idx + 1); 26 | for (int i = 1; i <= n; i++) 27 | if (!vis[i]) 28 | return false; 29 | return true; 30 | }; 31 | for (int i = 1; i <= n; i++) 32 | if (!isConnected(i)) 33 | return i; 34 | return 0; 35 | }; 36 | int key = keyVertex(); 37 | if (key) 38 | cout << key; 39 | else 40 | cout << "not exist"; 41 | return 0; 42 | } 43 | -------------------------------------------------------------------------------- /机试历年真题/2017/input1.txt: -------------------------------------------------------------------------------- 1 | i am very nervous tody since 2 | i will attend the C programming 3 | -------------------------------------------------------------------------------- /机试历年真题/2017/input3.txt: -------------------------------------------------------------------------------- 1 | 1 2 3 5 7 8 14 20 26 2 | -------------------------------------------------------------------------------- /机试历年真题/2017/input4.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 1 5 3 | 2 3 4 | 2 4 5 | 3 5 6 | 4 5 7 | -------------------------------------------------------------------------------- /机试历年真题/2018/1.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int mcnt[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; 5 | int ycnt[] = {366, 365, 365, 365}; 6 | string dname[] = {"Saturday", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Firaday"}; 7 | 8 | int main(int argc, char *argv[]) { 9 | int n; 10 | cin >> n; 11 | int tmp = n % 7; 12 | int year = 2000, month = 1, date = 1; 13 | int i = 0; 14 | while (n >= ycnt[i%4]) { 15 | n -= ycnt[i%4]; 16 | year++; 17 | i++; 18 | } 19 | i = 0; 20 | if (year % 4 == 0) 21 | mcnt[1] = 29; 22 | while (n >= mcnt[i]) { 23 | n -= mcnt[i]; 24 | month++; 25 | i++; 26 | } 27 | date += n; 28 | printf("%d-%d-%d %s", year, month, date, dname[tmp].c_str()); 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /机试历年真题/2018/2.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | using namespace std; 5 | 6 | int getGap(int a, int b, int c, int d) { return a * 60 + b - c * 60 - d; } 7 | 8 | int main(int argc, char *argv[]) { 9 | unordered_map timeTrack; 10 | ifstream ifs("./input2.txt"); 11 | int n; 12 | ifs >> n; 13 | string id, ans; 14 | /* start hour, start minite, end hour, end minute */ 15 | int sh, sm, eh, em; 16 | int longest = 0; 17 | for (int i = 0; i < n; i++) { 18 | ifs >> id; 19 | ifs >> sh; 20 | ifs.ignore(1); 21 | ifs >> sm; 22 | ifs >> eh; 23 | ifs.ignore(1); 24 | ifs >> em; 25 | int tmp; 26 | // the next day 27 | if (eh <= sh && em <= sm) { 28 | tmp = 24 * 60 - getGap(eh, em, sh, sm); 29 | } else { 30 | tmp = getGap(sh, sm, eh, em); 31 | } 32 | timeTrack[id] += tmp; 33 | } 34 | for (auto it = timeTrack.begin(); it != timeTrack.end(); it++) { 35 | if (it->second > longest) { 36 | longest = it->second; 37 | ans = it->first; 38 | } 39 | } 40 | cout << ans; 41 | return 0; 42 | } 43 | -------------------------------------------------------------------------------- /机试历年真题/2018/3.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | using namespace std; 6 | 7 | /* 返回-1时表示当前的硬币选择不能满足要求,不断递归直到得到不是-1的结果或者遍历完所有组合返回-1 */ 8 | int solve(vector &v, int total, int idx) { 9 | if (total < 0) return -1; 10 | if (total == 0) return 0; 11 | for (int i = idx; i >= 0; i--) { 12 | int tmp = solve(v, total - v[i], i); 13 | if (tmp == -1) continue; 14 | return tmp + 1; 15 | } 16 | return -1; 17 | } 18 | 19 | int main(int argc, char *argv[]) { 20 | ifstream ifs("./input3.txt"); 21 | int n, total; 22 | ifs >> total >> n; 23 | vector v(n); 24 | for (int i = 0; i < n; i++) ifs >> v[i]; 25 | sort(v.begin(), v.end()); 26 | int tmp = solve(v, total, v.size() - 1); 27 | cout << (tmp == -1 ? 0 : tmp); 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /机试历年真题/2018/4.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | using namespace std; 4 | 5 | int lic(const string &s1, const string &s2, int i, int j) { 6 | if (i == 0 || j == 0) return 0; 7 | if (s1[i - 1] == s2[j - 1]) return lic(s1, s2, i - 1, j - 1) + 1; 8 | return max(lic(s1, s2, i - 1, j), lic(s1, s2, i, j - 1)); 9 | } 10 | 11 | int main(int argc, char *argv[]) { 12 | ifstream ifs("./input4.txt"); 13 | string s1, s2; 14 | while (ifs >> s1 >> s2) { 15 | cout << lic(s1, s2, s1.length() - 1, s2.length() - 1) << endl; 16 | } 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /机试历年真题/2018/4_2.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | using namespace std; 5 | 6 | int main(int argc, char *argv[]) { 7 | ifstream ifs("./input4.txt"); 8 | string s1, s2; 9 | int dp[1000][1000]; 10 | while (ifs >> s1 >> s2) { 11 | int m = s1.length(), n = s2.length(); 12 | for (int i = 1; i <= m; i++) { 13 | for (int j = 1; j <= n; j++) { 14 | if (s1[i-1] == s2[j-1]) 15 | dp[i][j] = dp[i-1][j-1] + 1; 16 | else 17 | dp[i][j] = max(dp[i-1][j], dp[i][j-1]); 18 | } 19 | } 20 | cout << dp[m][n] << endl; 21 | } 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /机试历年真题/2018/input2.txt: -------------------------------------------------------------------------------- 1 | 3 2 | SA0010001 13:00 16:39 3 | SA0010101 07:22 22:01 4 | SA0010111 12:00 11:56 5 | -------------------------------------------------------------------------------- /机试历年真题/2018/input3.txt: -------------------------------------------------------------------------------- 1 | 10 3 2 | 1 2 4 3 | -------------------------------------------------------------------------------- /机试历年真题/2018/input4.txt: -------------------------------------------------------------------------------- 1 | abcfac abcdfd 2 | programming contest 3 | abc mmp 4 | -------------------------------------------------------------------------------- /机试历年真题/2019/1.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int w[17] = {7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2}; 5 | char m[11] = {'1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'}; 6 | 7 | bool isValid(string &s) { 8 | int sum = 0; 9 | for (int i = 0; i < 17; i++) { 10 | if (!isdigit(s[i])) { 11 | return false; 12 | } 13 | sum += w[i] * (s[i] - '0'); 14 | } 15 | return (m[sum % 11] == s[17]); 16 | } 17 | 18 | int main(int argc, char *argv[]) { 19 | string s; 20 | cin >> s; 21 | cout << (isValid(s) ? "YES" : "NO"); 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /机试历年真题/2019/2.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | using namespace std; 4 | 5 | int main(int argc, char *argv[]) { 6 | int num; 7 | cin >> num; 8 | bitset<32> bits(num); 9 | if (bits.count() != 2) { 10 | cout << "NO"; 11 | } else { 12 | int a[2], idx = 0, tmp = num; 13 | for (int i = 0; i < 32; i++) { 14 | if (tmp & 1) 15 | a[idx++] = i; 16 | tmp >>= 1; 17 | } 18 | printf("%d = 2^%d + 2^%d\n", num, a[0], a[1]); 19 | } 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /机试历年真题/2019/3.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | using namespace std; 5 | 6 | int calc(int lhs, int rhs, char op) { 7 | if (op == '+') 8 | return lhs + rhs; 9 | else if (op == '-') 10 | return lhs - rhs; 11 | else if (op == '*') 12 | return lhs * rhs; 13 | else 14 | return lhs / rhs; 15 | } 16 | 17 | int main(int argc, char *argv[]) { 18 | ifstream ifs("./pre.in"); 19 | string s; 20 | getline(ifs, s); 21 | stack numStk; 22 | for (int i = s.size() - 1; i >= 0; i--) { 23 | char c = s[i]; 24 | if (isspace(c)) continue; 25 | if (isdigit(c)) { 26 | numStk.push(c - '0'); 27 | continue; 28 | } 29 | int lhs = numStk.top(); 30 | numStk.pop(); 31 | int rhs = numStk.top(); 32 | numStk.pop(); 33 | numStk.push(calc(lhs, rhs, c)); 34 | } 35 | cout << numStk.top(); 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /机试历年真题/2019/4.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | using namespace std; 5 | 6 | void print(vector> &subsets) { 7 | cout << '{'; 8 | int flag1 = 0; 9 | for (auto &a : subsets) { 10 | if (flag1) cout << ','; 11 | cout << '{'; 12 | int flag2 = 0; 13 | for (auto &b : a) { 14 | if (flag2) cout << ','; 15 | cout << b; 16 | flag2 = 1; 17 | } 18 | cout << '}'; 19 | flag1 = 1; 20 | } 21 | cout << '}'; 22 | cout << endl; 23 | } 24 | 25 | void solve(vector &v, vector> &subsets, int idx) { 26 | if (idx == v.size()) { 27 | print(subsets); 28 | return; 29 | } 30 | for (int i = 0; i < subsets.size(); i++) { 31 | subsets[i].push_back(v[idx]); 32 | solve(v, subsets, idx + 1); 33 | subsets[i].pop_back(); 34 | } 35 | subsets.push_back({v[idx]}); 36 | solve(v, subsets, idx + 1); 37 | subsets.pop_back(); 38 | } 39 | 40 | int main(int argc, char *argv[]) { 41 | ifstream ifs("./set.in"); 42 | char c; 43 | vector v; 44 | while (ifs >> c) { 45 | v.push_back(c); 46 | } 47 | vector> subsets; 48 | solve(v, subsets, 0); 49 | return 0; 50 | } 51 | -------------------------------------------------------------------------------- /机试历年真题/2019/5.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | struct TreeNode { 8 | TreeNode *left{nullptr}; 9 | TreeNode *right{nullptr}; 10 | int val; 11 | TreeNode(int val): val{val} {} 12 | }; 13 | 14 | TreeNode *root = nullptr; 15 | 16 | void insertNode(int val) { 17 | if (!root) { 18 | root = new TreeNode(val); 19 | return; 20 | } 21 | TreeNode *cur = root; 22 | TreeNode *prev = nullptr; 23 | while (cur) { 24 | prev = cur; 25 | if (val < cur->val) { 26 | cur = cur->left; 27 | } else if (val > cur->val) { 28 | cur = cur->right; 29 | } else { 30 | assert(false); 31 | } 32 | } 33 | assert(prev); 34 | if (val < prev->val) { 35 | prev->left = new TreeNode(val); 36 | } else { 37 | prev->right = new TreeNode(val); 38 | } 39 | } 40 | 41 | #define MAX(a, b, c) max(a, max(b, c)) 42 | 43 | // 求从根节点到叶结点的最短路径 44 | int getMaxPath(TreeNode *root) { 45 | if (!root) { 46 | return 0; 47 | } 48 | int ans = root->val + max(getMaxPath(root->left), getMaxPath(root->right)); 49 | return ans; 50 | } 51 | 52 | 53 | // 求以root为根节点的树中,两个叶结点之间的最长路径,有三种可能性: 54 | // 1. 最长路径经过该根节点 55 | // 2. 最长路径在左子树 56 | // 3. 最长路径在右子树 57 | int getMaxDist(TreeNode *root) { 58 | if (!root) { 59 | return 0; 60 | } 61 | return MAX(getMaxDist(root->left), getMaxDist(root->right), 62 | root->val + getMaxPath(root->left) + getMaxPath(root->right)); 63 | } 64 | 65 | int main() { 66 | ifstream ifs("tree.in"); 67 | int val; 68 | while (ifs >> val) { 69 | insertNode(val); 70 | } 71 | cout << getMaxDist(root) << endl; 72 | return 0; 73 | } 74 | -------------------------------------------------------------------------------- /机试历年真题/2019/5_2.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace std; 7 | 8 | struct TreeNode { 9 | TreeNode *left{nullptr}; 10 | TreeNode *right{nullptr}; 11 | int val; 12 | // 从以该结点为根节点的子树到叶结点的最长路径 13 | int maxpath{-1}; 14 | TreeNode(int val): val{val} {} 15 | }; 16 | 17 | TreeNode *root = nullptr; 18 | 19 | void insertNode(int val) { 20 | if (!root) { 21 | root = new TreeNode(val); 22 | return; 23 | } 24 | TreeNode *cur = root; 25 | TreeNode *prev = nullptr; 26 | while (cur) { 27 | prev = cur; 28 | if (val < cur->val) { 29 | cur = cur->left; 30 | } else if (val > cur->val) { 31 | cur = cur->right; 32 | } else { 33 | assert(false); 34 | } 35 | } 36 | assert(prev); 37 | if (val < prev->val) { 38 | prev->left = new TreeNode(val); 39 | } else { 40 | prev->right = new TreeNode(val); 41 | } 42 | } 43 | 44 | #define MAX(a, b, c) max(a, max(b, c)) 45 | 46 | int getMaxPath(TreeNode *root) { 47 | if (!root) { 48 | return 0; 49 | } 50 | if (root->maxpath != -1) { 51 | return root->maxpath; 52 | } 53 | int ans = root->val + max(getMaxPath(root->left), getMaxPath(root->right)); 54 | root->maxpath = ans; 55 | return ans; 56 | } 57 | 58 | 59 | // 求以root为根节点的树中,两个叶结点之间的最长路径,有三种可能性: 60 | // 1. 最长路径经过该根节点 61 | // 2. 最长路径在左子树 62 | // 3. 最长路径在右子树 63 | int getMaxDist(TreeNode *root) { 64 | if (!root) { 65 | return 0; 66 | } 67 | return MAX(getMaxDist(root->left), getMaxDist(root->right), 68 | root->val + getMaxPath(root->left) + getMaxPath(root->right)); 69 | } 70 | 71 | int main() { 72 | ifstream ifs("tree.in"); 73 | int val; 74 | while (ifs >> val) { 75 | insertNode(val); 76 | } 77 | cout << getMaxDist(root) << endl; 78 | return 0; 79 | } 80 | -------------------------------------------------------------------------------- /机试历年真题/2019/pre.in: -------------------------------------------------------------------------------- 1 | - + 1 * + 2 3 4 5 2 | -------------------------------------------------------------------------------- /机试历年真题/2019/set.in: -------------------------------------------------------------------------------- 1 | a b c 2 | -------------------------------------------------------------------------------- /机试历年真题/2019/tree.in: -------------------------------------------------------------------------------- 1 | 25 15 40 5 20 30 50 10 35 2 | -------------------------------------------------------------------------------- /机试历年真题/2020/1.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int gcd(int a, int b) { 5 | return (b == 0 ? a : gcd(b, a % b)); 6 | } 7 | 8 | int main(int argc, char *argv[]) { 9 | int a, b; 10 | cin >> a >> b; 11 | if (b > a) swap(a, b); 12 | cout << gcd(a, b); 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /机试历年真题/2020/2.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | using namespace std; 5 | 6 | void partition(vector &a, int l, int r, int k) { 7 | if (l >= r) return; 8 | int base = a[l]; 9 | int i = l, j = r; 10 | while (i < j) { 11 | while (i < j && a[j] >= base) j--; 12 | a[i] = a[j]; 13 | while (i < j && a[i] <= base) i++; 14 | a[j] = a[i]; 15 | } 16 | a[i] = base; 17 | if (k == i) return; 18 | else if (i < k) partition(a, i + 1, r, k); 19 | else partition(a, l, i - 1, k); 20 | } 21 | 22 | int main(int argc, char *argv[]) { 23 | int n, k; 24 | ifstream ifs("./array.in"); 25 | ifs >> n >> k; 26 | vector a(n); 27 | for (int i = 0; i < n; i++) ifs >> a[i]; 28 | partition(a, 0, n - 1, k - 1); 29 | cout << a[k - 1]; 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /机试历年真题/2020/3.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | using namespace std; 6 | 7 | bool cmp(const string &l, const string &r) { 8 | int lsize = l.size(); 9 | int rsize = r.size(); 10 | int maxv = max(l.size(), r.size()); 11 | for (int i = 0; i < maxv; i++) { 12 | if (l[i % lsize] == r[i % rsize]) 13 | continue; 14 | return l[i % lsize] > r[i % rsize]; 15 | } 16 | return true; 17 | }; 18 | 19 | int main(int argc, char *argv[]) { 20 | ifstream ifs("./number.in"); 21 | vector v; 22 | string s; 23 | while (ifs >> s) 24 | v.push_back(s); 25 | sort(v.begin(), v.end(), cmp); 26 | for (const auto &s : v) cout << s; 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /机试历年真题/2020/array.in: -------------------------------------------------------------------------------- 1 | 10 7 2 | 6 2 20 99 37 100 33 28 78 44 3 | -------------------------------------------------------------------------------- /机试历年真题/2020/number.in: -------------------------------------------------------------------------------- 1 | 123 456 78 782 789 2 | -------------------------------------------------------------------------------- /机试历年真题/2021/1.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main(int argc, char *argv[]) { 5 | int n; 6 | cin >> n; 7 | double sum = 0, factor = 1; 8 | for (int i = 1; i <= n; i++) { 9 | factor /= i; 10 | sum += factor; 11 | } 12 | printf("%.4f", sum); 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /机试历年真题/2021/2.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main(int argc, char *argv[]) { 5 | long long a, b, c; 6 | cin >> a >> b; 7 | c = a ^ b; 8 | int ans = 0; 9 | for (int i = 0; i < 64; i++) { 10 | ans += (c & 1); 11 | c >>= 1; 12 | } 13 | cout << ans; 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /机试历年真题/2021/3.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | using namespace std; 4 | 5 | // bool表示当前数字是否通过加法计算得到 6 | #define VEC vector> 7 | 8 | bool solve(VEC &nums) { 9 | int size = nums.size(); 10 | if (size == 1) return (nums[0].first == 24); 11 | VEC tmp; 12 | // 选举nums中的第i个和第j个数字根据加法或乘法组成新的数字 13 | for (int i = 0; i < size - 1; i++) { 14 | for (int j = i + 1; j < size; j++) { 15 | // 将未被选择数字加入tmp中 16 | for (int k = 0; k < size; k++) 17 | if (k != i && k != j) tmp.push_back(nums[k]); 18 | tmp.push_back(make_pair(nums[i].first + nums[j].first, true)); 19 | if (solve(tmp)) return true; 20 | tmp.pop_back(); 21 | // 只有当选取的两个数字都不是通过加法计算得到时才能调用乘法对这两个数字进行计算 22 | if (!nums[i].second && !nums[j].second) { 23 | tmp.push_back(make_pair(nums[i].first * nums[j].first, false)); 24 | if (solve(tmp)) return true; 25 | } 26 | tmp.clear(); 27 | } 28 | } 29 | return false; 30 | } 31 | 32 | int main(int argc, char *argv[]) { 33 | VEC nums; 34 | int num; 35 | for (int i = 0; i < 4; i++) { 36 | cin >> num; 37 | nums.push_back(make_pair(num, false)); 38 | } 39 | cout << (solve(nums) ? "YES" : "NO"); 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /机试历年真题/2021/4.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | using namespace std; 4 | 5 | int main(int argc, char *argv[]) { 6 | long long num; 7 | vector seven; 8 | cin >> num; 9 | while (num) { 10 | seven.push_back(num % 7); 11 | num /= 7; 12 | } 13 | for (int i = seven.size() - 1; i >= 0; i--) 14 | cout << seven[i]; 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /笔试历年真题/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zdszero/ustc-cs-graduate/09b23d3a8085c8fa54fe83087a8cc792e32535d6/笔试历年真题/.DS_Store -------------------------------------------------------------------------------- /笔试历年真题/2003.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zdszero/ustc-cs-graduate/09b23d3a8085c8fa54fe83087a8cc792e32535d6/笔试历年真题/2003.doc -------------------------------------------------------------------------------- /笔试历年真题/2004.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zdszero/ustc-cs-graduate/09b23d3a8085c8fa54fe83087a8cc792e32535d6/笔试历年真题/2004.doc -------------------------------------------------------------------------------- /笔试历年真题/2005.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zdszero/ustc-cs-graduate/09b23d3a8085c8fa54fe83087a8cc792e32535d6/笔试历年真题/2005.doc -------------------------------------------------------------------------------- /笔试历年真题/2006.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zdszero/ustc-cs-graduate/09b23d3a8085c8fa54fe83087a8cc792e32535d6/笔试历年真题/2006.doc -------------------------------------------------------------------------------- /笔试历年真题/2007.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zdszero/ustc-cs-graduate/09b23d3a8085c8fa54fe83087a8cc792e32535d6/笔试历年真题/2007.doc -------------------------------------------------------------------------------- /笔试历年真题/2008.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zdszero/ustc-cs-graduate/09b23d3a8085c8fa54fe83087a8cc792e32535d6/笔试历年真题/2008.doc -------------------------------------------------------------------------------- /笔试历年真题/2009-2012年中科大计算机考研复试笔试试题.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zdszero/ustc-cs-graduate/09b23d3a8085c8fa54fe83087a8cc792e32535d6/笔试历年真题/2009-2012年中科大计算机考研复试笔试试题.pdf -------------------------------------------------------------------------------- /笔试历年真题/2009.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zdszero/ustc-cs-graduate/09b23d3a8085c8fa54fe83087a8cc792e32535d6/笔试历年真题/2009.doc -------------------------------------------------------------------------------- /笔试历年真题/2010.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zdszero/ustc-cs-graduate/09b23d3a8085c8fa54fe83087a8cc792e32535d6/笔试历年真题/2010.doc -------------------------------------------------------------------------------- /笔试历年真题/2013.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zdszero/ustc-cs-graduate/09b23d3a8085c8fa54fe83087a8cc792e32535d6/笔试历年真题/2013.pdf -------------------------------------------------------------------------------- /笔试历年真题/2015科大(中国科技大学)复试真题.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zdszero/ustc-cs-graduate/09b23d3a8085c8fa54fe83087a8cc792e32535d6/笔试历年真题/2015科大(中国科技大学)复试真题.doc -------------------------------------------------------------------------------- /笔试历年真题/2016复试.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zdszero/ustc-cs-graduate/09b23d3a8085c8fa54fe83087a8cc792e32535d6/笔试历年真题/2016复试.docx -------------------------------------------------------------------------------- /笔试历年真题/2018复试考试范围.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zdszero/ustc-cs-graduate/09b23d3a8085c8fa54fe83087a8cc792e32535d6/笔试历年真题/2018复试考试范围.docx -------------------------------------------------------------------------------- /笔试历年真题/笔试整理.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zdszero/ustc-cs-graduate/09b23d3a8085c8fa54fe83087a8cc792e32535d6/笔试历年真题/笔试整理.docx -------------------------------------------------------------------------------- /面试经验/面试经验.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zdszero/ustc-cs-graduate/09b23d3a8085c8fa54fe83087a8cc792e32535d6/面试经验/面试经验.docx --------------------------------------------------------------------------------