list_result = [] while (True): list_len = len(pai_list) # list_len_j = int(list_len) for j inrange(list_len): num_j = j * 2
if list_len - num_j - 1 >= 0: list_result.append(pai_list[list_len - num_j - 1]) else: break # print("ff:", pai_list) number = [] for i inrange(list_len): num_j = i * 2 if list_len - num_j - 1 >= 0: number.append(list_len - num_j - 1) else: break # print("ff:index", number, 'list:', pai_list) for del_index in number: pai_list.pop(del_index)
if list_len <= 1: break return list_result
if __name__ == "__main__": ''' zjtd 第二题 ''' pai_list = [] n = input() for i inrange(int(n)): line = sys.stdin.readline().strip().split(' ') for li inrange(0, len(line)): values = line[li] values = int(values) pai_list.append(values)