原创 PAT 1078. Hashing (25)

1078. Hashing (25) 時間限制 100 ms 內存限制 32000 kB 代碼長度限制 16000 B 判題程序 Standard 作者 CHEN, Yue The task of thi

原创 題目1554:區間問題

題目描述: 給定一個數組,判斷數組內是否存在一個連續區間,使其和恰好等於給定整數k。 輸入: 輸入包含多組測試用例,每組測試用例由一個整數n(1<=n<=10000)開頭,代表數組的大小。 接下去一行爲n個整數,描述這個數組,整數絕對

原创 題目1545:奇怪的連通圖

題目1545:奇怪的連通圖 時間限制:1 秒 內存限制:128 兆 特殊判題:否 提交:316 解決:89 題目描述: 已知一個無向帶權圖,求最小整數k。使僅使用權值小於等於k的邊,節點1可以與節點n連通。 輸入: 輸入包含

原创 題目1541:二叉樹

題目1541:二叉樹 時間限制:1 秒 內存限制:128 兆 特殊判題:否 提交:275 解決:47 題目描述: 旋轉是二叉樹的基本操作,我們可以對任意一個存在父親節點的子節點進行旋轉,包括如下幾種形式(設被旋轉節點爲x,其父

原创 PAT 1079. Total Sales of Supply Chain (25)

1079. Total Sales of Supply Chain (25) 時間限制 250 ms 內存限制 32000 kB 代碼長度限制 16000 B 判題程序 Standard 作者 CHEN, Y

原创 PAT 1080. Graduate Admission (30)

1080. Graduate Admission (30) 時間限制 200 ms 內存限制 32000 kB 代碼長度限制 16000 B 判題程序 Standard 作者 CHEN, Yue It i

原创 題目1540:麥霸

題目1540:麥霸 時間限制:1 秒 內存限制:128 兆 特殊判題:否 提交:75 解決:19 題目描述: GrassLand酷愛K歌,俗稱麥霸,每次去KTV他都會爲自己點許多歌曲。 給定點唱機的操作序列,GrassLand

原创 PAT 1085. Perfect Sequence (25)

1085. Perfect Sequence (25) 時間限制 300 ms 內存限制 32000 kB 代碼長度限制 16000 B 判題程序 Standard 作者 CAO, Peng Given

原创 PAT 1099. Build A Binary Search Tree

A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtre

原创 PAT 1089. Insert or Merge

According to Wikipedia: Insertion sort iterates, consuming one input element each repetition, and growing a sorted out

原创 PAT 1082. Read Number in Chinese (25)

Given an integer with no more than 9 digits, you are supposed to read it in the traditional Chinese way. Output "Fu" f

原创 PAT 1081. Rational Sum (20)

Given N rational numbers in the form "numerator/denominator", you are supposed to calculate their sum. Input Specifica

原创 PAT 1092. To Buy or Not to Buy

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

原创 PAT 1096. Consecutive Factors

Among all the factors of a positive integer N, there may exist several consecutive numbers. For example, 630 can be fa

原创 PAT 1088. Rational Arithmetic

For two rational numbers, your task is to implement the basic arithmetics, that is, to calculate their sum, difference