以下为笔者的刷题漫漫心路,是笔者立志刷完PAT(Advanced Level)的一个见证,也是一个题解代码汇总贴。
以下代码均为笔者自写,有些题解和思路可能不是最优解,望读者轻喷。欢迎指出代码逻辑或者细节错误和笔者共同交流。
希望读者仔细食用。也能和读者共同进步成长!
PAT (Advanced Level) Practice个人题解目录
题号 | 题目 | 代码传送门 | 算法思路 |
|---|---|---|---|
1001 | A+B Format (20) | 字符串+模拟 | |
1002 | A+B for Polynomials (25) | 模拟 | |
1003 | Emergency (25) | Dijkstrla | |
1004 | Counting Leaves (30) | DFS | |
1005 | Spell It Right (25) | 模拟 | |
1006 | Sign In and Sign Out (25) | 模拟 | |
1007 | Maximum Subsequence Sum (25) | 线性DP | |
1008 | Elevator (20) | 模拟 | |
1009 | Product of Polynomials (25) | 模拟 | |
1010 | Radix (25) | 二分 | |
1011 | World Cup Betting (20) | 模拟 | |
1012 | The Best Rank (25) | 模拟 | |
1013 | Battle Over Cities (25) | 并查集 | |
1015 | Reversible Primes (20) | 素数+模拟 | |
1018 | Public Bike Management (30) | Dijkstrla+DFS | |
1019 | General Palindromic Number (20) | 回文串 | |
1020 | Tree Traversals (25) | 树的遍历 | |
1021 | Deepest Root (25) | DFS | |
1022 | Digital Library (30) | STL+哈希 | |
1023 | Have Fun with Numbers (20) | 高精度 | |
1024 | Palindromic Number (25) | 高精度+回文串 | |
1025 | PAT Ranking (25) | 模拟 | |
1027 | Colors in Mars (20) | 字符串 | |
1028 | List Sorting (25) | STL | |
1029 | Median(25) | STL | |
1030 | Travel Plan (30) | Dijkstrla | |
1031 | Hello World for U (20) | 字符串+模拟 | |
1032 | Sharing (25) | 链表 | |
1033 | To Fill or Not to Fill (25) | 贪心 | |
1034 | Head of a Gang (30) | 并查集 | |
1035 | Password (20) | 模拟 | |
1036 | Boys vs Girls (25) | STL+哈希 | |
1037 | Magic Coupon (25) | 贪心 | |
1038 | Recover the Smallest Number (30) | 贪心 | |
1039 | Course List for Student (25) | STL+哈希 | |
1040 | Longest Symmetric String (25) | Manacher | |
1041 | Be Unique (20) | STL | |
1042 | Shuffling Machine (20) | 模拟 | |
1043 | Is It a Binary Search Tree (25) | 二叉排序树 | |
1044 | Shopping in Mars (25) | 前缀和+双指针 | |
1045 | Favorite Color Stripe (30) | 线性DP | |
1046 | Shortest Distance (20) | 前缀和 | |
1047 | Student List for Course (25) | STL+哈希 | |
1048 | Find Coins (25) | 双指针 | |
1049 | Counting Ones (30) | 数位DP | |
1050 | String Subtraction (20) | 字符串 | |
1051 | Pop Sequence (25) | 栈 | |
1052 | Linked List Sorting (25) | 链表 | |
1053 | Path of Equal Weight(30) | DFS | |
1054 | The Dominant Color (20) | STL | |
1055 | The World‘s Richest (25) | 结构体排序 | |
1057 | Stack (30) | 树状数组+二分+栈 | |
1058 | A+B in Hogwarts (20) | 模拟 | |
1059 | Prime Factors (25) | 埃氏筛+约数分解 | |
1062 | Talent and Virtue (25) | 结构体排序 | |
1063 | Set Similarity (25) | STL | |
1064 | Complete Binary Search Tree (30) | 二叉排序树 | |
1065 | A+B and C (64bit) (20) | 溢出处理 | |
1066 | Root of AVL Tree (25) | 平衡二叉树 | |
1067 | Sort with Swap(0, i) (25) | 贪心 | |
1068 | Find More Coins (30) | DP+背包路径 | |
1069 | The Black Hole of Numbers (20) | 思维+模拟 | |
1070 | Mooncake (25) | 贪心 | |
1071 | Speech Patterns (25) | 字符串 | |
1072 | Gas Station (30) | Dijkstrla | |
1091 | Acute Stroke (30) | Flood Fill |