kexer2018 / PAT-1

浙江大学PAT题解

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

📚PAT是浙江大学计算机程序设计能力测试系统,被用于研究生机试和PAT证书资格测试

这个Project维护大部分题库的代码,其中的一些也参考过一些blog版本

代码主要语言使用C++, C, Python, Java

绝大多数代码中开头的注释写有简单的解题思路,希望对大家能有所帮助,有关研究生生活的信息,也欢迎咨询:smiley:

目录

Top-Level

ID Title Code
1001 Battle Over Cities - Hard Version (35) C++
1002 Business (35) C++
1003 Universal Travel Sites (35) C++
1004 To Buy or Not to Buy - Hard Version (35) C++
1005 Programming Pattern (35) C++
1006 Tree Traversals - Hard Version (35) Python
1007 Red-black Tree (35) C++
1008 Airline Routes (35) C++
1009 Triple Inversions (35) C++
1010 Lehmer Code (35) C++
1011 Cut Rectangles (35) Python
1012 Greedy Snake (35) C++
1013 Image Segmentation (35) Python
1014 Circles of Friends (35) C++
1015 Letter-moving Game (35) C++
1016 Uniqueness of MST (35) C++
1017 The Best Peak Shape (35) Python
1018 Subnumbers (35) Python
1019 Separate the Animals (35) C++
1020 Delete At Most Two Characters (35) C++
1021 Safe Fruit (35) C++
1022 Werewolf (35) C++
1023 The Best Polygon (35) C++
1024 Currency Exchange Centers (35) C++
1025 Keep at Most 100 Characters (35) C++
1026 String of Colorful Beads (35) C++
1027 Larry and Inversions (35) C++

Advance-Level

