Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

460 Commits

Repository files navigation

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

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

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

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

目录

Top-Level

IDTitleCode
1001Battle Over Cities - Hard Version (35)C++
1002Business (35)C++
1003Universal Travel Sites (35)C++
1004To Buy or Not to Buy - Hard Version (35)C++
1005Programming Pattern (35)C++
1006Tree Traversals - Hard Version (35)Python
1007Red-black Tree (35)C++
1008Airline Routes (35)C++
1009Triple Inversions (35)C++
1010Lehmer Code (35)C++
1011Cut Rectangles (35)Python
1012Greedy Snake (35)C++
1013Image Segmentation (35)Python
1014Circles of Friends (35)C++
1015Letter-moving Game (35)C++
1016Uniqueness of MST (35)C++
1017The Best Peak Shape (35)Python
1018Subnumbers (35)Python
1019Separate the Animals (35)C++
1020Delete At Most Two Characters (35)C++
1021Safe Fruit (35)C++
1022Werewolf (35)C++
1023The Best Polygon (35)C++
1024Currency Exchange Centers (35)C++
1025Keep at Most 100 Characters (35)C++
1026String of Colorful Beads (35)C++
1027Larry and Inversions (35)C++
1028Do All Roads Lead to Rome (35)C++
1029Array Cutting Score (35)C++
1030Beautiful Subsequence (35)C++
1032Fighting the Monsters (35)C++
1033Strings of Red and Blue (35)C++
1034Number Game (35)C++
1035Color the Tree (35)C++

Advance-Level

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

Basic-Level

