Coldfresh的博客

keeeeeep!~

(pat)A1127. ZigZagging on a Tree

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

2018-03-14 12:03:08

阅读数:42

评论数:0

(pat)A1119. Pre- and Post-order Traversals

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

2018-03-14 09:56:47

阅读数:49

评论数:0

(pat)A1115. Counting Nodes in a BST

Counting Nodes in a BST (30) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue A Binary Search Tree (BST) is recursively...

2018-03-13 18:30:17

阅读数:55

评论数:0

(pat)A1107. Social Clusters

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 “soc...

2018-03-13 17:50:18

阅读数:64

评论数:0

(pat)A1103. Integer Factorization

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

2018-03-13 16:50:09

阅读数:29

评论数:0

(pat)A1068. Find More Coins

Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which co...

2018-03-12 20:48:58

阅读数:32

评论数:0

(pat)A1064. Complete Binary Search Tree

A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: 1.The left subtree of a node contains only no...

2018-03-12 19:12:49

阅读数:65

评论数:0

(pat)A1014. Waiting in Line

Suppose a bank has N windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. The rule...

2018-03-10 16:25:26

阅读数:44

评论数:0

(pat)A1004. Counting Leaves

A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child. Input Each input file cont...

2018-03-10 14:11:36

阅读数:41

评论数:0

(pat)A1087. All Roads Lead to Rome

Indeed there are many different tourist routes from our city to Rome. You are supposed to find your clients the route with the least cost while gaini...

2018-03-10 13:37:26

阅读数:73

评论数:0

(pat)A1013. Battle Over Cities

It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that ...

2018-03-09 11:57:27

阅读数:53

评论数:0

(pat)A1059. Prime Factors

Given any positive integer N, you are supposed to find all of its prime factors, and write them in the format N = p1^k1 * p2^k2 *…*pm^km. Input Spec...

2018-03-09 11:40:37

阅读数:35

评论数:0

(pat)A1099. Build A Binary Search Tree

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

2018-03-09 10:08:37

阅读数:37

评论数:0

(pat)A1138. Postorder Traversal

Suppose that all the keys in a binary tree are distinct positive integers. Given the preorder and inorder traversal sequences, you are supposed to ou...

2018-03-09 09:39:58

阅读数:55

评论数:0

(pat)A1086. Tree Traversals Again

An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with th...

2018-03-08 23:03:39

阅读数:45

评论数:0

(pat)A1030. Travel Plan

A traveler’s map gives the distances between cities along the highways, together with the cost of each highway. Now you are supposed to write a progr...

2018-03-07 18:29:07

阅读数:42

评论数:0

(pat)A1003. Emergency

As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some r...

2018-03-07 14:20:40

阅读数:35

评论数:0

(pat)A1076 Forwards on Weibo

Weibo is known as the Chinese version of Twitter. One user on Weibo may have many followers, and may follow many other users as well. Hence a social ...

2018-03-07 11:46:18

阅读数:30

评论数:0

(pat)A1034. Head of a Gang

One way that the police finds the head of a gang is to check people’s phone calls. If there is a phone call between A and B, we say that A and B is r...

2018-03-07 10:30:28

阅读数:36

评论数:0

(pat)A1043. Is It a Binary Search Tree

A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: 1.The left subtree of a node contains only no...

2018-03-06 17:54:10

阅读数:23

评论数:0

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