首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

poj -2632 Crashing Robots

In a modernized warehouse, robots are used to fetch the goods. Careful planning is needed to ensure that the robots reach their destinations without crashing into each other. Of course, all warehouses are rectangular, and all robots occupy a circular floor space with a diameter of 1 meter. Assume there are N robots, numbered from 1 through N. You will get to know the position and orientation of each robot, and all the instructions, which are carefully (and mindlessly) followed by the robots. Instructions are processed in the order they come. No two robots move simultaneously; a robot always completes its move before the next one starts moving. A robot crashes with a wall if it attempts to move outside the area of the warehouse, and two robots crash with each other if they ever try to occupy the same spot.

03

python excel处理

def csv_to_xlsx(input,output): with open(input, encoding='ANSI') as f: read = csv.reader(f) workbook = Workbook() sheet = workbook.active l = 1 ds=datesecon() com = re.compile("(\n|\t){1,}") border = Border(left=Side(style='thin', color='FF000000'), right=Side(style='thin', color='FF000000'), top=Side(style='thin', color='FF000000'), bottom=Side(style='thin', color='FF000000'), diagonal=Side(style='thin', color='FF000000'), diagonal_direction=0, outline=Side(style='thin', color='FF000000'), vertical=Side(style='thin', color='FF000000'), horizontal=Side(style='thin', color='FF000000')) for line in read: st = "@@@".join(line) ss = re.sub(com, "\n", st) line = ss.split("@@@") r = 1 if l>1 and (string_toDatetime(line[4]) < ds[0] or string_toDatetime(line[4]) > ds[1]): r = r + 1 continue for i in line: sheet.cell(row=l, column=r).border = border sheet.cell(row=l, column=r).value = i sheet.cell(row=l, column=r).alignment = Alignment(wrapText=True) if(l==1): fill = PatternFill("solid", fgColor="FFFF00") sheet.cell(row=l, column=r).fill = fill r = r + 1 l = l + 1 col_width = [] i = 0 for col in sheet.columns: for j in range(len(col)): if j == 0: col_width.append(len(str(col[j].value))) else: if col_width[i] < len(str(col[j].value)): col_width[i] = len(str(col[j].value)) i = i + 1 for i in range(len(col_width)): col_letter = get_column_letter(i+1) if col_width[i] > 100: sheet.column_dimensions[col_letter].width = 100 elif col_width[i]: if col_width[i]<=6:col_width[i]=10 sheet.column_dimensions[col_letter].width = col_width[i] workbook.save(output) # 保存Excel

04

扫码

添加站长 进交流群

领取专属 10元无门槛券

手把手带您无忧上云

扫码加入开发者社群

相关资讯

热门标签

活动推荐

    运营活动

    活动名称
    广告关闭
    领券