-
Pat 甲级 训练真题集 1069!
1069. The Black Hole of Numbers (20) 时间限制 100 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueFor any 4-digit integer except the ones with all the digits being the same, if we sort the digi...…
-
Pat 甲级 训练真题集 1067!
1067. Sort with Swap(0,*) (25) 时间限制 150 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueGiven any permutation of the numbers {0, 1, 2,…, N-1}, it is easy to sort them in increasing order. ...…
-
Pat 甲级 训练真题集 1066!
1066. Root of AVL Tree (25) 时间限制 100 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueAn AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtre...…
-
Pat 甲级 训练真题集 1065!
1065. A+B and C (64bit) (20) 时间限制 100 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 HOU, QimingGiven three integers A, B and C in [-263, 263], you are supposed to tell whether A+B > C.Input Spe...…
-
Pat 甲级 训练真题集 1064!
1064. Complete Binary Search Tree (30) 时间限制 100 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueA Binary Search Tree (BST) is recursively defined as a binary tree which has the following pr...…
-
Pat 甲级 训练真题集 1123!
1123. Is It a Complete AVL Tree (30) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueAn AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two chi...…
-
Pat 甲级 训练真题集 1099!
1099. Build A Binary Search Tree (30) 时间限制 100 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueA Binary Search Tree (BST) is recursively defined as a binary tree which has the following pro...…
-
Pat 甲级 训练真题集 1098!
1098. Insertion or Heap Sort (25) 时间限制 100 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueAccording to Wikipedia:Insertion sort iterates, consuming one input element each repetition, and g...…
-
Pat 甲级 训练真题集 1097!
1097. Deduplication on a Linked List (25) 时间限制 300 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueGiven a singly linked list L with integer keys, you are supposed to remove the nodes with ...…
-
Pat 甲级 训练真题集 1096!
1096. Consecutive Factors (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueAmong all the factors of a positive integer N, there may exist several consecutive numbers. For exam...…
-
Pat 甲级 训练真题集 1094!
1094. The Largest Generation (25) 时间限制 200 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueA family hierarchy is usually presented by a pedigree tree where all the nodes on the same level b...…
-
Pat 甲级 训练真题集 1093!
1093. Count PAT’s (25) 时间限制 120 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CAO, PengThe string APPAPT contains two PAT’s as substrings. The first one is formed by the 2nd, the 4th, and the 6th...…
-
Pat 甲级 训练真题集 1092!
1092. To Buy or Not to Buy (20) 时间限制 100 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueEva would like to make a string of beads with her favorite colors so she went to a small shop to buy...…
-
Pat 甲级 训练真题集 1086!
1086. Tree Traversals Again (25) 时间限制 200 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueAn inorder binary tree traversal can be implemented in a non-recursive way with a stack. For examp...…
-
Pat 甲级 训练真题集 1084!
1084. Broken Keyboard (20) 时间限制 200 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueOn a broken keyboard, some of the keys are worn out. So when you type some sentences, the characters cor...…
-
Pat 甲级 训练真题集 1059!
1059. Prime Factors (25) 时间限制 100 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 HE, QinmingGiven any positive integer N, you are supposed to find all of its prime factors, and write them in the fo...…
-
Pat 甲级 训练真题集 1113!
1113. Integer Set Partition (25) 时间限制 150 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Given a set of N (> 1) positive integers, you are supposed to partition them into tw...…
-
Pat 甲级 训练真题集 1058!
1058. A+B in Hogwarts (20) 时间限制 50 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueIf you are a fan of Harry Potter, you would know the world of magic has its own currency system – as Hagri...…
-
Pat 甲级 训练真题集 1054!
1054. The Dominant Color (20) 时间限制 100 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueBehind the scenes in the computer’s memory, color is always talked about as a series of 24 bits of inf...…
-
Pat 甲级 训练真题集 1053!
1053. Path of Equal Weight (30) 时间限制 100 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueGiven a non-empty tree with root R, and with weight Wi assigned to each tree node Ti. The weight of...…