摘要:
def robot(command, obstacles, x, y): xx = 0 yy = 0 tmp = [] for c in command: if c == 'U': yy += 1 if c == 'R': xx += 1 tmp.append([xx, yy]) #print(tm 阅读全文
摘要:
from heapq import *heap=[]for i in range(10,1,-1): heappush(heap,i)print(heap)print(heappop(heap))print(heap)print(nlargest(3,heap))print(nsmallest(3, 阅读全文