原创 PAT-A-1024 Palindromic Number 【大數相加】

A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example,

原创 PAT-A-1088 Rational Arithmetic 【最小公倍數】 【最大公約數】

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

原创 中國科學技術大學 先進技術研究院

第一屆(2020年)創新應用(先研院) 夏令營報名通知 爲了增進學生對“人工智能”、“微電子”、“生物醫藥”、“新材料與新能源”等前沿科技應用領域的瞭解,踐行“產學研用”相結合的高端應用型人才培養,2020年,先進技術研究院將舉辦首屆創新

原创 PAT-A-1093 Count PATs 【複習】

The string APPAPT contains two PAT's as substrings. The first one is formed by the 2nd, the 4th, and the 6th characters

原创 PAT-A-1094 The Largest Generation 【樹】

A family hierarchy is usually presented by a pedigree tree where all the nodes on the same level belong to the same gen

原创 PAT-A- 1037 Magic Coupon 【貪心算法】

The magic shop in Mars is offering some magic coupons. Each coupon has an integer N printed on it, meaning that when yo

原创 PAT-A- 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-A-1090 Highest Price in Supply Chain【樹】

A supply chain is a network of retailers(零售商), distributors(經銷商), and suppliers(供應商)-- everyone involved in moving a pr

原创 PAT-A1055 The Worlds Richest【排序】

Forbes magazine publishes every year its list of billionaires based on the annual ranking of the world's wealthiest peo

原创 PAT-A-1042 Shuffling Machine

菩提本無樹,明鏡亦非臺.本來無一物,何處惹塵埃  Shuffling is a procedure used to randomize a deck of playing cards. Because standard shuffling

原创 PAT-A-1046 Shortest Distance 【前綴和】

The task is really simple: given N exits on a highway which forms a simple cycle, you are supposed to tell the shortest

原创 PAT-A-1031 Hello World for U 【簡單模擬】

Given any string of N (≥5) characters, you are asked to form the characters into the shape of U. For example, helloworl

原创 PAT-A- 1067 Sort with Swap(0, i)

Given any permutation of the numbers {0, 1, 2,..., N−1}, it is easy to sort them in increasing order. But what if Swap(

原创 PAT-A-1071 Speech Patterns 【散列】

People often have a preference among synonyms of the same word. For example, some may prefer "the police", while others