![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
pat
EucalyptLuvk
blog.eluvk.cn
展开
-
2019年12月7号冬季PAT甲级满分
没想到我也能写出这么硬气的标题,题目解析和我考场上写的ac代码传博客上了。 倒着4-3-2-1做的,分别用时21,20,13,52。 做完看的时候已经48个满分了,如果第一题getline没忘记格式应该能再快十几分钟。 一点点小经验,希望能帮到有需要的人。 算法笔记+刷官网题库不解释 官网前面恶心的模拟题可以放低重心,重点关注后面的50道,更重要的是近几次的没扔到155题里的机试、最近的考试题,...原创 2019-12-08 04:10:12 · 927 阅读 · 1 评论 -
PAT-2019年冬季考试-甲级-7-4 Cartesian Tree (30分)
A Cartesian tree is a binary tree constructed from a sequence of distinct numbers. The tree is heap-ordered, and an inorder traversal returns the original sequence. For example, given the sequence { 8...原创 2019-12-08 02:54:31 · 225 阅读 · 0 评论 -
PAT-2019年冬季考试-甲级-7-3 Summit (25分)
A summit (峰会) is a meeting of heads of state or government. Arranging the rest areas for the summit is not a simple job. The ideal arrangement of one area is to invite those heads so that everyone is ...原创 2019-12-08 02:46:06 · 540 阅读 · 0 评论 -
PAT-2019年冬季考试-甲级-7-2 Block Reversing (25分)
Given a singly linked list L. Let us consider every K nodes as a block (if there are less than K nodes at the end of the list, the rest of the nodes are still considered as a block). Your job is to re...原创 2019-12-08 02:39:08 · 394 阅读 · 0 评论 -
PAT-2019年冬季考试-甲级-7-1 Good in C (20分)
When your interviewer asks you to write “Hello World” using C, can you do as the following figure shows? Input Specification: Each input file contains one test case. For each case, the first part giv...原创 2019-12-08 02:27:37 · 343 阅读 · 0 评论 -
1111 Online Map
1111 Online Map (30 分) 题目地址 优先队列(重载运算符)优化的dijkstra,route很精妙 #include <stdio.h> #include <iostream> #include <vector> #include <queue> #define INF 0x3fffffff #define MAX 502 usi...原创 2019-09-07 11:01:11 · 117 阅读 · 0 评论 -
PAT甲级(Advanced)解题记录
PAT甲级(Advanced)解题记录 历时:20190627-至今 github代码仓库: 传送门:地址 按解题时间: blog记录 按题目顺序: 1001错误一个,记得考虑特殊情况0; 1002错误一个,注意判断浮点数的时候,用差的绝对值比较呀fabs(coeff[i]-0.0)>10e-5漏掉了一个fabs导致一个用例一直错误。 1003 dijkstra最短距离算法。用邻接表和邻接矩...原创 2019-07-27 13:34:22 · 299 阅读 · 0 评论 -
1123 Is It a Complete AVL Tree
1123 Is It a Complete AVL Tree 题目地址 四种旋转: 按照图的方向写: Figure 12为rightrotation和leftrotation。 rlrotation和lrrotation,分别是先把根节点的右节点右旋再把根节点左旋转、先把根节点的左节点左旋再把根节点右旋转 层次遍历的同时判断是否为完整二叉树 当某一层没有左右子树(为NULL)时,激活标识afte...原创 2019-07-17 19:05:16 · 106 阅读 · 0 评论 -
1038 Recover the Smallest Number
1038 Recover the Smallest Number 题目地址 思路: 直接按位排序,对不同长度的字符串分情况讨论(从没写过这么长的cmp函数) 坑: 测试点2 全部都是0; 因为输出最终数字的时候开头的0不输出,所以设立一个标志位检测省略过开头的0没,什么都没输出(全部省略)就再补充一个0 AC代码: #include <stdio.h> #include <str...原创 2019-07-06 14:15:50 · 428 阅读 · 0 评论 -
算法笔记学习&&PAT甲级解题记录
算法笔记学习记录 2019.06.26 float&&double 推荐全部使用double,注意区分scanf("%lf",&double1);与printf("%f",double1); 分清%md,%0md,%.md以及可以合用%n.md getchar()&&putchar() getchar可以识别换行符\n bd>Ctrl/Co...原创 2019-07-02 00:53:25 · 632 阅读 · 0 评论 -
1064 Complete Binary Search Tree
1064 Complete Binary Search Tree 题目地址 完全二叉树和二叉搜索树结合 聪明办法: #include <stdio.h> #include <string.h> #include <vector> #include <math.h> #include <algorithm> #include <que...原创 2019-07-02 16:16:57 · 395 阅读 · 0 评论