ID Title Code
1001 A+B Format (20) C++
1002 A+B for Polynomials (25) C++
1003 Emergency (25) C++
1004 Counting Leaves (30) C++
1005 Spell It Right (20) C++
1006 Sign In and Sign Out (25) C++
1007 Maximum Subsequence Sum (25) C++
1008 Elevator (20) C++
1009 Product of Polynomials (25) C++
1010 Radix (25) C++
1011 World Cup Betting (20) C++
1012 The Best Rank (25) C++
1013 Battle Over Cities (25) C++
1014 Waiting in Line (30) C++
1015 Reversible Primes (20) C++
1016 Phone Bills (25) C++
1017 Queueing at Bank (25) C++
1018 Public Bike Management (30) C++
1019 General Palindromic Number (20) C++
1020 Tree Traversals (25) C++
1021 Deepest Root (25) C++
1022 Digital Library (30) C++
1023 Have Fun with Numbers (20) C++
1024 Palindromic Number (25) Java
1025 PAT Ranking (25) C++
1026 Table Tennis (30) C++
1027 Colors in Mars (20) C++
1028 List Sorting (25) C++
1029 Median (25) C++
1030 Travel Plan (30) C++
1031 Hello World for U (20) C++
1032 Sharing (25) C++
1033 To Fill or Not to Fill (25) C++
1034 Head of a Gang (30) C++
1035 Password (20) C++
1036 Boys vs Girls (25) C++
1037 Magic Coupon (25) C++
1038 Recover the Smallest Number (30) C++
1039 Course List for Student (25) C++
1040 Longest Symmetric String (25) C++
1041 Be Unique (20) C++
1042 Shuffling Machine (20) C++
1043 Is It a Binary Search Tree (25) C++
1044 Shopping in Mars (25) C++
1045 Favorite Color Stripe (30) C++
1046 Shortest Distance (20) C++
1047 Student List for Course (25) C++
1048 Find Coins (25) C++
1049 Counting Ones (30) C++
1050 String Subtraction (20) C++
1051 Pop Sequence (25) C++
1052 Linked List Sorting (25) C++
1053 Path of Equal Weight (30) C++
1054 The Dominant Color (20) C++
1055 The World's Richest (25) C++
1056 Mice and Rice (25) C++
1057 Stack (30) C++
1058 A+B in Hogwarts (20) C++
1059 Prime Factors (25) C++
1060 Are They Equal (25) C++
1061 Dating (20) C++
1062 Talent and Virtue (25) C++
1063 Set Similarity (25) C++
1064 Complete Binary Search Tree (30) C++
1065 A+B and C (64bit) (20) C++
1066 Root of AVL Tree (25) C++
1067 Sort with Swap(0,) (25) C++
1068 Find More Coins (30) C++
1069 The Black Hole of Numbers (20) C++
1070 Mooncake (25) C++
1071 Speech Patterns (25) C++
1072 Gas Station (30) C++
1073 Scientific Notation (20) C++
1074 Reversing Linked List (25) C++
1075 PAT Judge (25) C++
1076 Forwards on Weibo (30) C++
1077 Kuchiguse (20) C++
1078 Hashing (25) C++
1079 Total Sales of Supply Chain (25) C++
1080 Graduate Admission (30) C++
1081 Rational Sum (20) C++
1082 Read Number in Chinese (25) C++
1083 List Grades (25) C++
1084 Broken Keyboard (20) Python
1085 Perfect Sequence (25) C++
1086 Tree Traversals Again (25) C++
1087 All Roads Lead to Rome (30) C++
1088 Rational Arithmetic (20) C++
1089 Insert or Merge (25) C++
1090 Highest Price in Supply Chain (25) C++Python
1091 Acute Stroke (30) C++
1092 To Buy or Not to Buy (20) C++
1093 Count PAT's (25) C++
1094 The Largest Generation (25) C++
1095 Cars on Campus (30) C++
1096 Consecutive Factors (20) C++
1097 Deduplication on a Linked List (25) C++
1098 Insertion or Heap Sort (25) C++
1099 Build A Binary Search Tree (30) C++
1100 Mars Numbers (20) Python
1101 Quick Sort (25) C++
1102 Invert a Binary Tree (25) C++
1103 Integer Factorization (30) C++
1104 Sum of Number Segments (20) Python
1105 Spiral Matrix (25) C++
1106 Lowest Price in Supply Chain (25) C++
1107 Social Clusters (30) C++
1108 Find Average (20) C++
1109 Group Photo (25) C++
1110 Complete Binary Tree (25) C++
1111 Online Map (30) C++
1112 Stucked Keyboard (20) C++
1113 Integer Set Partition (25) C++
1114 Family Property (25) C++
1115 Counting Nodes in a BST (30) Python
1116 Come on! Let's C (20) Python
1117 Eddington Number(25) Python
1118 Birds in Forest (25) Python
1119 Pre- and Post-order Traversals (30) Python
1120 Friend Numbers (20) Python
1121 Damn Single (25) Python
1122 Hamiltonian Cycle (25) Python
1123 Is It a Complete AVL Tree (30) Python
1124 Raffle for Weibo Followers (20) Python
1125 Chain the Ropes (25) Python
1126 Eulerian Path (25) C++
1127 ZigZagging on a Tree (30) Python
1128 N Queens Puzzle (20) C++
1129 Recommendation System (25) C++
1130 Infix Expression (25) Python
1131 Subway Map (30) Python
1132 Cut Integer (20) Python
1133 Splitting A Linked List (25) C++
1134 Vertex Cover (25) Python
1135 Is It A Red-Black Tree (30) Python
1136 A Delayed Palindrome (20) Python
1137 Final Grading (25) C++
1138 Postorder Traversal (25) C++
1139 First Contact (30) C++
1140 Look-and-say Sequence (20) C++
1141 PAT Ranking of Institutions (25) C++
1142 Maximal Clique (25) C++
1143 Lowest Common Ancestor (30) C++
1144 The Missing Number (20) C++
1145 Hashing - Average Search Time (25) C++
1146 Topological Order (25) C++
1147 Heaps (30) C++
1148 Werewolf - Simple Version (20) C++
1149 Dangerous Goods Packaging (25) C++
1150 Travelling Salesman Problem (25) C++
1151 LCA in a Binary Tree (30) C++
1152 Google Recruitment (20) C++
1153 Decode Registration Card of PAT (25) C++
1154 Vertex Coloring (25) C++
1155 Heap Paths (30) C++

Basic-Level

