原创 Python實現Pat 1004. Counting Leaves (30)

題目 A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have n

原创 Python實現PAT 1063. Set Similarity (25)

1063. Set Similarity (25) Given two sets of integers, the similarity of the sets is defined to be Nc/Nt*100%, where

原创 python實現pat 1033. To Fill or Not to Fill (25)

題目傳送門 """ 整理後的算法 #1.將加油站按距離排序 #2.在覆蓋範圍內,按優先級尋找下一個站點:比該站點價格小的最近站點;終點(或者記終點價格爲0)和前者合併;比該站點價格大但範圍內最小的站點 #3.尋找不到下一站點,則輸

原创 Python實現Pat 1023. Have Fun with Numbers (20)

題目 Notice that the number 123456789 is a 9-digit number consisting exactly the numbers from 1 to 9, with no duplica

原创 Python實現Pat 1078. Hashing (25)

Pat 1078. Hashing (25) The task of this problem is simple: insert a sequence of distinct positive integers into a h

原创 python實現pat 1054. The Dominant Color (20)

1054. The Dominant Color (20) 題目 Behind the scenes in the computer’s memory, color is always talked about as a seri

原创 Python實現Pat 1065. A+B and C (64bit) (20)

題目描述 Given three integers A, B and C in [-263, 263), you are supposed to tell whether A+B > C. 輸入描述: The first lin

原创 詳解_數據校驗(奇偶校驗、CRC校驗、海明校驗)

文章目錄一、基本概念1.碼距的概念:2.校驗編碼3.碼距和校驗的關係二、奇偶校驗1.基本原理2.雙向奇偶校驗三.CRC校驗1.模2除運算規則2.基本原理3.編碼方法4.檢錯方法5.糾錯方法四、海明校驗1.基本原理2.確定校驗碼位置

原创 併發與並行、異步與同步、阻塞與非阻塞等概念理解

文章目錄1.併發與並行解釋1:解釋2:總結2.同步與異步解釋1解釋2解釋3總結3. 阻塞與非阻塞系統調用場景進程通信場景總結 1.併發與並行 解釋1: 並行(parallellism):指在同一時刻,有多條指令在多個處理器上同

原创 Python 實現 PAT:A+B in Hogwarts (20)

A+B in Hogwarts (20) 這題比較簡單,P #PYTHON 3.5 AB=input().split(' ') A= [int(x) for x in AB[0].split('.')] B= [int(x) fo

原创 python實現pat 1071. Speech Patterns (25)

題目描述 People often have a preference among synonyms of the same word. For example, some may prefer “the police”, whi

原创 Python實現Pat 1013. Battle Over Cities (25)

題目 It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enem

原创 Python實現Pat 1088. Rational Arithmetic (20)

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

原创 Python實現Pat 1085. Perfect Sequence (25)

題目 Given a sequence of positive integers and another positive integer p. The sequence is said to be a “perfect sequ

原创 Python 實現1007. Maximum Subsequence Sum (25)

1007. Maximum Subsequence Sum (25) Given a sequence of K integers { N1, N2, …, NK }. A continuous subsequence is de