05 2020 档案
摘要:Eva would like to make a string of beads with her favorite colors so she went to a small shop to buy some beads. There were many colorful strings of b
阅读全文
摘要: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
阅读全文
摘要: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 t
阅读全文
摘要:Zhejiang University has 8 campuses and a lot of gates. From each gate we can collect the in/out times and the plate numbers of the cars crossing the g
阅读全文
摘要:Among all the factors of a positive integer N, there may exist several consecutive numbers. For example, 630 can be factored as 3×5×6×7, where 5, 6, a
阅读全文
摘要: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 va
阅读全文
摘要:According to Wikipedia: Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insert
阅读全文
摘要: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
阅读全文
摘要: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, m
阅读全文
摘要:There is a classical process named partition in the famous quick sort algorithm. In this process we typically choose one element as the pivot. Then th
阅读全文
摘要: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
阅读全文
摘要:The K−P factorization of a positive integer N is to write N as the sum of the P-th power of K positive integers. You are supposed to write a program t
阅读全文
摘要:opencv安装,之后可以装载自己的模型进行视频预测 pip install opencv-python cv预测转视频脚本 # from keras.layers import Input from frcnn import FRCNN from PIL import Image import n
阅读全文
摘要:linux配置新的IP在/etc/sysconfig/network-scripts/ifcfg-eth0 此后需要删除/etc/udev/rules.d/70-persistent-rule文件 再service network restart即可
阅读全文
摘要: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
阅读全文
摘要:This time your job is to fill a sequence of N positive integers into a spiral matrix in non-increasing order. A spiral matrix is filled in from the fi
阅读全文
摘要:A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer
阅读全文
摘要:When register on a social network, you are always asked to specify your hobbies in order to find some potential friends with the same hobbies. A socia
阅读全文
摘要:The basic task is simple: given N real numbers, you are supposed to calculate their average. But what makes it complicated is that some of the input n
阅读全文
摘要:Formation is very important when taking a group photo. Given the rules of forming K rows with N people as the following: The number of people in each
阅读全文
摘要:Given a tree, you are supposed to tell if it is a complete binary tree. Input Specification: Each input file contains one test case. For each case, th
阅读全文
摘要:Input our current position and a destination, an online map can recommend several paths. Now your job is to recommend two paths to your user: one is t
阅读全文
摘要:神经网络(一) 1.机器基本介绍 机器学习简介 是什么? 无序数据转化为价值的方法 价值? 数据中抽取规律,进行预测未来 机器学习应用 分类问题? 图像识别、垃圾邮件 回归问题? 股价预测、房价预测 排序问题? 点击率预估、推荐 生成问题? 图像生成、图像风格转换、图像文字描述生成 2.深度学习简介
阅读全文
摘要:On a broken keyboard, some of the keys are always stucked. So when you type some sentences, the characters corresponding to those keys will appear rep
阅读全文
摘要:Given a set of N (>) positive integers, you are supposed to partition them into two disjoint sets A1 and A2 of n1 and n2 numbers, respecti
阅读全文
摘要:This time, you are supposed to help us collect the data for family-owned property. Given each person's family members, and the estate(房产)info under hi
阅读全文
摘要: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
阅读全文
摘要:"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 th
阅读全文
摘要:British astronomer Eddington liked to ride a bike. It is said that in order to show off his skill, he has even defined an "Eddington number", E -- tha
阅读全文
摘要:Some scientists took pictures of thousands of birds in a forest. Assume that all the birds appear in the same picture belong to the same tree. You are
阅读全文
摘要: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 ino
阅读全文
摘要:Two integers are called "friend numbers" if they share the same sum of their digits, and the sum is their "friend ID". For example, 123 and 51 are fri
阅读全文
摘要:"Damn Single (单身狗)" is the Chinese nickname for someone who is being single. You are supposed to find those who are alone in a big party, so they can
阅读全文
摘要:The "Hamilton cycle problem" is to find a simple cycle that contains every vertex in a graph. Such a cycle is called a "Hamiltonian cycle". In this pr
阅读全文
摘要:An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any
阅读全文
摘要:John got a full mark on PAT. He was so happy that he decided to hold a raffle(抽奖) for his followers on Weibo -- that is, he would select winners from
阅读全文
摘要: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
阅读全文
摘要:In graph theory, an Eulerian path is a path in a graph which visits every edge exactly once. Similarly, an Eulerian circuit is an Eulerian path which
阅读全文
摘要: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 ino
阅读全文
摘要:The "eight queens puzzle" is the problem of placing eight chess queens on an 8 chessboard so that no two queens threaten each other. Thus, a solution
阅读全文
摘要:Recommendation system predicts the preference that a user would give to an item. Now you are asked to program a very simple recommendation system that
阅读全文
摘要:Given a syntax tree (binary), you are supposed to output the corresponding infix expression, with parentheses reflecting the precedences of the operat
阅读全文
摘要:In the big cities, the subway systems always look so complex to the visitors. To give you some sense, the following figure shows the map of Beijing su
阅读全文
摘要:Cutting an integer means to cut a K digits lone integer Z into two integers of (K/2) digits long integers A and B. For example, after cutting Z = 1673
阅读全文
摘要:Given a singly linked list, you are supposed to rearrange its elements so that all the negative values appear before all of the non-negatives, and all
阅读全文
摘要:A vertex cover of a graph is a set of vertices such that each edge of the graph is incident to at least one vertex of the set. Now given a graph with
阅读全文
摘要:There is a kind of balanced binary search tree named red-black tree in the data structure. It has the following 5 properties: (1) Every node is either
阅读全文
摘要:pip install numpy==1.16.0 conda create -n tf-gpu python=3.6 activate tf-gpu pip install tensorflow-gpu==1.13.2 pip install keras==2.1.5
阅读全文
摘要:Consider a positive integer N written in standard notation with k+1 digits ai as ak⋯a1a0 with 0 for all i and ak>0. Then N is palindrom
阅读全文
摘要:For a student taking the online course "Data Structures" on China University MOOC (http://www.icourse163.org/), to be qualified for a certificate, he/
阅读全文
摘要:Suppose that all the keys in a binary tree are distinct positive integers. Given the preorder and inorder traversal sequences, you are supposed to out
阅读全文
摘要:iven a hash table of size N, we can define a hash function (. Suppose that the linear probing is used to solve collisions, we can easily obtain the st
阅读全文
摘要:Unlike in nowadays, the way that boys and girls expressing their feelings of love was quite subtle in the early years. When a boy A had a crush on a g
阅读全文
摘要:有时候发现, MacOS中, 有个叫做mds_stores的进程占了好多CPU, 于是要阻止这个行为, 据说这是Spotlight在建索引然后只要把这个索引的关掉就好了 sudo mdutil -a -i off 打开也很简单: sudo mdutil -a -i on
阅读全文
摘要: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)s
阅读全文
摘要:After each PAT, the PAT Center will announce the ranking of institutions based on their students' performances. Now you are asked to generate the rank
阅读全文
摘要:A clique is a subset of vertices of an undirected graph such that every two distinct vertices in the clique are adjacent. A maximal clique is a clique
阅读全文
摘要:The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants. A binary search tree (BST) i
阅读全文
摘要:Given N integers, you are supposed to find the smallest positive integer that is NOT in the given list. Input Specification: Each input file contains
阅读全文
摘要:The task of this problem is simple: insert a sequence of distinct positive integers into a hash table first. Then try to find another sequence of inte
阅读全文
摘要: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 grap
阅读全文
摘要: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
阅读全文
摘要:Werewolf(狼人杀) is a game in which the players are partitioned into two parties: the werewolves and the human beings. Suppose that in a game, player #1
阅读全文
摘要:When shipping goods with containers, we have to be careful not to pack some incompatible goods into the same container, or we might get ourselves in s
阅读全文
摘要:The "travelling salesman problem" asks the following question: "Given a list of cities and the distances between each pair of cities, what is the shor
阅读全文
摘要:The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants. Given any two nodes in a bin
阅读全文
摘要:In July 2004, Google posted on a giant billboard along Highway 101 in Silicon Valley (shown in the picture below) for recruitment. The content is supe
阅读全文
摘要:A registration card number of PAT consists of 4 parts: the 1st letter represents the test level, namely, T for the top level, A for advance and B for
阅读全文
摘要: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 colo
阅读全文
摘要: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
阅读全文
摘要:7-1 Knuth洗牌法 (20分) Knuth 洗牌法是生成 { 1, 2, ..., n } 的一个随机重排列的算法。与每次反复随机生成一个数字,直到获得一个不重复的新数字的算法不同,Knuth 洗牌法从原始序列 { 1, 2, ..., n } 开始,逐次洗牌。洗牌的方法是从左到右,每轮从没确
阅读全文