自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(32)
  • 资源 (2)
  • 收藏
  • 关注

原创 PAT甲级1128 N Queens Puzzle (20分) 判重

Sample Input:48 4 6 8 2 7 1 3 59 4 6 7 2 8 1 9 5 36 1 5 2 6 4 35 1 3 5 2 4Sample Output:YESNONOYES就是皇后问题判重,判断行重复 对角线重复就好,我写代码时候写多了个判断列重复,题目已经很明确说了列不会重复。注意的点有题目给的位置标示好难受,从左下角数,我还是变成了左上角开始的数组然后关于对角重复判断,直接行标-列标就能得到一个 对角元素都一样的值,比如从主对角线的元素 行标...

2020-05-31 16:42:32 197

原创 PAT甲级1114 Family Property (25分) 题不难,麻烦点 ,并查集变形, map 我是左箭头 int,node 我是右箭头 mapp

Sample Input:106666 5551 5552 1 7777 1 1001234 5678 9012 1 0002 2 3008888 -1 -1 0 1 10002468 0001 0004 1 2222 1 5007777 6666 -1 0 2 3003721 -1 -1 1 2333 2 1509012 -1 -1 3 1236 1235 1234 1 1001235 5678 9012 0 1 502222 1236 2468 2 6661 6662 1 300.

2020-05-31 12:14:36 158

原创 PAT甲级1140 Look-and-say Sequence (20分) 模拟

1140 Look-and-say Sequence (20分)Look-and-say sequence is a sequence of integers as the following:D, D1, D111, D113, D11231, D112213111, …where D is in [0, 9] except 1. The (n+1)st number is a kind of description of the nth number. For example, the 2nd n

2020-05-30 17:46:45 126

原创 PAT甲级1125 Chain the Ropes (25分) 简单题,但是实现时候需要注意点

1125 Chain the Ropes (25分)Given some segments of rope, you are supposed to chain them into one rope. Each time you may only fold two segments into loops and chain them into one piece, as shown by the figure. The resulting chain will be treated as another

2020-05-30 17:04:46 172

原创 PAT甲级1116 Come on! Lets C (20分) prime素数

1116 Come on! Let’s C (20分)“Let’s C” is a popular and fun programming contest hosted by the College of Computer Science and Technology, Zhejiang University. Since the idea of the contest is for fun, the award rules are funny as the following:0、 The Champ

2020-05-30 16:58:54 189

原创 PAT甲级1104 Sum of Number Segments (20分) 测试点2感觉不太对,两位数字不同加法有区别

1104 Sum of Number Segments (20分)Given a sequence of positive numbers, a segment is defined to be a consecutive subsequence. For example, given the sequence { 0.1, 0.2, 0.3, 0.4 }, we have 10 segments: (0.1) (0.1, 0.2) (0.1, 0.2, 0.3) (0.1, 0.2, 0.3, 0.4)

2020-05-30 11:50:24 979

原创 PAT甲级1138 Postorder Traversal (25分) 前序 中序 转换后序

1138 Postorder Traversal (25分)Suppose that all the keys in a binary tree are distinct positive integers. Given the preorder and inorder traversal sequences, you are supposed to output the first number of the postorder traversal sequence of the correspondi

2020-05-30 10:09:21 138

原创 PAT甲级1146 Topological Order (25分) 拓扑排序

1146 Topological Order (25分)This is a problem given in the Graduate Entrance Exam in 2018: Which of the following is NOT a topological order obtained from the given directed graph? Now you are supposed to write a program to test each of the options.Inpu

2020-05-29 21:45:26 147

原创 PAT甲级1107 Social Clusters (30分) 以及 牛客-并查集的实现 ,以及速度改进

链接:https://www.nowcoder.com/questionTerminal/e7ed657974934a30b2010046536a5372来源:牛客网给定一个没有重复值的整形数组arr,初始时认为arr中每一个数各自都是一个单独的集合。请设计一种叫UnionFind的结构,并提供以下两个操作。boolean isSameSet(int a, int b): 查询a和b这两个数是否属于一个集合void union(int a, int b): 把a所在的集合与b所在的集合合并在一起,原

