自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(19)
  • 资源 (1)
  • 收藏
  • 关注

原创 PAT(甲级)2020年春季考试 7-4 Replacement Selection (30分)

7-4 Replacement Selection (30分)When the input is much too large to fit into memory, we have to do external sorting instead of internal sorting. One of the key steps in external sorting is to generate sets of sorted records (also called runs) with limited

2020-08-04 14:18:14 903 1

原创 PAT(甲级)2020年春季考试 7-3 Safari Park (25分)

7-3 Safari Park (25分)A safari park(野生动物园)has K species of animals, and is divided into N regions. The managers hope to spread the animals to all the regions, but not the same animals in the two neighboring regions. Of course, they also realize that this i

2020-08-03 22:22:24 438

原创 PAT(甲级)2020年春季考试 7-2 The Judger (25分)

A game of numbers has the following rules: at the beginning, two distinct positive integers are given by the judge. Then each player in turn must give a number to the judge. The number must be the difference of two numbers that are previously given, and mu

2020-08-03 22:02:47 443 1

原创 1082 Read Number in Chinese (25分)

写这篇的主要目的就是应试和实际代码是有区别的题目:给个数字用中文方式打印Sample Input 1:-123456789Sample Output 1:Fu yi Yi er Qian san Bai si Shi wu Wan liu Qian qi Bai ba Shi jiuSample Input 2:100800Sample Output 2:yi Shi Wan ling ba Bai下面代码测试例都过,但并不是完美代码,比如10000,10001等都是错的,但就是能拿

2020-08-29 15:50:31 100

原创 pat 单词总结

pat pat刷题笔记#Unfamiliar word #不熟悉的单词partition 划分pivot 枢distinct 不同Specification 规格consecutive 连续elevator 电梯denote 表示specified 规定decimal 十进制reversible 可逆prime 主要Quadratic 二次probing 探测collisions 碰撞distinct 不

2020-08-29 00:43:27 294

原创 浙江大学 计算机与软件学院 2019年保研 上机 模拟练习 7-3 Is It An AVL Tree (25 分)

7-3 Is It An AVL Tree (25 分)In computer science, an AVL tree (Georgy Adelson-Velsky and Evgenii Landis’ tree, named after the inventors) is a self-balancing binary search tree. It was the first such ...

2019-10-15 21:55:59 536

原创 浙江大学 计算机与软件学院 2019年保研 上机 模拟练习 7-2 Zigzag Sequence(25分)

This time your job is to output a sequence of N positive integers in a zigzag format with width M in non-decreasing order. A zigzag format is to fill in the first row with M numbers from left to right...

2019-10-15 21:44:58 268

原创 浙江大学 计算机与软件学院 2019年保研 上机 模拟练习 7-1 Happy Numbers (20 分)

7-1 Happy Numbers (20 分)A happy number is defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of its digits in base-ten, and repeat the ...

2019-10-15 21:35:40 346

原创 浙江大学 计算机与软件学院 2019年保研 上机 模拟练习 7-4 Index of Popularity (30 分)

7-4 Index of Popularity (30 分)The index of popularity (IP) of someone in his/her circle of friends is defined to be the number of friends he/she has in that circle. Now you are supposed to list the m...

2019-10-15 21:24:55 406

原创 2019年9月 PAT 7-4 Dijkstra Sequence

考点:Dijistra算法的逻辑注意点:这一次考察的是Dijistra算法的逻辑,即从起点开始每次选出一个最短路径点(每步更新的d[v]后,可能有多个最小的点更新)与所给序列判断,如果符合则yes。而不是以往考察的求最短路径。切勿先入为主。仔细审查题意。#include <iostream>#include <vector>#include <set>...

2019-10-05 20:28:58 331

原创 2019年9月 PAT 7-3 Postfix Expression

考点:二叉树的建立,遍历DFS注意点:要考虑到只有一个孩子的时候是先序遍历,两个孩子是后序遍历,也就是读懂题很重要。with parentheses reflecting the precedences of the operators.(括号反应优先级)#include <iostream>using namespace std;const int maxn = 100;s...

2019-09-16 00:11:04 255

原创 2019年9月 PAT 7-2 Merging Linked Lists (25 分)

考点:链表+排序#include <iostream>#include <cmath>#include <vector>using namespace std;const int maxn = 100005;struct node{ int addr,v,next;}Node[maxn];int add1,add2,n,tempadd;in...

2019-09-11 23:54:14 727

原创 2019年9月 PAT 7-1 Forever (20 分)

“Forever number” is a positive integer A with K digits, satisfying the following constrains:the sum of all the digits of A is m;the sum of all the digits of A+1 is n; andthe greatest common divisor...

2019-09-10 23:40:51 337

原创 浙江大学2019年机试 7-4 Ambulance Dispatch (30 分)

考察:无向有权图的最短路径;解决办法:1、节点少情况:直接DFS从呼救点去遍历全图,终结点只进入还有救护车的医院,过程中更新最短路径,救护车数量,经过节点数。2、节点多情况:采用Dijkstra+DFS,用Dij记录每个医院到每个呼救点的最短路径,pre保存,然后用DFS遍历更新找到对应path.注意点:途中可以经过医院,节点数大于1000,用dij+DFS;办法一DFS:using n...

2019-09-07 14:26:18 2130 3

原创 浙江大学2019年机试 7-2 Play with Linked List (25 分)

考察:链表排序,或按指定顺序输出解决办法,先按顺序把有效节点存入rec数组,再按指定顺序,借用vector可依次push或insert,最后遍历即可注意点:可能存在无效节点#include <iostream>#include <cmath>#include <vector>using namespace std;const int maxn = ...

2019-09-07 14:12:51 560 1

原创 浙江大学2019年机试 7-1 Conway's Conjecture

考察字符串+素数判断+质因子分解解决办法:循环找到n的最小因子>=2,用map记录次数,最后遍历map组装string,判断是素数即可注意点:n可能大于int范围,用long long#include <iostream>#include <cmath>#include <map>using namespace std;bool isprim...

2019-09-07 14:09:10 473

原创 7-3 Unsuccessful Searches (25 分)

主要考察散列表平均查找失败长度,掌握概念也就不难了#include <iostream>#include <vector>using namespace std;int main() { int tsize,m,n,num; cin>>tsize>>m>>n; vector<int> rec(tsize,-1);...

2019-09-06 21:54:41 431

原创 PAT-A 201903-3 Telefraud Detection

考察:并查集+有向图的存储,节点少用邻接矩阵,且不用压缩路径解决办法:用邻接矩阵存储有向有权边,遍历每个顶点,统计出度个数及双向边个数,找出满足提议的嫌疑人,在用并查集(合并、找父节点)找出团伙。注意:父节点选择值较小的,不然通不过测试点#include <iostream>#include <vector>#include <set>using n...

2019-09-06 11:10:50 185

原创 PAT-A 1148 Werewolf - Simple Version (20 分)

PAT-A 1148 Werewolf - Simple Version (20 分)//狼人杀,考察逻辑.//解决办法:暴力固定变量(两个狼人),讨论在此变量下能否满足题意(说谎的人是谁?怎么去判断说谎:(他是狼你说不是你就说谎了))#include #include #include using namespace std;int n;int main(){cin>&g...

2019-09-06 10:55:29 127

西安交大2018年《计算机基础综合》考研真题.pdf

西安交通大学2018年《计算机基础综合》考研真题、西交考研真题及其他资料有需要可联系我,可免费哦。。其中包含计算机组成,操作系统,数据结构,复试相关等

2020-08-04

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除