原创 PAT甲級A1138 Postorder Traversal (25 分)

Suppose that all the keys in a binary tree are distinct positive integers. Given the preorder and inorder traversal seq

原创 mysql入門避坑指南--導入導出.csv文件常見問題

    一:                                       在導入數據出現這個錯誤一般是因爲地址裏面的斜槓使用錯誤。比如下面 load data local infile 'D:\road.txt'int

原创 2019年復旦計算機專碩考研經驗總結

  寫在前面:本科湖南某雙非渣學校,歷經三次考研,第一年考的南京某211學校學碩,第二年考的復旦計專,初試排107名,無奈複試被刷,第三年387分,初試排名37,複試也穩定發揮,2019年終於上岸,各單科成績如下,政治69,英語二77,數

原创 PAT甲級A1139 First Contact (30 分)

Unlike in nowadays, the way that boys and girls expressing their feelings of love was quite subtle in the early years.

原创 PAT乙級B1094 谷歌的招聘 (20 分)

1094 谷歌的招聘 (20 分) 2004 年 7 月,谷歌在硅谷的 101 號公路邊豎立了一塊巨大的廣告牌(如下圖)用於招聘。內容超級簡單,就是一個以 .com 結尾的網址,而前面的網址是一個 10 位素數,這個素數是自然常數 e 中

原创 PAT乙級B1095 解碼PAT准考證 (25 分)

PAT 准考證號由 4 部分組成: 第 1 位是級別,即 T 代表頂級;A 代表甲級;B 代表乙級; 第 2~4 位是考場編號,範圍從 101 到 999; 第 5~10 位是考試日期,格式爲年、月、日順次各佔 2 位; 最後 11~13

原创 PAT乙級B1093 字符串A+B (20 分)

給定兩個字符串 A 和 B,本題要求你輸出 A+B,即兩個字符串的並集。要求先輸出 A,再輸出 B,但重複的字符必須被剔除。 輸入格式: 輸入在兩行中分別給出 A 和 B,均爲長度不超過 10​6​​的、由可見 ASCII 字符 (即碼值

原创 PAT甲級A1155 Heap Paths (30 分)

In computer science, a heap is a specialized tree-based data structure that satisfies the heap property: if P is a pare

原创 PAT乙級B1092 最好吃的月餅 (20 分)

月餅是久負盛名的中國傳統糕點之一,自唐朝以來,已經發展出幾百品種。 若想評比出一種“最好吃”的月餅,那勢必在吃貨界引發一場腥風血雨…… 在這裏我們用數字說話,給出全國各地各種月餅的銷量,要求你從中找出銷量冠軍,認定爲最好吃的月餅。 輸入

原创 PAT甲級A1154 Vertex Coloring (25 分)

A proper vertex coloring is a labeling of the graph's vertices with colors such that no two vertices sharing the same e

原创 PAT乙級B1091 N-自守數 (15 分)

如果某個數 K 的平方乘以 N 以後,結果的末尾幾位數等於 K,那麼就稱這個數爲“N-自守數”。例如 3×92​2​​=25392,而 25392 的末尾兩位正好是 92,所以 92 是一個 3-自守數。 本題就請你編寫程序判斷一個給定的

原创 PAT甲級A1152 Google Recruitment (20 分)

In July 2004, Google posted on a giant billboard along Highway 101 in Silicon Valley (shown in the picture below) for r

原创 PAT甲級A1153 Decode Registration Card of PAT (25 分)

A registration card number of PAT consists of 4 parts: the 1st letter represents the test level, namely, T for the top

原创 PAT甲級A1143 Lowest Common Ancestor (30 分)

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 descendant

原创 PAT乙級B1090 危險品裝箱 (25 分)

集裝箱運輸貨物時,我們必須特別小心,不能把不相容的貨物裝在一隻箱子裏。比如氧化劑絕對不能跟易燃液體同箱,否則很容易造成爆炸。 本題給定一張不相容物品的清單,需要你檢查每一張集裝箱貨品清單,判斷它們是否能裝在同一只箱子裏。 輸入格式: 輸入