PAT甲级
努力努力再努力0.0
在绝望中寻找希望
展开
-
【动态规划】PAT 甲级 1007 动态规划、牛客网 最大连续子序列、牛客 最大上升子序列
1007 Maximum Subsequence Sum (25 分)Given a sequence of K integers { N1, N2, ..., NK }. A continuous subsequence is defined to be { Ni, Ni+1, ..., Nj } where 1≤i≤j≤K. The Maximum Su...原创 2019-01-26 11:54:35 · 200 阅读 · 0 评论 -
【排序】PAT甲1089
1089 Insert or Merge (25 分)According to Wikipedia:Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort removes one...原创 2019-02-12 20:40:34 · 169 阅读 · 0 评论 -
【字符串】PAT甲(求公共后缀)、PAT甲 1069整型转字符串,字符串转整型、牛客 子串计算(substr)、牛客 字符串排序(stable_sort)
1077 Kuchiguse (20 分)The Japanese language is notorious for its sentence ending particles. Personal preference of such particles can be considered as a reflection of the speaker's personality. Such ...原创 2019-02-12 00:21:48 · 209 阅读 · 0 评论 -
【贪心】PAT甲级1067
1067 Sort with Swap(0, i) (25 分)Given any permutation of the numbers {0, 1, 2,..., N−1}, it is easy to sort them in increasing order. But what if Swap(0, *) is the ONLY operation that is allowed to ...原创 2019-02-10 20:54:33 · 261 阅读 · 0 评论 -
PAT甲级1065 longlong溢出问题【细节】
1065 A+B and C (64bit) (20 分)Given three integers A, B and C in [−263,263], you are supposed to tell whether A+B>C.Input Specification:The first line of the input gives the positive num...原创 2019-02-10 20:17:42 · 257 阅读 · 0 评论 -
【树】建树遍历 甲1102【找根节点】、1115 Counting Nodes in a BST(数一层的节点数)
1102 Invert a Binary Tree (25 分)The following is from Max Howell @twitter:Google: 90% of our engineers use the software you wrote (Homebrew), but you can't invert a binary tree on a whiteboard so...原创 2019-02-16 15:28:43 · 207 阅读 · 1 评论 -
【二分查找】PAT甲级1048、甲1085
1048 Find Coins (25 分)Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which could accept all kinds of coi...原创 2019-02-03 22:12:29 · 157 阅读 · 0 评论 -
【深搜】PAT甲级 1013 图 (计算连通分量)、牛客网 连通图、牛客网 欧拉回路、pat甲1079、甲1094
1013 Battle Over Cities (25 分)It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that city are closed. We...原创 2019-01-26 22:34:03 · 175 阅读 · 0 评论 -
【广搜】PAT 1004 树、甲1076、甲1090、牛客 玛雅人的密码【状态BFS】
1004 Counting Leaves (30 分)A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child.Input Specification:Each input file contains on...原创 2019-01-26 19:53:44 · 142 阅读 · 0 评论 -
【Dijkstra】PAT甲级1003 最短路径、PAT 甲级1030 (Dijkstra+DFS记录路径)
1003 Emergency (25 分)As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue teams...原创 2019-01-25 22:33:37 · 200 阅读 · 0 评论 -
【巧思】甲1093
1093 Count PAT's (25 分)The string APPAPT contains two PAT's as substrings. The first one is formed by the 2nd, the 4th, and the 6th characters, and the second one is formed by the 3rd, the 4th, and ...原创 2019-02-13 17:40:10 · 85 阅读 · 0 评论