PTA甲级——1046 1046 Shortest DistanceThe task is really simple: given N exits on a highway which forms a simple cycle, you are supposed to tell the shortest distance between any pair of exits. Input Specification:Ea 2024-04-17 PAT甲级备考专区 #练习 #算法 #PAT #前缀和 #化曲为直思想
PTA甲级——1041 1041 Be UniqueBeing unique is so important to people on Mars that even their lottery is designed in a unique way. The rule of winning is simple: one bets on a number chosen from [1,104]. The first one 2024-04-17 PAT甲级备考专区 #练习 #算法 #PAT #大模拟
PTA甲级——1040 1040 Longest Symmetric StringGiven a string, you are supposed to output the length of the longest symmetric sub-string. For example, given Is PAT&TAP symmetric?, the longest symmetric sub-string i 2024-04-17 PAT甲级备考专区 #练习 #算法 #PAT
PTA甲级——1038 1038 Recover the Smallest NumberGiven a collection of number segments, you are supposed to recover the smallest number from them. For example, given { 32, 321, 3214, 0229, 87 }, we can recover many nu 2024-04-17 PAT甲级备考专区 #练习 #算法 #PAT #贪心