IDTitleCode
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++
1011A+B和C (15)C++
1012数字分类 (20)C++
1013数素数 (20)C++
1014福尔摩斯的约会 (20)C++
1015德才论 (25)C++
1016部分A+B (15)C++
1017A除以B (20)Java
1018锤子剪刀布 (20)C++
1019数字黑洞 (20)C++
1020月饼 (25)C++
1021个位数统计 (15)C++
1022D进制的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
1059C语言竞赛(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++
1076Wifi密码 (15)Python
1077互评成绩计算 (20)Python
1078字符串压缩与解压 (20)Python
1079延迟的回文数 (20)Python
1080MOOC期终成绩 (25)C++
1081检查密码 (15)C++
1082射击比赛 (20)C++
1083是否存在相等的差 (20)C++
1084外观数列 (20)C++
1085PAT单位排行 (25)C++
1086就不告诉你 (15)C++
1087有多少不同的值 (20)C++
1088三人行 (20)C++
1089狼人杀-简单版 (20)C++
1090危险品装箱 (25)C++
1091N-自守数 (15)C++
1092最好吃的月饼 (20)C++
1093字符串A+B (20)C++
1094谷歌的招聘 (20)C++
1095解码PAT准考证 (25)C++
1096大美数 (25)Python
1097矩阵行平移 (20)Python
1098岩洞施工 (20)Python
1099性感素数 (20)Python
1100校庆 (25)Python
1101B是A的多少倍 (15)Python
1102教超冠军卷 (20)Python
1103缘分数 (20)Python
1104天长地久 (20)Python
1105链表合并 (25)C++
11062019数列 (15)Python
1107老鼠爱大米 (20)Python
1108String复读机 (20)Python
1109擅长C (20)Python
1110区块反转 (25)C++
1111对称日 (15)Python
1112超标区间 (20)Python
1113钱串子的加法 (20)Python
1114全素日 (20)Python
1115裁判机 (25)C++
1116多二了一点 (15)Python
1117数字之王 (20)Python
1118如需挪车请致电 (20)Python
1119胖达与盆盆奶 (20)Python
1120买地攻略 (25)C++
1121祖传好运 (15)Python
1122找奇葩 (20)Python
1123舍入 (20)Python
1124最近的斐波那契数 (20)Python
1125子串与子列 (25)C++

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

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

基础编程题目集

IDTitleCode
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-4BCD解密 (10)Python
7-5表格输出 (5)Python
7-6混合类型数据格式化输入 (5)Python
7-712-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

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

IDTitleCode
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-26Windows消息队列 (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-41PAT排名汇总 (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++

Data Structures and Algorithms (English)

IDTitleCode
6-1Deque (25)C
6-2Two Stacks In One Array (20)C
6-3Add Two Polynomials (20)C
6-4Reverse Linked List (20)C
6-5Evaluate Postfix Expression (25)C
6-6Level-order Traversal (25)C
6-7Isomorphic (20)C
6-8Percolate Up and Down (20)C
6-9Sort Three Distinct Keys (20)C
6-10Strongly Connected Components (30)C
6-11Shortest Path [1] (25)C
6-12Shortest Path [2] (25)C
6-13Topological Sort (25)C
6-14Count Connected Components (20)C
6-15Iterative Mergesort (25)C
6-16Shortest Path [3] (25)C
6-17Shortest Path [4] (25)C
7-1Maximum Subsequence Sum (25)Python
7-2Reversing Linked List (25)C++
7-3Pop Sequence (25)C++
7-4List Leaves (25)Python
7-5Tree Traversals Again (25)C++
7-6Root of AVL Tree (25)C++
7-7Complete Binary Search Tree (30)C++
7-8File Transfer (25)Python
7-9Huffman Codes (30)Python
7-10Saving James Bond - Easy Version (25)Python
7-12How Long Does It Take (25)Python
7-13Insert or Merge (25)C++
7-14Insertion or Heap Sort (25)C++
7-15PAT Judge (25)C++
7-16Sort with Swap(0, i) (25)C++
7-17Hashing (25)C++
7-18Hashing - Hard Version (30)Python
7-19Battle Over Cities - Hard Version (35)C++

团体程序设计天梯赛-练习集

IDTitleCode
L1-001Hello WorldPythonGo
L1-002打印沙漏Python
L1-003个位数统计Python
L1-004计算摄氏温度PythonGo
L1-005考试座位号Python
L1-006连续因子Python
L1-007念数字Python
L1-008求整数段和Python
L1-009N个数求和Python
L1-010比较大小Python
L1-011A-BPython
L1-012计算指数Python
L1-013计算阶乘和Python
L1-014简单题Python
L1-015跟奥巴马一起画方块Python
L1-016查验身份证Python
L1-017到底有多二Python
L1-018大笨钟Python
L1-019谁先倒Python
L1-020帅到没朋友Python
L1-021重要的话说三遍Python
L1-022奇偶分家Python
L1-023输出GPLTPython
L1-024后天Python
L1-025正整数A+BPython
L1-026I Love GPLTPython
L1-027出租Python
L1-028判断素数Python
L1-029是不是太胖了Python
L1-030一帮一Python
L1-031到底是不是太胖了Python
L1-032Left-padPython
L1-033出生年Python
L1-034点赞Python
L1-035情人节Python
L1-036A乘以BPython
L1-037A除以BPython
L1-038新世界Python
L1-039古风排版Python
L1-040最佳情侣身高差Python
L1-041寻找250Python
L1-042日期格式化Python
L1-043阅览室Python
L1-044稳赢Python
L1-045宇宙无敌大招呼Python
L1-046整除光棍Python
L1-047装睡Python
L1-048矩阵A乘以BPython
L1-049天梯赛座位分配Python
L1-050倒数第N个字符串Python
L1-051打折Python
L1-0522018我们要赢Python
L1-053电子汪Python
L1-054福到了Python
L1-055谁是赢家Python
L1-056猜数字Python
L1-057PTA使我精神焕发Python
L1-0586翻了Python
L1-059敲笨钟Python
L1-060心理阴影面积Python
L1-061新胖子公式Python
L1-062幸运彩票Python
L1-063吃鱼还是吃肉Python
L1-064估值一亿的AI核心代码Python
L1-065嫑废话上代码Python
L1-066猫是液体Python
L1-067洛希极限Python
L1-068调和平均Python
L1-069胎压监测Python
L1-070吃火锅Python
L1-071前世档案Python
L1-072刮刮彩票Python
L1-073人与神Python
L1-074两小时学完C语言Python
L1-075强迫症Python
L1-076降价提醒机器人Python
L1-077大笨钟的心情Python
L1-078吉老师的回归Python
L1-079天梯赛的善良Python
L1-080乘法口诀数列Python
L1-081今天我要赢Python
L1-082种钻石Python
L1-083谁能进图书馆Python
L1-084拯救外星人Python
L1-085试试手气Python
L1-086斯德哥尔摩火车上的题Python
L1-087机工士姆斯塔迪奥Python
L1-088静静的推荐Python
L1-089最好的文档Go
L1-090什么是机器学习Python
L1-091程序员买包子Python
L1-092进化论Python
L1-093猜帽子游戏Python
L1-094剪切粘贴Python
L1-095分寝室Python
L1-096谁管谁叫爹Python
L2-001紧急救援C++
L2-002链表去重C++
L2-003月饼C++
L2-004这是二叉搜索树吗?C++
L2-005集合相似度C++
L2-006树的遍历C++
L2-007家庭房产C++
L2-008最长对称子串C
L2-009抢红包C++
L2-010排座位C++
L2-011玩转二叉树C++
L2-012关于堆的判断C++
L2-013红色警报C++
L2-014列车调度C++Go
L2-015互评成绩C++
L2-016愿天下有情人都是失散多年的兄妹C++
L2-017人以群分C++
L2-018多项式A除以BC++
L2-019悄悄关注C++
L2-020功夫传人C++
L2-021点赞狂魔C++
L2-022重排链表C++
L2-023图着色问题C++
L2-024部落C++
L2-025分而治之C++
L2-026小字辈C++
L2-027名人堂与代金券C++
L2-028秀恩爱分得快C++
L2-029特立独行的幸福C++
L2-033简单计算器C++
L2-035完全二叉树的层序遍历C++

About

浙江大学PAT题解 https://pintia.cn

Topics

Resources

Stars

283 stars

Watchers

10 watching

Forks

Used by

Contributors

Languages