摘要:
import re n = input() for i in range(int(n)): str = input() if re.match(r'A*PA+TA*',str): a = re.split(r'[P|T]',str)if (a[0] * len(a[1]) == a[2]): pri 阅读全文
摘要:
Given any permutation of the numbers {0, 1, 2,..., N−1}, it is easy to sort them in increasing order. But what if Swap(0, *) is the ONLY operation tha 阅读全文
摘要:
The ranklist of PAT is generated from the status list, which shows the scores of the submissions. This time you are supposed to generate the ranklist 阅读全文
摘要:
According to Wikipedia: Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insert 阅读全文