P1518测试点3、6、8超时了

P1518 [USACO2.4] 两只塔姆沃斯牛 The Tamworth Two

果然是这样的,是不是有的点故意把某个角色给卡死角了,然后一直遇不到啊? 这里投机取巧了一下然后就AC了 ```python def cal_time(): del_time = 0 next_dir_cow = [0] next_dir_John = [0] while cow_pos != John_pos: each_move(John_pos, next_dir_John, "F") each_move(cow_pos, next_dir_cow, "C") del_time += 1 if del_time > 1000: # 超过1000直接返回None默认不相遇 return None return del_time ``` 虽然思路不正确,但是还是过掉了
by HITACorz @ 2024-04-09 16:21:06


|