2020-05-29 17:18:12 148

原创 PAT甲级1106 Lowest Price in Supply Chain (25分) 虽然是简单题,但是还是再捋下思路吧

1106 Lowest Price in Supply Chain (25分)A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Starting from one root supplier, everyone on the chain buys prod

2020-05-29 06:56:18 135

原创 PAT甲级1154 Vertex Coloring (25分) 简单题读懂题目就好

1154 Vertex Coloring (25分)A proper vertex coloring is a labeling of the graph’s vertices with colors such that no two vertices sharing the same edge have the same color. A coloring using at most k colors is called a (proper) k-coloring.Now you are suppos

2020-05-29 05:58:08 166

原创 数据库MySql python读取插入数据,insert对那些类型加单引号,表单自己参考自己(外键),空值和NULL

今天做了下数据库作业,好多出错,记录下,查漏补缺本次只是实现一个employee表单,特殊在有一个外键参考自身主键,并且老师给的数据该外键可为null表结构直接用workbench 里面构造的,Navicat还没解决不修改密码策略的条件下连接mysql8.外键约束然后根据给的数据,插入数据先尝试直接在WORKbench里面用SQL语句插入insert into employee (Fname,Minit,Lname,Ssn,Bdate,Address,Sex,Salary,Super_s

2020-05-28 19:22:14 887

原创 PAT甲级1127 ZigZagging on a Tree (30分) 中序 后序构造二叉树,之前就写错过,这次又写错了。。。。*******

1127 ZigZagging on a Tree (30分)Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can be determined by a given pair of postorder and inorder traversal sequences. And it is a simple standard routine to print the

2020-05-27 18:12:51 106

原创 PAT甲级1115 Counting Nodes in a BST (30分) 结构体 二叉树 构造二叉搜索树,层序遍历,输出每层节点个数

1115 Counting Nodes in a BST (30分)A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes with keys less than or equal to the node’s key.The right subtree of a

2020-05-27 11:21:58 143

原创 PAT甲级1155 Heap Paths (30分) 深搜

1155 Heap Paths (30分)In computer science, a heap is a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then the key (the value) of P is either greater than or equal to (in a max heap) or less than or equa

2020-05-27 10:02:53 78

原创 PAT甲级1079 Total Sales of Supply Chain (25分) 层序遍历

1079 Total Sales of Supply Chain (25分)A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Starting from one root supplier, everyone on the chain buys produ

2020-05-26 22:57:13 133

原创 PAT甲级1053 Path of Equal Weight (30分)

1053 Path of Equal Weight (30分)Given a non-empty tree with root R, and with weight W​i​​ assigned to each tree node T​i​​ . The weight of a path from R to L is defined to be the sum of the weights of all the nodes along the path from R to any leaf no

2020-05-26 09:23:55 125

原创 PAT甲级1050 String Subtraction (20分) 简单题

Subtraction (20分)Given two strings S​1​​ and S​2​​ , S=S​1​​ −S​2​​ is defined to be the remaining string after taking all the characters in S​2​​ from S​1​​ . Your task is simply to calculate S​1​​ −S​2​​ for any given strings. Howeve

2020-05-25 23:18:09 113

原创 PAT甲级1051 Pop Sequence (25分) 判断数列是否能用栈输出,蛮有意思,东大初试好像就有这题

1051 Pop Sequence (25分)Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, …, N and pop randomly. You are supposed to tell if a given sequence of numbers is a possible pop sequence of the stack. For example, if M is 5 a

2020-05-25 23:07:09 234

原创 PAT甲级1094 The Largest Generation (25分) 层序遍历 vector嵌套来保存边

1094 The Largest Generation (25分)A family hierarchy is usually presented by a pedigree tree where all the nodes on the same level belong to the same generation. Your task is to find the generation with the largest population.Input Specification:Each inp

2020-05-25 10:17:38 66

原创 PAT甲级1089 Insert or Merge (25分) PAT测试点2 5 6,归并排序,想了一天。。。。。

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 element from the input data, finds the location it belongs

2020-05-25 07:48:06 635 1

原创 PAT甲级1098 Insertion or Heap Sort (25分) 堆排序 swap交换数组元素

1098 Insertion or Heap Sort (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 element from the input data, finds the location it

2020-05-24 09:33:52 83

原创 PAT甲级1058 A+B in Hogwarts (20分) 自己实现加法的好的思路,别使用进位变量了,麻烦的很

1058 A+B in Hogwarts (20分)If you are a fan of Harry Potter, you would know the world of magic has its own currency system – as Hagrid explained it to Harry, “Seventeen silver Sickles to a Galleon and twenty-nine Knuts to a Sickle, it’s easy enough.” Your

2020-05-21 10:52:40 115

原创 PAT甲级1090 Highest Price in Supply Chain (25分) 双vector来记录图 队列实现广搜

1090 Highest Price in Supply Chain (25分)A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Starting from one root supplier, everyone on the chain buys pro

2020-05-21 10:22:13 113

原创 PAT甲级Invert a Binary Tree 柳神层序遍历的思路值得借鉴

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 fuck off.Now it’s your turn to prove that YOU CAN invert a

2020-05-20 18:15:20 169

转载 PAT考纲 甲级:并查集、最短路径、拓扑排序、关键路径、贪心、回溯剪枝,顶级:后缀数组、树状数组、线段树、Treap、静态KDTree、最大流/最小割,强连通分支、最近公共祖先、最小生成树、欧拉序列

考试方式由浙江大学计算机科学与技术学院考试中心负责考试的组织、日常管理和具体实施工作。每年分春、秋、冬季组织3次统一考试,考试时间根据场地可用的具体时间而定,大约分别在2-3月、8-9月、11-12月举行。每场考试分两个不同的难度级别:甲级(Advanced Level)、乙级(Basic Level)。两级别的考试在同一考场、同时举行。考生须提前30分钟进入场地,领取考试帐号并测试帐号可用性。正式考试为3小时、闭卷、上机编程测试。考生只可携带铅笔或水笔进入考场。考试成绩实时可查,证书立等可取。

2020-05-15 09:50:31 277 1

原创 PAT甲级1061 Dating (20分) 简单 PAT有两个测试点略坑

1061 Dating (20分)Sherlock Holmes received a note with some strange strings: Let’s date! 3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm. It took him only a minute to figure out that those strange strings are actually referring to the coded t

2020-05-12 20:54:28 775 1

原创 PAT甲级1065 A+B and C (64bit) (20分) string大数加法 、大数比较的其他办法、long double 和double 的详解有效位数 ****

1065 A+B and C (64bit) (20分)Given three integers A, B and C in [−2​63​​,2​63​​], you are supposed to tell whether A+B>C.Input Specification:The first line of the input gives the positive number of test cases, T (≤10). Then T test cases follow, each c

2020-05-09 21:30:30 796

原创 PAT甲级1093 Count PAT's (25分) 主要是计数的思路

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 th...

2020-05-06 19:50:47 102

原创 PAT甲级1100 Mars Numbers (20分) string转int getline整行读取

1100 Mars Numbers (20分)People on Mars count their numbers with base 13:Zero on Earth is called "tret" on Mars.The numbers 1 to 12 on Earth is called "jan, feb, mar, apr, may, jun, jly, aug, sep, oc...

2020-05-06 17:11:51 131

原创 PAT甲级1097 Deduplication on a Linked List (25分) 解析测试点1 和测试点 2 , list 表示链表 删除元素 逆遍历

1097 Deduplication on a Linked List (25分)Given a singly linked list L with integer keys, you are supposed to remove the nodes with duplicated absolute values of the keys. That is, for each value K, o...

2020-05-05 21:43:29 957 1

原创 PAT甲级 1099 Build A Binary Search Tree (30分) 节点表示二叉树 层序遍历 中序遍历 柳神精简代码

1099 Build A Binary Search Tree (30分)A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes with keys le...

2020-05-04 23:57:58 236

java8_32.zip

JAVA8_32版,解压完配置下环境就好

2020-08-07

数字电子技术第二版 侯建军 完整版

数字电子技术第二版 侯建军 完整版 不是课后答案网那个残缺

2015-11-09

空空如也

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

TA关注的人

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