原创 PAT B1045/A1101 題解---超時以及格式錯誤的解決

1101 Quick Sort (25 分) There is a classical process named partition in the famous quick sort algorithm. In this proc

原创 PAT B1019/A1067 題解

1069 The Black Hole of Numbers (20 分) For any 4-digit integer except the ones with all the digits being the same, if

原创 PAT-A1029題解---解決內存超過限制

1029 Median (25 分) Given an increasing sequence S of N integers, the median is the number at the middle position. Fo

原创 PAT B1040/A1093題解---解決內存超限測試點的問題

1040 有幾個PAT (25 分) 字符串 APPAPT 中包含了兩個單詞 PAT,其中第一個 PAT 是第 2 位§,第 4 位(A),第 6 位(T);第二個 PAT 是第 3 位§,第 4 位(A),第 6 位(T)。 現給

原创 PAT-A1044題解

1044 Shopping in Mars (25 分) Shopping in Mars is quite a different experience. The Mars people pay by chained diamon