ID Title Code
1001 害死人不偿命的(3n+1)猜想 (15) C++
1002 写出这个数 (20) C++
1003 我要通过!(20) C++
1004 成绩排名 (20) C++
1005 继续(3n+1)猜想 (25) C++
1006 换个格式输出整数 (15) C++
1007 素数对猜想 (20) C++
1008 数组元素循环右移问题 (20) C++
1009 说反话 (20) C++
1010 一元多项式求导 (25) C++
1011 A+B和C (15) C++
1012 数字分类 (20) C++
1013 数素数 (20) C++
1014 福尔摩斯的约会 (20) C++
1015 德才论 (25) C++
1016 部分A+B (15) C++
1017 A除以B (20) Java
1018 锤子剪刀布 (20) C++
1019 数字黑洞 (20) C++
1020 月饼 (25) C++
1021 个位数统计 (15) C++
1022 D进制的A+B (20) C++
1023 组个最小数 (20) C++
1024 科学计数法 (20) C++
1025 反转链表 (25) C++
1026 程序运行时间 (15) Python
1027 打印沙漏 (20) Python
1028 人口普查 (20) C++
1029 旧键盘 (20) Python
1030 完美数列 (25) C++
1031 查验身份证 (15) C++
1032 挖掘机技术哪家强 (20) C++
1033 旧键盘打字 (20) C++
1034 有理数四则运算 (20) C++
1035 插入与归并 (25) C++
1036 跟奥巴马一起编程(15) C++
1037 在霍格沃茨找零钱(20) C++
1038 统计同成绩学生(20) C++
1039 到底买不买(20) C++
1040 有几个PAT(25) C++
1041 考试座位号(15) C++
1042 字符统计(20) C++
1043 输出PATest(20) C++
1044 火星数字(20) C++
1045 快速排序(25) C++
1046 划拳(15) Python
1047 编程团体赛(20) Python
1048 数字加密(20) Python
1049 数列的片段和(20) Python
1050 螺旋矩阵(25) C++
1051 复数乘法(15) C++
1052 卖个萌 (20) C++
1053 住房空置率(20) C++
1054 求平均值(20) C++
1055 集体照(25) C++
1056 组合数的和(15) Python
1057 数零壹(20) Python
1058 选择题(20) Python
1059 C语言竞赛(20) Python
1060 爱丁顿数(25) Python
1061 判断题(15) Python
1062 最简分数(20) Python
1063 计算谱半径(20) Python
1064 朋友数(20) Python
1065 单身狗(25) Python
1066 图像过滤(15) Python
1067 试密码(20) Python
1068 万绿丛中一点红(20) C++
1069 微博转发抽奖(20) Python
1070 结绳(25) Python
1071 小赌怡情(15) Python
1072 开学寄语(20) Python
1073 多选题常见计分法(20) Python
1074 宇宙无敌加法器(20) Python
1075 链表元素分类(25) C++
1076 Wifi密码 (15) Python
1077 互评成绩计算 (20) Python
1078 字符串压缩与解压 (20) Python
1079 延迟的回文数 (20) Python
1080 MOOC期终成绩 (25) C++
1081 检查密码 (15) C++
1082 射击比赛 (20) C++
1083 是否存在相等的差 (20) C++
1084 外观数列 (20) C++
1085 PAT单位排行 (25) C++
1086 就不告诉你 (15) C++
1087 有多少不同的值 (20) C++
1088 三人行 (20) C++
1089 狼人杀-简单版 (20) C++
1090 危险品装箱 (25) C++
1091 N-自守数 (15) C++
1092 最好吃的月饼 (20) C++
1093 字符串A+B (20) C++
1094 谷歌的招聘 (20) C++
1095 解码PAT准考证 (25) C++

**大学MOOC-陈越、何钦铭-数据结构-起步能力自测题

ID Title Code
自测-1 打印沙漏 (20) Python
自测-2 素数对猜想 (20) Python
自测-3 数组元素循环右移问题 (20) Python
自测-4 Have Fun with Numbers (20) Python
自测-5 Shuffling Machine (20) Python

基础编程题目集

ID Title Code
6-1 简单输出整数 (10) C
6-2 多项式求值 (20) C
6-3 简单求和 (10) C
6-4 求自定类型元素的平均 (10) C
6-5 求自定类型元素的最大值 (10) C
6-6 求单链表结点的阶乘和 (15) C
6-7 统计某类完全平方数 (20) C
6-8 简单阶乘计算 (10) C
6-9 统计个位数字 (15) C
6-10 阶乘计算升级版 (20) C
6-11 求自定类型元素序列的中位数 (25) C
6-12 判断奇偶性 (10) C
6-13 折半查找 (15) C
7-1 厘米换算英尺英寸 (15) Python
7-2 然后是几点 (15) Python
7-3 逆序的三位数 (10) Python
7-4 BCD解密 (10) Python
7-5 表格输出 (5) Python
7-6 混合类型数据格式化输入 (5) Python
7-7 12-24小时制 (15) Python
7-8 超速判断 (10) Python
7-9 用天平找小球 (10) Python
7-10 计算工资 (15) Python
7-11 分段计算居民水费 (10) Python
7-12 两个数的简单计算器 (10) Python
7-13 日K蜡烛图 (15) Python
7-14 求整数段和 (15) Python
7-15 计算圆周率 (15) Python
7-16 求符合给定条件的整数集 (15) Python
7-17 爬动的蠕虫 (15) Python
7-18 二分法求多项式单根 (20) Python
7-19 支票面额 (15) Python
7-20 打印九九口诀表 (15) Python
7-21 求特殊方程的正整数解 (15) Python
7-22 龟兔赛跑 (20) Python
7-23 币值转换 (20) Python
7-24 约分最简分式 (15) Python
7-25 念数字 (15) Python
7-26 单词长度 (15) Python
7-27 冒泡法排序 (20) Python
7-28 猴子选大王 (20) Python
7-29 删除字符串中的子串 (20) Python
7-30 字符串的冒泡排序 (20) Python
7-31 字符串循环左移 (20) Python
7-32 说反话-加强版 (20) Python
7-33 有理数加法 (15) Python
7-34 通讯录的录入与显示 (10) Python
7-35 有理数均值 (20) Python
7-36 复数四则运算 (15) Python
7-37 整数分解为若干项之和 (20) Python
7-38 数列求和-加强版 (20) Python

数据结构与算法题目集(中文)

ID Title Code
6-1 单链表逆转 (20) C
6-2 顺序表操作集 (20) C
6-3 求链式表的表长 (10) C
6-4 链式表的按序号查找 (10) C
6-5 链式表操作集 (20) C
6-6 带头结点的链式表操作集 (20) C
6-7 在一个数组中实现两个堆栈 (20) C
6-8 求二叉树高度 (20) C
6-9 二叉树的遍历 (25) C
6-10 二分查找 (20) C
6-11 先序输出叶结点 (15) C
6-12 二叉搜索树的操作集 (30) C
7-1 最大子列和问题 (20) Python
7-2 一元多项式的乘法与加法运算 (20) Python
7-3 树的同构 (25) Python
7-4 是否同一棵二叉搜索树 (25) Python
7-5 堆中的路径 (25) Python
7-6 列出连通集 (25) Python
7-7 六度空间 (30) C++
7-8 哈利·波特的考试 (25) C++
7-9 旅游规划 (25) C++
7-10 公路村村通 (30) C++
7-11 关键活动 (30) C++
7-12 排序 (25) C++
7-13 统计工龄 (20) Python
7-14 电话聊天狂人 (25) C++
7-16 一元多项式求导 (20) C++
7-17 汉诺塔的非递归实现 (25) C++
7-18 银行业务队列简单模拟 (25) C++
7-19 求链式线性表的倒数第K项 (20) C++
7-21 求前缀表达式的值 (25) Python
7-22 堆栈模拟队列 (25) C++
7-23 还原二叉树 (25) Python
7-24 树种统计 (25) C++
7-25 朋友圈 (25) C++
7-26 Windows消息队列 (25) C++
7-28 搜索树判断 (25) C++
7-29 修理牧场 (25) C++
7-30 目录树 (30) C++
7-31 笛卡尔树 (25) C++
7-32 哥尼斯堡的“七桥问题” (25) C++
7-33 地下迷宫探索 (30) C++
7-34 任务调度的合理性 (25) C++
7-35 城市间紧急救援 (25) C++
7-36 社交网络图中结点的“重要性”计算 (30) C++
7-37 模拟EXCEL排序 (25) C++
7-38 寻找大富翁 (25) C++
7-39 魔法优惠券 (25) C++
7-40 奥运排行榜 (25) C++
7-41 PAT排名汇总 (25) C++
7-42 整型关键字的散列映射 (25) C++
7-43 字符串关键字的散列映射 (25) C++
7-44 基于词频的文件相似度 (30) Python
7-45 航空公司VIP客户查询 (25) C++
7-46 新浪微博热门话题 (30) C++
7-47 打印选课学生名单 (25) C++
7-48 银行排队问题之单窗口“夹塞”版 (30) C++
7-49 打印学生选课清单 (25) C++
7-50 畅通工程之局部最小花费问题 (35) C++
7-51 两个有序链表序列的合并 (20) C++
7-52 两个有序链表序列的交集 (25) C++
7-53 两个有序序列的中位数 (25) C++

About

浙江大学PAT题解


Languages

Language:C++ 82.8%Language:Python 15.1%Language:C 1.9%Language:Java 0.2%